What the page computes

You enter how many times a coin is flipped, how many heads you want and the probability of heads on one flip. The page returns the probability of getting exactly that number of heads. Fair coins use 0.5, but you can enter any value between 0 and 1 for a weighted coin, a biased process or any yes-or-no event that repeats with a fixed chance. Flips must be independent, so one outcome does not influence the next. This makes the page suitable for coin experiments, quality checks on repeated pass-or-fail tests and classroom probability exercises.

The binomial formula

The probability of exactly k heads in n flips with heads probability p is C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ. The combination C(n, k) counts the different sequences with k heads, and each sequence has the same probability pᵏ(1 − p)ⁿ⁻ᵏ. For a fair coin this simplifies to C(n, k) / 2ⁿ, meaning you count favorable sequences and divide by all 2ⁿ equally likely ones. The heads count cannot exceed the flip count, and the page accepts up to 10,000 flips. The result is a probability between 0 and 1.

Two heads in three fair flips

The default is three flips, two heads and a probability of 0.5. The eight equally likely sequences are HHH, HHT, HTH, HTT, THH, THT, TTH and TTT. Exactly three of them contain two heads: HHT, HTH and THH. So the probability is 3/8 = 0.375. The formula agrees: C(3,2) = 3, and 3 × 0.5² × 0.5 = 0.375. Listing sequences like this works only for a handful of flips, which is why the formula is needed as the flip count grows.

Ten and twenty flips

In 10 fair flips, the single most likely count is 5 heads, with probability C(10,5) / 1,024 = 252 / 1,024, about 0.2461. Seven heads has probability 120 / 1,024, about 0.1172, and ten heads in a row only 1 / 1,024, about 0.0009766. In 20 flips, exactly 10 heads has probability 184,756 / 1,048,576, about 0.1762. The most likely count is still the middle one, but it becomes less likely in absolute terms as flips increase, because probability spreads across more outcomes. Results near the middle are common and extreme counts are rare.

A biased coin

Suppose the probability of heads is 0.6. In 5 flips, the chance of exactly 3 heads is C(5,3) × 0.6³ × 0.4² = 10 × 0.216 × 0.16 = 0.3456. The same pattern handles any repeated trial with two outcomes, such as a basketball player who makes 60 percent of free throws, a part that passes inspection 99 percent of the time or a seed that germinates 85 percent of the time. Replace heads with success and enter the success probability. The independence assumption still has to be reasonable, which is the part to think about before you trust the number.

Why a streak is less surprising than it feels

People tend to expect heads and tails to alternate, but a fair coin has no memory. Ten heads in a row has probability 0.0009766 for a specific run of ten flips, yet in a long series of flips such a streak turns up somewhere fairly often. Every specific sequence of 10 flips has the same probability, 1/1,024, so HHHHHHHHHH is no more unusual than HTHTTHHTHT. Our sense that the first looks special comes from its pattern, not from its likelihood. The page lets you check how rare a specific count is, but the streak question is different from the exact-count question.

Exactly versus at least

The page gives the probability of exactly the number you enter. For ranges, add results. The chance of at least 2 heads in 3 fair flips is the sum of exactly 2 and exactly 3, which is 0.375 + 0.125 = 0.5. The chance of at least one head in n flips is simpler: 1 minus the probability of all tails, so 1 − 0.5ⁿ. For 10 flips that is 1 − 1/1,024, about 0.999. Checking whether you want exactly, at least or at most is the step most often missed in word problems. Reading the wording closely, phrases such as no more than, fewer than and at least each translate into a different set of counts to add, and fewer than 3 stops at 2. Write the allowed counts out before adding anything. In 10 fair flips, the counts 4, 5 and 6 together carry about 0.656 of the probability, so about two thirds of experiments land within one head of the average.

Averages and spread

The expected number of heads is n × p, so 100 fair flips average 50 heads. The standard deviation is √(n × p × (1 − p)), which is 5 for 100 fair flips. Roughly two thirds of experiments fall within one standard deviation of the mean, between 45 and 55 heads, and about 95 percent fall within two, between 40 and 60. This is why 60 heads in 100 flips is a little unusual but not alarming, while 70 heads would be very rare for a fair coin. The page gives exact probabilities for single counts, and these rules of thumb help you judge where to look. For a weighted coin the same formulas apply: with p = 0.6 and 100 flips, the expected count is 60 and the standard deviation is about 4.9. Comparing an observed count with n × p and the standard deviation gives a first impression of whether a result is ordinary, and the exact figure from the page then confirms it.

Does a real coin behave this way

Careful experiments on physical coin flips find outcomes very close to 50-50, with a small bias possible in the way a coin is flipped, and a study by Diaconis, Holmes and Montgomery in 2007 argued that vigorous flips land on the starting side slightly more than half the time. The effect is small enough to ignore in practice. The p input lets you model any bias you suspect, but you must supply it. The page does not estimate the probability from observed flips. The calculation assumes independent flips with one common heads probability. It cannot judge whether a series of results suggests an unfair coin, which requires a hypothesis test. Flip counts are limited to 10,000, and for large counts the probability of any single exact count becomes very small, though the formula remains valid.