Nair pointed out in the comments yesterday that some triplets of heads and tails are more common than others. At first glance, that seems impossible – each toss is independent of every other toss, and any combination of heads and tails must be as likely as any other combination of heads and tails.
Here’s a post from Futility Closet, on the other hand, that tries to explain why HHT is a better choice than HTH. There seems to be in fact a general strategy for choosing these triplets: flip the middle coin, add what you get to the beginning and drop the last one. (This turns HTH into HHT.)
I wanted to see if I could actually verify this on a computer. I tried two approaches: First, I ‘tossed a coin’ a million times, noted down each toss, and searched for HTH and HHT in the resulting array. Second, I tossed a coin repeatedly, noted down each toss, and stopped as soon as either the combination HTH or the combination HHT appeared.
In the first case, not surprisingly, the number of combinations, triplets, of either type are of very similar frequency – each one-eighth of the total number of coin-tosses. The surprise comes with the second experiment: The combination HHT is more frequent than the combination HTH – the average number of tosses of the coin before an HHT appears is 8. The number for HTH is 10.
My explanation for this is also how I wrote my code for the experiments. When you want an HHT to turn up, if your third toss is an H instead of a T, you are still two-thirds of the way to your target. If, on the contrary, you wanted HTH to turn up, and your third coin-toss turned up a T instead of an H, you’d have to start all the way from the beginning.
Can somebody here think of a better explanation? I’d like to hear it. If somebody wants to see the code I wrote for these experiments, ping me and I will send it to you. Try these experiments on your own and see if you can confirm that my answers are right. If you do, please do tell me.
[End. Fini. Kaputski. Coin-Toss!]