In a virtual pub quiz last week, Lucy and I were responsible for hosting the science round. Here was our question.

Put the following events in chronological order:

1. Discovery of the structure of DNA

2. Invention of the telescope

3. Periodic table developed

4. Invention of spectacles

5. Extinction of the dodo

6. Discovery of Uranus

7. Einstein’s theory of general relativity

8. First use of fingerprints in detection

9. Darwin’s theory of evolution

10. BCG vaccine first used on humans

Go on, have a go, write down your guess. I will tell you the correct answers in a moment, but before I do, how are you planning on evaluating your performance? What if you get 9 out of 10 events in the right order, but it turns out the event you thought might be last was actually first. Then you got 0 out of 10 events in the right place, but surely you deserve more than 0 points.

One reasonable way of doing this is by counting inversions. There are 45 *pairs* of events, and you deserve a point for every pair of events you get in the right order. An annoyance with this in practice is that it’s a little tedious to calculate quickly (there are 45 pairs to check), so I wrote a little tool for doing it. Try it in your own virtual pub quiz! (You may want to rescale to a 0–10 standard.)

Anyway, here is the correct ordering:

Invention of spectacles (1290)

Invention of the telescope (1608)

Extinction of the dodo (1662)

Discovery of Uranus (1781)

Darwin’s theory of evolution (1859)

Periodic table developed (1869)

First use of fingerprints in solving crime (1892)

Einstein’s theory of general relativity (1915)

BCG vaccine first used on humans (1921)

Discovery of the structure of DNA (1953)

Mathematically, assume the events are represented by the symbols in such a way that the correct ordering is , and the proffered solution is , which is some permutation of . The number of inversions in is defined by

This quantity goes by many names, e.g., bubble-sort distance in computer science, Kendall tau distance in statistics, Coxeter length in group theory.

If is sorted then , while if is anti-sorted then , and

Write

where indicates the event that . The pairwise correlations are readily calculated, because they reduce to statistics of 3-symbol permutations. Certainly and are independent if , while

It follows that

(Given a triple , how many times do we have in each of the three cases above? Twice, twice, twice.) Call this (note ). Then, statistically, if our quiz participant is just a random monkey, we expect

The script in the link above computes

which under the null hypothesis has zero mean and unit variance. Score more than 2 to convince me you’re not a monkey!