A fair flip is 50/50, but a run of flips is not
Any single flip of a fair coin has a 50% chance of heads and a 50% chance of tails, full stop. What surprises people is that flipping several coins and getting an even split is not itself a 50/50 event. Flip 10 fair coins and the chance of landing exactly 5 heads and 5 tails is 24.6%, not 50%. The reason is combinatorial: there is only one way to get all 10 heads, but there are 252 different sequences of heads and tails that add up to exactly 5 heads, so that outcome is far more likely to occur even though no individual sequence is more likely than any other.
That count of sequences is the binomial coefficient C(n,k) = n! / (k!(n−k)!), read "n choose k." Multiply it by the probability of one specific sequence with k heads, p^k × (1−p)^(n−k), and the result is the binomial probability mass function: P(x; p, n) = C(n,x) × p^x × (1−p)^(n−x), the formula published in the NIST/SEMATECH Engineering Statistics Handbook. It applies to any fixed number of independent yes/no trials at a constant success probability, not just coins: free throws, quality-control pass rates, and A/B test conversions all follow the same shape.
Worked example: exactly 5 heads in 10 flips
n = 10, k = 5, p = 0.5. C(10,5) = 10!/(5!5!) = 252. P = 252 × 0.5⁵ × 0.5⁵ = 252 × (1/1024) = 24.6%. Compare that to exactly 0 heads (all tails): C(10,0) = 1, so P = 1/1024 ≈ 0.10%, about 250 times rarer than the 5-heads outcome despite both being single, equally-likely coefficients away from a "special" result. This is why casino and lottery intuition about "streaks evening out" is subtly wrong: the evening-out is a fact about the count of nearby outcomes, not a force pulling future flips toward balance.
Worked example: is this coin actually fair?
Flip a coin 20 times and count 15 heads. Suspicious? Assume the coin is fair (p = 0.5) and ask how likely 15-or-more heads would be anyway: P(at least 15 of 20) = Σ, summing the binomial probability for k = 15 through 20, comes to 21,700⁄1,048,576 ≈ 2.07%. That is well under the common 5% significance threshold researchers use to call a result "statistically significant," so 15-of-20 is mild evidence the coin is biased toward heads, though it would take considerably more flips (or a starker split) to be confident rather than merely suspicious. A single run of 15 heads out of 20 is unusual for a fair coin, but at 2% odds it still happens about 1 time in every 48 sittings: evidence, not proof.
Weighted coins and loaded dice logic
Everything above assumes p = 0.5, but the same formula works for any constant probability: a coin bent to land heads 60% of the time, a basketball player who makes 70% of free throws, or a manufacturing line with a 2% defect rate. Set p to whatever the per-trial probability actually is and C(n,x) × p^x × (1−p)^(n−x) still gives the exact chance of x successes in n trials. The calculator above accepts any chance of heads from 0% to 100%, which is what makes it useful beyond novelty coin flips: the same math answers "what are the odds of 3 or more defects in a batch of 50 at a 2% defect rate" (swap "heads" for "defect").