Coin Flip Probability: Streaks, Odds, and the Gambler's Fallacy
A fair coin lands heads with probability 1/2 on every flip, no matter what came before. To get the probability of an exact sequence of n flips, multiply 1/2 by itself n times. Getting exactly HTHHT in five flips has probability (1/2)^5 = 1/32, about 3.1%. Getting exactly k heads somewhere in n flips uses the binomial formula, covered below.
Calculating these numbers is not the hard part. The harder part is that intuition about randomness is often wrong. Long streaks show up far more often than most people expect, and many people believe a coin is "due" for tails after a run of heads. This guide covers the main formulas with worked examples, explains why streaks are normal, and shows a way to get a fair 50/50 result even from a coin you suspect is biased.
All examples assume independent flips, meaning one flip has no effect on the next. That holds for a properly tossed coin and for a well-built random number generator.
How to calculate the probability of a specific sequence of flips
Each flip of a fair coin has two equally likely outcomes. Because the flips are independent, you multiply their probabilities. So any specific sequence of n flips has probability (1/2)^n, or 1 in 2^n.
The rule applies to every sequence, not only the ones that look special. HHHHH has exactly the same probability as HTTHT: 1/32 each. HHHHH looks remarkable only because we notice the pattern.
| Flips (n) | Probability of one exact sequence | As a percentage | Odds against |
|---|---|---|---|
| 1 | 1/2 | 50% | 1 to 1 |
| 2 | 1/4 | 25% | 3 to 1 |
| 3 | 1/8 | 12.5% | 7 to 1 |
| 5 | 1/32 | 3.125% | 31 to 1 |
| 10 | 1/1,024 | about 0.098% | 1,023 to 1 |
| 20 | 1/1,048,576 | about 0.0001% | 1,048,575 to 1 |
Probability vs. odds: probability compares successes to all outcomes, while odds compare failures to successes. A 1/8 chance of three heads in a row means 1 way to win and 7 ways to lose, so the odds are 7 to 1 against. To turn fractions into percentages, see how to calculate percentages.
Probability of at least one head in n flips
"At least one" questions are easiest to answer through the opposite event. The only way to get zero heads is to flip all tails, and that has probability (1/2)^n. Everything else contains at least one head, so:
P(at least one head in n flips) = 1 − (1/2)^n
This is called the complement rule. It saves you from adding up every case with one head, two heads, three heads, and so on.
- 3 flips: 1 − 1/8 = 7/8 = 87.5%
- 5 flips: 1 − 1/32 = 31/32 = 96.875%
- 10 flips: 1 − 1/1,024 = 1,023/1,024 ≈ 99.9%
You can also work backward. To be at least 99% sure of seeing a head, you need (1/2)^n ≤ 0.01. Six flips give 1/64 ≈ 1.56%, which is too high. Seven flips give 1/128 ≈ 0.78%, so seven flips are enough: 1 − 1/128 ≈ 99.2%.
For a coin that lands heads with probability p, the same reasoning gives 1 − (1 − p)^n.
Probability of exactly k heads in n flips: the binomial formula
When you don't care about the order, only the count, many sequences produce the same result. Two heads in four flips can happen as HHTT, HTHT, HTTH, THHT, THTH, or TTHH. That is six sequences, each with probability 1/16, so the answer is 6/16 = 37.5%.
The binomial formula handles this in general:
P(exactly k heads in n flips) = C(n, k) × p^k × (1 − p)^(n − k)
Here C(n, k), read "n choose k," counts the ways to pick which k of the n flips are heads: C(n, k) = n! / (k! × (n − k)!). For a fair coin, p = 1/2, so the formula reduces to C(n, k) / 2^n.
Worked example: exactly 5 heads in 10 flips
- Count the arrangements: C(10, 5) = 10! / (5! × 5!) = 3,628,800 / (120 × 120) = 3,628,800 / 14,400 = 252.
- Count all possible sequences: 2^10 = 1,024.
- Divide: 252 / 1,024 ≈ 0.246, or about 24.6%.
Even the most likely result, an exact 50/50 split, happens less than a quarter of the time. As n grows, the chance of an exact even split keeps falling. It is 50% for 2 flips, about 24.6% for 10, and about 8.0% for 100. The proportion of heads gets closer to 1/2, but the exact count spreads over more possible values.
"At least k heads": add the cases
For "at least 7 heads in 10 flips," add the binomial counts for 7, 8, 9, and 10 heads:
C(10,7) + C(10,8) + C(10,9) + C(10,10) = 120 + 45 + 10 + 1 = 176
176 / 1,024 ≈ 17.2%. So about one in six sets of ten flips will have seven or more heads.
With a biased coin
Suppose a coin lands heads 60% of the time. The probability of exactly 3 heads in 5 flips is:
C(5,3) × 0.6^3 × 0.4^2 = 10 × 0.216 × 0.16 = 0.3456, or about 34.6%.
The only change from the fair case is that p and 1 − p are no longer equal, so the shortcut of dividing by 2^n no longer applies.
Why streaks are more common than you think
Ask people to write down 100 made-up coin flips, and the longest run in their list usually looks short. Real sequences contain longer runs because a streak can start at almost any position. One stretch of five flips is all heads only 1/32 of the time. But 100 flips contain 96 overlapping stretches of five, and only one of them needs to be all heads.
The table shows the chance of at least one run of k or more heads in a row somewhere in n fair flips. The values for 10 and 20 flips come from exact counts of all sequences. The values for 50 and 100 flips come from the standard recurrence for run lengths and are rounded to one decimal place.
| Run of k+ heads | 10 flips | 20 flips | 50 flips | 100 flips |
|---|---|---|---|---|
| 3 or more | 50.8% | 78.7% | 98.3% | over 99.9% |
| 4 or more | 24.5% | 47.8% | 82.7% | 97.3% |
| 5 or more | 10.9% | 25.0% | 55.2% | 81.0% |
| 6 or more | 4.7% | 12.2% | 31.5% | 54.6% |
| 7 or more | 2.0% | 5.8% | 16.5% | 31.8% |
For example, in 10 flips there are exactly 112 sequences out of 1,024 that contain five or more heads in a row, which gives the 10.9% in the table.
Streaks of either face
Most people would notice a streak of tails just as much as a streak of heads. With a fair coin, there is a neat shortcut for that case. Look at each pair of neighboring flips and note whether they are the same or different. A run of k identical faces is the same as k − 1 "same" results in a row among the n − 1 pairs. With a fair coin, each same/different result is itself an independent 50/50 outcome, so:
P(run of k+ of either face in n flips) = P(run of k − 1 or more heads in n − 1 flips) (fair coin)
This shortcut does not hold for a biased coin, because there the same/different results are no longer 50/50 and independent of each other.
Applying it to a fair coin:
- A run of 4+ of the same face in 10 flips: 238/512 ≈ 46.5%.
- A run of 5+ of the same face in 20 flips: about 45.8%.
- A run of 6+ of the same face in 100 flips: about 80.7%.
- A run of 7+ of the same face in 100 flips: about 54%.
So in 100 fair flips, the longest same-face streak is more likely than not to be seven or longer. In general, the longest streak grows roughly with log2(n). Doubling the number of flips adds only about one flip to the typical longest run, but that typical run is still longer than most people guess.
The gambler's fallacy: why the coin isn't "due"
The gambler's fallacy is the belief that after a run of one outcome, the other outcome becomes more likely. After five heads, many people feel tails is "due." It isn't. The coin has no memory, so the next flip is still 50/50.
You can check this with the sequence rule. HHHHHH and HHHHHT are both specific six-flip sequences, so each has probability 1/64. Once the first five heads have already happened, the two possible endings are equally likely.
How the averages even out without "catching up"
The law of large numbers says the proportion of heads approaches 1/2 as flips pile up. Many people take this to mean that a surplus of heads must be cancelled by extra tails later. In fact the surplus gets diluted, not corrected.
Say the first 10 flips are all heads. Over the next 990 flips you expect 495 heads, so the expected total after 1,000 flips is 10 + 495 = 505 heads. That is 50.5%, close to half. Heads is still expected to be ahead by 10. The gap stays the same on average while the proportion shrinks toward 1/2.
When a streak should change your mind
With a coin you know is fair, a streak tells you nothing about the next flip. With a coin you are unsure about, a long streak of heads is weak evidence that the coin or the tossing method favors heads. That points toward more heads, which is the opposite of what the gambler's fallacy predicts. Real coins and real tossing techniques aren't perfectly fair, but for an ordinary toss any bias is usually small. A handful of flips can't reliably detect it, because streaks like these are common even with a perfectly fair coin.
How to make a fair decision with a possibly biased coin
If you suspect a coin is biased, you can still get an exactly fair result. The method, usually credited to John von Neumann, works without knowing how strong the bias is.
- Flip the coin twice.
- If you get heads then tails (HT), option A wins.
- If you get tails then heads (TH), option B wins.
- If you get HH or TT, ignore the pair and go back to step 1.
Why von Neumann's trick works
Let p be the unknown probability of heads. Because the flips are independent, P(HT) = p × (1 − p) and P(TH) = (1 − p) × p. These are the same product, so HT and TH are exactly equally likely whatever p is. Throwing away HH and TT removes the lopsided outcomes and leaves a perfect 50/50 choice.
The cost is extra flips. Each pair gives a result with probability 2p(1 − p), so the expected number of flips is 2 / (2p(1 − p)) = 1 / (p(1 − p)).
| Heads probability p | Chance a pair decides | Expected flips |
|---|---|---|
| 0.5 | 50% | 4 |
| 0.6 | 48% | about 4.2 |
| 0.7 | 42% | about 4.8 |
| 0.9 | 18% | about 11.1 |
The trick needs two conditions. The flips must be independent, and p must stay the same from flip to flip. If the person tossing can control the outcome, no procedure using that coin is fair.
Choosing among three options
The same rejection idea works for more than two choices. With a fair coin, flip twice: HH picks A, HT picks B, TH picks C, and TT means you flip again. Each of the three outcomes has probability 1/4 out of the 3/4 that count, so each option gets exactly 1/3. Random number generators use similar rejection methods to produce unbiased results. See how random number generators work for the background.
Quick reference: coin flip formulas
- Exact sequence of n flips (fair coin): (1/2)^n. Ten flips gives 1/1,024.
- At least one head in n flips: 1 − (1/2)^n. Biased coin: 1 − (1 − p)^n.
- Exactly k heads in n flips: C(n, k) × p^k × (1 − p)^(n − k). Fair coin: C(n, k) / 2^n.
- At least k heads: add the exact results for k, k + 1, …, n, or subtract the cases below k from 1.
- Run of k+ of either face in n flips (fair coin): same as a run of k − 1 or more heads in n − 1 flips. Not valid for a biased coin.
- Converting probability to odds against: (1 − P) / P. For P = 1/8 that is 7 to 1.
- Next flip after any streak (fair coin): still 1/2.
- Fair result from a biased coin: flip in pairs, HT = A, TH = B, and repeat on HH or TT. Expect 1 / (p(1 − p)) flips.
Frequently Asked Questions
What are the odds of flipping heads 10 times in a row?
If you flip exactly 10 times, the chance that all of them are heads is 1/1,024, about 0.098%, or 1,023 to 1 against. That changes a lot if the 10 heads can appear anywhere in a longer series, because there are many places a streak could start. Over thousands of flips, a 10-head run becomes fairly likely.
Is it better to call heads or tails?
For a fair coin it makes no difference, since each side has probability 1/2. A real coin or tossing method may have a slight bias, but it is usually small and you won't know which way it goes. If fairness matters, von Neumann's pair method removes any steady bias.
Does best two out of three make a coin toss fairer?
With a fair coin, best of three is still exactly 50/50, so it adds nothing. With a biased coin it makes the bias worse. If heads comes up 60% of the time, heads wins a best-of-three with probability 0.6^3 + 3 × 0.6^2 × 0.4 = 0.216 + 0.432 = 64.8%.
What is the expected number of heads in n coin flips?
The expected number is n × p, so a fair coin gives n/2. For 100 fair flips you expect 50 heads, but the chance of exactly 50 is only about 8%. Results somewhat above or below the expected value are normal.