Take a simple example of tossing a coin repeatedly. A head comes up ten times in a row. Now we all know that, on average and over time, a fair coin should give us the same percentage of heads and tails. So it can seem surprisingly reasonable that the next throw is more likely to be a tail.
That's the gambler's fallacy, because, of course, the coin has no memory. It has no way of telling what came before, so the next toss is still equally likely to be heads or tails. (Some argue that actually it's more likely to come up a head again - for a demonstration of why this can be the case, see the start of my video below.)
At a simple level, it's quite easy to get your head around what's happening here, but some of the subtleties of the gambler's fallacy are still easy to miss - and that's where a new paper by Steven Tijms comes in (you can read the full thing here). Tijms points out how counter-intuitive the behaviour of randomness is. For example, he shows how to calculate the chances of getting, say, five or more heads or tails in a row in 100 coin tosses - the answer is remarkably 97.2%. Even a run of seven or more with the same face is more likely to occur than not in 100.
We also see how the law of large numbers - the idea that, for example, the ratio of heads to tails will get closer to 50:50 as we repeat the toss many times - doesn't work the way we tend to assume it will. In part this is because we underestimate what 'many times' means. Tijms points out, for example, to be 95% sure that the relative frequencies of heads and tails is in the 48-52% range it's necessary to toss a coin around 2,500 times. But also there's something more fundamental that fuels the gambler's fallacy.
Because the relative frequencies are tending towards 50:50 as we get more and more, it's tempting to think that the gap between number of heads and number of tails thrown must reduce. And so, if there's a big gap, say many more heads than tails, it's hard to resist the feeling that the coin needs to counter this by coming up with a lot more tails. But this is still the gambler's fallacy. It's perfectly possible for those relatively frequencies to get closer and closer to 50:50 yet to have the gap between numbers of heads and tails increase rather than decrease.
I've only been able to give a taster of Tijm's paper - I'd recommend taking a look as it is very readable and is not loaded with scary mathematics.
Here's the video for the coin toss oddity: