A round-up of a mathsy week

Maths!

First of all, I’ve written an article for the Aperiodical, an irregular maths blogging collective kind of a thing. It’s about voting systems, crazy dice, paper, lizards and Spock.

Grime Dice” are a set of five coloured dice with unusual combinations of numbers on them. The red die, for example, has five fours and a nine. The blue one has three twos and three sevens, so it loses to the red die about 58% of the time. The green die has five fives and a zero, and will lose to the blue one in 58% of rolls. What makes them interesting is that the green die will beat the red one in 69% of rolls. These three dice behave rather like rock-paper-scissors — in mathematical terms, they are ‘non-transitive’. The full set of Grime Dice also has a purple and a yellow die, so a better analogy would be rock-paper-scissors-lizard-Spock. You might ask which is the best Grime die, and the obvious solution is just to roll all five dice at once, a hundred times, and see which one wins the most times. This is why you should never believe something simply because it is obvious. Read the rest at Aperiodical.com

I’ve been quite reasonably asked what Ranked Pairs did to deserve omission, to which my only answer is “be a bit inelegant and have a boring name” (not that I have any particular room to criticise it for either of those). If you’re interested, in Ranked Pairs, you start with the strongest preference the voters expressed (say, Labour are better than UKIP), “lock it in”, then keep locking in preferences, in decreasing order of strength and skipping any that would create Grime-dice-style cycles, until you’ve figured out an ordering on all the candidates. The winner is the one who beats every other candidate in the final, locked-in pairings. It’s not so very different from Beatpath (which I did include) but even after Paul’s recasting of it <a href=”https://twitter.com/ciphergoth/status/191636931078144000” title=”@ciphergoth: @Andrew_Taylor Each bit says “is this relation satisfied”, and the bits are ordered by votes.”>in more elegant terms</a> it still feels a bit clunky to me. I appreciate that “a bit clunky” is not a completely valid mathematical criticism.

Secondly, my maths-based comedy rant thing about stupid formulæ in PR newsfodder will be on at the new Kingston Skeptics in the Pub group on Thursday 2 August. It’s at the Ram Jam Club, which is here:

Come down if that sounds like somewhere near where you live. You’ll learn how to derive the existence of tiny shoe-horns using quantum physics and a cheap advert for some guy’s book. (Connection fans may note that the golf club to the east shares its name with a popular electoral system.)

Lastly, here is some maths I found scattered around the web, which I may bring out at Manchester MathsJam tonight (spoiler alert). It’s about counting, binary, puzzles and hypercubes (as is all maths).

Picture a counter, like the ones used to count people into clubs or on the obnoxious Lynx adverts a few years ago. When a digit ticks over, all the digits to the right of it also tick over to zero. If you had a really big club (or a really noxious deodorant) you might end up changing hundreds of digits at a time. Binary is no different – but sometimes having to change all those bits at precisely the same time causes problems, so you’d much rather only change one digit at a time. To this end, Frank Gray invented a revised binary counting system where that is exactly what happens. In 3-bit, you start as normal at 000, then 001, and then you go to 011 – the nearest unused number. Next, you go to 010 which you missed out, then skip to 110. Next, comes 111, then 101, and then 100 – the only number left. To get back to zero, you flip that single bit at the front back to 000. To get to eight, you need four bits, and it’s 1100 – again only one bit has changed.

So how do you know which bit to flip? Every second flip, starting with the first, is the right-most bit. Every fourth, starting with the second, is the next rightmost bit. Every eighth, starting with the fourth, is the third rightmost. And so on. I think this is interesting, because it’s also the solution to the Towers of Hanoi game: in that, you move the smallest disc first, and every second move after that. You move the second smallest second, and every fourth move after that. You move the third smallest fourth, and every eighth move after that. And so on. This is a neat way to visualise why the time needed to solve Hanoi increases as 2n. (It’s also the solution to the Chinese Ring Puzzle which, generalising from myself, I shall assume you haven’t heard of and ignore.)

Counting in Gray Code is also equivalent to visiting every corner of a hypercube without visiting any twice: if you think of a binary number like 101 as a set of co-ordinates (1, 0, 1), then the numbers 000 to 111 denote the corners of a cube. 00 to 11 give you a square, and 0000 to 1111 give you a four-dimensional hypercube. Obviously you could visit them in standard binary order (0000, 0001, 0010… 1111) but that means taking diagonal tracks through the cube. Gray Code’s system of only changing one bit at a time means you can do it just tracking along the edges – and because you can always change that last bit to get back to zero, you can do a full Hamiltonian cycle, just along the edges, by doing nothing more taxing than counting.

I honestly don’t remember what possessed me to look up Gray Code. It had been sitting in the back of my mind for about two years, and suddenly I thought maybe it was interesting enough to mention at MathsJam. It hadn’t occurred to me that it might have any relevance to traditional wooden puzzles, hyperdimensional navigation, or indeed anything else. But it did. And that is why maths is awesome.