A coin flip probability calculator works out the chance of getting a number of heads in a number of flips, and the chance of a streak of heads in a row. Enter the number of flips and the number of heads, and you get the chance of exactly that many, of that many or fewer and of that many or more. A second mode gives the chance of at least one run of a given length. It also works for a biased coin, and for any two-outcome event. It runs in your browser.
How to use the coin flip probability calculator
- Choose heads in a number of flips or a streak.
- Enter the number of flips and the number of heads, or the length of the streak.
- Change the chance of heads if the coin is not fair.
- Press Calculate.
The binomial formula
The Wikipedia article on the binomial distribution gives the chance of exactly k successes in n independent trials as C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ, where p is the chance of success in each trial and C(n, k) is the number of ways to choose k of the n trials. The mean number of successes is np, and the variance is np(1 − p).[1] The page requires the trials to be independent and the chance to stay the same between them.[1] For a fair coin, p = 0.5. The chance of exactly 6 heads in 10 flips is 210 ÷ 1,024, which is 20.51 percent.
A worked example from the page
The page's example is a biased coin that lands heads 30 percent of the time. The chance of exactly 4 heads in 6 tosses is C(6, 4) × 0.3⁴ × 0.7² = 0.059535.[1] Enter 6 flips, 4 heads and a chance of 0.3, and the calculator gives 5.9535 percent. The page gives the cumulative distribution as the sum of the chances of 0 up to k successes.[1] The chance of at least k successes is not stated on the page, and follows as 1 minus the chance of at most k − 1, which is how the calculator finds it.
At most and at least
The calculator adds the chances over the range that you want. For 10 fair flips, the chance of 6 or fewer heads is 82.81 percent, and the chance of 6 or more is 37.70 percent. They add up to more than 100 percent because both include the case of exactly 6. The mean number of heads is 5, and the standard deviation is 1.58, so 6 heads is quite ordinary.
Streaks of heads
The article on the gambler's fallacy states that the chance of a run of five heads is 1/32, but that this applies only before the first coin is tossed.[2] The streak mode finds the chance that a run of a given length appears somewhere in a number of flips, which is more than the chance for one given run. The pages that we read do not give a formula for this, so we work it out by tracking the length of the current run flip by flip. For 5 flips, the chance of 5 heads in a row is 1/32, or 3.125 percent. For 10 flips, the chance of at least one run of 3 heads is 50.78 percent. In 100 flips, a run of 5 heads is very likely, at about 81 percent.
How long until a run
For a fair coin, the average number of flips that you wait for the first run of r heads is 2^(r+1) − 2: 2 flips for a run of 1, 6 for 2, 14 for 3 and 62 for 5. For a coin with a chance p of heads, the formula is (1 − pʳ) ÷ ((1 − p) pʳ). This is a standard result that the pages do not state, and the calculator shows it as the flips needed on average. The wait grows quickly with the length of the run.
Independence and the gambler's fallacy
The page defines the gambler's fallacy as the belief that an independent and equally probable outcome which has happened less often than expected is more likely in the future. It says that, for a fair coin, the outcomes of different tosses are statistically independent and the chance of heads on a single toss is 1/2, so after four heads the next toss is still heads with a chance of 1/2.[2] The chance that a run continues for one more toss is always 0.5. The page adds that if a coin shows 21 heads in a row, it is reasonable to doubt that the coin is fair.[2]
Using it for other events
The same formulas work for any event with two outcomes and a constant chance: the number of defective items in a batch, the number of correct answers when guessing, or the number of babies of a given sex. Set the chance of heads to the chance of your event. For a multiple-choice test with 10 questions and four answers each, a pure guesser has p = 0.25, and the chance of getting 5 or more right is about 7.8 percent.
Common mistakes
- Thinking a tail is due. The coin has no memory.
- Confusing exactly with at least. They are different results.
- Expecting streaks to be rare. In a long sequence they are common.
- Using the formula with dependent trials. The chance must stay the same.
What next
Use this often? Add Coin Flip Pr to your Home screen.
Frequently asked questions
What is a coin flip probability calculator?
A tool that finds the chance of a number of heads in a number of flips, and of a streak of heads in a row.
What is the formula for the chance of k heads in n flips?
C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ. For a fair coin, 6 heads in 10 flips is 210 ÷ 1,024, about 20.5 percent.
What is the chance of 5 heads in a row?
1 in 32, or 3.125 percent, for five flips. In 100 flips, at least one run of 5 is very likely.
Does a run of heads make tails more likely?
No. The flips are independent, and the next flip is heads with a chance of 1/2. Believing otherwise is the gambler's fallacy.
How many flips until a run of r heads?
On average 2^(r + 1) − 2 for a fair coin. A run of 5 takes 62 flips on average.
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.