[h=2]An example: coin-tossing[/h]The gambler's fallacy can be illustrated by considering the repeated toss of a
fair coin. With a fair coin, the outcomes in different tosses are
statistically independent and the probability of getting heads on a single toss is exactly
1⁄
2 (one in two). It follows that the probability of getting two heads in two tosses is
1⁄
4 (one in four) and the probability of getting three heads in three tosses is
1⁄
8 (one in eight).
Now suppose that we have just tossed four heads in a row, so that if the next coin toss were also to come up heads, it would complete a run of five successive heads.
Since the probability of a run of five successive heads is only 1⁄32 (one in thirty-two), a person subject to the gambler's fallacy might believe that this next flip was less likely to be heads than to be tails. However, this is not correct, and is a manifestation of the gambler's fallacy; the event of 5 heads in a row and the event of "first 4 heads, then a tails" are equally likely, each having probability 1⁄32. While a run of five heads is only
1⁄
32 = 0.03125, it is only that before the coin is first tossed. After the first four tosses the results are no longer unknown, so their probabilities are 1. Reasoning that it is more likely that the next toss will be a tail than a head due to the past tosses, that a run of luck in the past somehow influences the odds in the future, is the fallacy.
[h=2]Explaining why the probability is 1/2 for a fair coin[/h]
We can see from the above that, if one flips a fair coin 21 times, then the probability of 21 heads is 1 in 2,097,152. However, the probability of flipping a head after having already flipped 20 heads in a row is simply 1⁄2. This is an application of Bayes' theorem.
This can also be seen without knowing that 20 heads have occurred for certain (without applying of Bayes' theorem). Consider the following two probabilities, assuming a fair coin:
- probability of 20 heads, then 1 tail = 0.520 × 0.5 = 0.521
- probability of 20 heads, then 1 head = 0.520 × 0.5 = 0.521
The probability of getting 20 heads then 1 tail, and the probability of getting 20 heads then another head are both 1 in 2,097,152. Therefore, it is equally likely to flip 21 heads as it is to flip 20 heads and then 1 tail when flipping a fair coin 21 times. Furthermore, these two probabilities are equally as likely as any other 21-flip combinations that can be obtained (there are 2,097,152 total); all 21-flip combinations will have probabilities equal to 0.521, or 1 in 2,097,152. From these observations, there is no reason to assume at any point that a change of luck is warranted based on prior trials (flips), because every outcome observed will always have been as likely as the other outcomes that were not observed for that particular trial, given a fair coin. Therefore, just as Bayes' theorem shows, the result of each trial comes down to the base probability of the fair coin: 1⁄2.