Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Coin Toss


?
100ms

Streaks

0
Longest H
0
Longest T

Recent Flips (Last 0)

No flips yet

Convergence to Expected Probability

Watch the proportion converge to 50% as flips increase. Blue dashed lines show ±2 standard error confidence bands.

Start flipping to see convergence

Statistics

0
Total
0%
Heads %
0
Heads
0
Tails
Expected: 0.0 | Distance: 0.00%








The Coin Toss Probability Model

The coin toss represents the simplest probability model: a Bernoulli trial with exactly two possible outcomes. When you flip a fair coin, heads and tails each have probability 0.5, assuming the coin has no bias and the flip is truly random. This binary structure makes coin tosses the foundational example for understanding probability, independence, and random processes.

Real coins might have slight biases due to weight distribution or design asymmetry, which is why the simulator allows adjusting P(Heads)P(\text{Heads}) from 0% to 100%. A fair coin uses 50%, but you can model biased coins by changing this parameter. Each flip is independent—previous results don't affect future outcomes, a property that often surprises people who expect patterns in randomness.

Multiple coin tosses create compound experiments with 2n2^n possible outcomes for n coins. The sample space grows exponentially: 2 outcomes for one coin, 4 for two coins, 8 for three coins, and so on. Understanding this expansion is crucial for calculating probabilities of complex events.

For comprehensive theory on coin toss probability including mathematical foundations and applications, see coin toss probability model.

Getting Started with the Simulator

The simulator displays an animated coin in the center with controls on the right. The coin changes color to show the result: gold for heads, silver for tails. Begin by setting your desired probability of heads using the slider at the bottom—default is 50% for a fair coin. Once flipping starts, this setting locks until you reset.

Click any flip button to run simulations. "Flip 1" shows the animation clearly. "Flip 10" through "Flip 10K" batch-process multiple flips instantly. The convergence graph updates after each batch, showing how your results compare to expected probability. All statistics recalculate automatically.

The auto-flip mode runs continuous simulations. Click "Auto" to start, adjust speed with the slider (10-500ms between flips), then click "Stop" when ready. Use "Reset" to clear all data and start fresh with a new probability setting.

Running Different Simulation Types

Single flips show individual coin behavior with full animation. Use "Flip 1" when demonstrating probability basics or watching the physical flip. The coin rotates 720 degrees and changes color based on the outcome. This mode best illustrates randomness at the individual trial level.

Batch flips (10, 100, 1K, 10K) demonstrate aggregate behavior without watching every flip. Click "Flip 100" to see how results cluster around expected values. Use larger batches to demonstrate convergence—"Flip 10K" shows the Law of Large Numbers in action as the proportion stabilizes near the theoretical probability.

Auto-flip mode runs indefinitely until stopped. Adjust speed to match your demonstration needs: slower (500ms) for classroom observation, faster (10ms) for rapid convergence. Watch the graph build in real-time as flips accumulate. This mode excels for showing long-run behavior.

Understanding the Convergence Graph

The convergence graph plots proportion of heads (y-axis) against number of flips (x-axis). The blue line shows actual results, while the red dashed line marks expected probability. Blue dashed curves above and below represent ±2 standard error confidence bands—the range where results should fall about 95% of the time.

Early in the simulation, the blue line jumps erratically. With few flips, randomness dominates and proportions swing widely. As flips increase, the line stabilizes and converges toward the red line. This visual demonstrates the Law of Large Numbers: short-run volatility versus long-run predictability.

If the actual proportion stays within the confidence bands, results are statistically normal. Excursions outside the bands indicate unusual runs but aren't necessarily impossible—just improbable. The graph updates dynamically, showing the complete history of how probability estimates improved with more data.

Interpreting Statistics and Metrics

The statistics panel shows total flips, actual heads percentage, and counts for both outcomes. "Expected" displays n×pn \times p where n is total flips and p is probability of heads. "Distance" measures how far the actual proportion deviates from expected, expressed as percentage points.

Variance equals np(1p)np(1-p), measuring spread in the number of heads. Standard deviation (SD) is the square root of variance, giving dispersion in the same units as counts. These values increase with more flips because absolute variability grows even as relative proportion stabilizes.

The z-score standardizes deviation: (actual headsexpected)/SD(\text{actual heads} - \text{expected}) / \text{SD}. Values between -2 and 2 are normal. Scores beyond ±2 indicate unusual results (less than 5% chance). Scores beyond ±3 are rare (less than 0.3% chance). The label "(Unusual!)" or "(Normal)" provides quick interpretation.

Tracking Streaks and Patterns

The streaks panel displays three metrics. "Current" shows the ongoing run of the same outcome—if the last five flips were all heads, it displays 5 Current H. This resets whenever the outcome changes. "Longest H" and "Longest T" track the maximum consecutive runs for each outcome across the entire simulation.

Long streaks often surprise people who expect randomness to "balance out" quickly. Even with a fair coin, streaks of 5-7 identical outcomes occur regularly in sequences of 50-100 flips. Streaks of 10+ are rare but not impossible. The tracker helps dispel the gambler's fallacy—the belief that tails is "due" after a long run of heads.

Recent flips display the last 50 outcomes as colored circles: gold for heads, silver for tails. Read from left to right to see the sequence. This visual helps identify patterns, clusters, and the overall texture of randomness. True randomness often looks clumpier than people expect.

Using the Sample Space Explorer

Select the number of coins (1-6) to generate all possible outcomes. For 3 coins, you'll see 8 possibilities (HHH, HHT, HTH, HTT, THH, THT, TTH, TTT). Each outcome displays as a row of coin images showing the specific sequence. The total grows exponentially: 2 outcomes for 1 coin, 4 for 2 coins, 8 for 3 coins, up to 64 for 6 coins.

Choose a highlight condition to filter outcomes meeting specific criteria. The tool calculates how many outcomes satisfy your condition and displays the probability. For example, selecting "Exactly 2 heads" with 3 coins highlights HHT, HTH, and THH—showing 3/8 = 37.5% probability.

Enable "Show Probabilities" to see individual outcome probabilities below each sequence. For fair coins, each outcome has equal probability 1/2n1/2^n. The counts show H and T totals for that specific sequence. This feature helps understand that while all outcomes are equally likely, not all event totals are.

The Full Sample Space for Three Coins

With three coins selected, the explorer lists every possible result: HHH, HHT, HTH, HTT, THH, THT, TTH, TTT. That is 23=82^3 = 8 outcomes, each card noting P=1/8P = 1/8.

Each coin contributes a factor of 2, so nn coins give 2n2^n outcomes. The growth is why the explorer becomes impractical well before the mathematics does — ten coins would already need 1024 cards.
TTTH: 0, T: 3P = 1/8TTHH: 1, T: 2P = 1/8THTH: 1, T: 2P = 1/8THHH: 2, T: 1P = 1/8HTTH: 1, T: 2P = 1/8HTHH: 2, T: 1P = 1/8HHTH: 2, T: 1P = 1/8HHHH: 3, T: 0P = 1/8
Full sample space, nothing highlighted

All eight ordered outcomes for three coins - gold discs for heads, silver for tails - each with its head/tail count and P = 1/8. HHT, HTH and THH are three separate cards.

As with the dice, the outcomes are ordered: HHT, HTH and THH are three separate cards even though all three have two heads. That ordering is what makes the counts come out right.

It also explains the shape of the binomial distribution directly. Exactly one outcome has three heads, three have two, three have one and one has none — the row 1,3,3,11, 3, 3, 1 from Pascal's triangle. Those counts, divided by 8, are the probabilities of getting 0, 1, 2 or 3 heads.

A Majority of Heads

The majority condition highlights every outcome with more heads than tails: HHH, HHT, HTH and THH.

P( ext{more heads than tails}) = rac{4}{8} = rac{1}{2}

Four of the eight cards light up — exactly half the space.
TTTH: 0, T: 3P = 1/8TTHH: 1, T: 2P = 1/8THTH: 1, T: 2P = 1/8THHH: 2, T: 1P = 1/8HTTH: 1, T: 2P = 1/8HTHH: 2, T: 1P = 1/8HHTH: 2, T: 1P = 1/8HHHH: 3, T: 0P = 1/8
Heads majority highlighted

Four of the eight cards: HHH, HHT, HTH, THH. Exactly half, because flipping every coin pairs each heads-majority outcome with a tails-majority one.

The result is exactly a half, and symmetry is the reason. Flipping every coin in an outcome turns a heads-majority into a tails-majority and back, pairing the 8 outcomes into 4 mirrored couples. Since no outcome can be its own mirror here, the two events must be the same size.

That argument depends on the coin count being odd. With three coins every outcome has a strict majority one way or the other, so the space splits cleanly in two. With an even number there is a third possibility — a tie — and the majority probability drops below a half.

All Three the Same

The all-same condition highlights just HHH and TTT.

P( ext{all three match}) = rac{2}{8} = rac{1}{4}

These are the two most "extreme" outcomes, one at each end of the head count.
TTTH: 0, T: 3P = 1/8TTHH: 1, T: 2P = 1/8THTH: 1, T: 2P = 1/8THHH: 2, T: 1P = 1/8HTTH: 1, T: 2P = 1/8HTHH: 2, T: 1P = 1/8HHTH: 2, T: 1P = 1/8HHHH: 3, T: 0P = 1/8
All three matching highlighted

Just HHH and TTT - 2/8 = 1/4. The first coin is free and the other two must copy it.

The quick way to see the quarter: the first coin can be anything, and the remaining two each have to match it, giving 1 imes rac{1}{2} imes rac{1}{2} = rac{1}{4}. Counting cards and multiplying probabilities agree, as they must.

This is also the pair people find least likely-looking, and that intuition is misleading. HHH has exactly the same probability as HTH — 1/81/8 each — because both are single outcomes. What is rarer is not the *sequence* HHH but the *event* "all three match", which contains two of the eight sequences rather than one.

Alternating Outcomes

The alternating condition highlights outcomes where no two adjacent coins agree: HTH and THT.

P( ext{alternating}) = rac{2}{8} = rac{1}{4}

The same probability as all-same, and for a related reason: the first coin is free and each of the next two is then forced.
TTTH: 0, T: 3P = 1/8TTHH: 1, T: 2P = 1/8THTH: 1, T: 2P = 1/8THHH: 2, T: 1P = 1/8HTTH: 1, T: 2P = 1/8HTHH: 2, T: 1P = 1/8HHTH: 2, T: 1P = 1/8HHHH: 3, T: 0P = 1/8
Alternating outcomes highlighted

HTH and THT, also 1/4. The same count as all-same, because both conditions fix every coin after the first.

Both conditions constrain every coin after the first, so both come to 2/232/2^3. The difference is only what the constraint says — "match the previous one" for all-same, "differ from it" for alternating — and neither is more restrictive than the other.

That symmetry disappears once the condition stops being local. The explorer's "equal number of heads and tails" condition highlights nothing at all with three coins, because 3 is odd and cannot split evenly — a genuinely empty event, with probability 0. It is worth selecting once: an event that exists as a description but contains no outcome is easier to accept when you have seen the grid stay blank.

Setting Highlight Conditions

"Heads count" conditions filter by the number of heads. Choose "Exactly", "At least", "At most", "More than", or "Less than", then specify the count. With 4 coins, "At least 3 heads" highlights HHHH, HHHT, HHTH, HTHH, and THHH—5 outcomes giving 5/16 = 31.25% probability.

"Runs/Streaks" highlights sequences containing consecutive identical outcomes. Select heads or tails, then set minimum length. "Runs of 3 heads" with 4 coins finds HHHH and HHHT, THHH. This demonstrates how rare long runs become as length increases.

Pattern conditions include "More heads than tails" (majority), "Equal heads and tails" (only possible with even coin counts), "Alternating pattern" (HTHTH...), and "All same" (all heads or all tails). Each condition teaches different aspects of combinatorial probability. The probability calculation updates automatically based on highlighted outcomes.

The Law of Large Numbers

The Law of Large Numbers states that as the number of trials increases, the sample proportion converges to the theoretical probability. With few flips, you might get 7 heads in 10 flips (70%), far from the expected 50%. But with 10,000 flips, you'll typically see close to 5,000 heads—within 1-2% of expected.

This doesn't mean individual outcomes become more predictable. The 10,001st flip still has exactly 50% chance of heads regardless of previous results. What changes is the aggregate: random fluctuations get diluted by the sheer volume of data. The proportion stabilizes even though absolute deviation grows.

The convergence graph visualizes this principle. Early wild swings smooth out as the blue line gravitates toward the red expected value line. The confidence bands narrow proportionally with 1/n1/\sqrt{n}, showing increasing precision of probability estimates. This fundamental theorem underlies all of statistical inference.

For detailed mathematical treatment of convergence and the Law of Large Numbers, see law of large numbers theory.