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.

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.

Related Probability Tools and Concepts

Dice Roll Simulators - Explore probability with six-sided and custom dice, including sum distributions and multiple dice experiments.

Binomial Distribution Calculator - Calculate exact probabilities for n independent trials with fixed success probability, the mathematical model underlying coin tosses.

Expected Value Visualizers - Understand how probability weights combine with outcomes to determine long-run averages.

Probability Distribution Explorers - Compare different discrete and continuous probability models with interactive parameters.

Bernoulli Trial Theory - Learn the mathematical foundation of single binary experiments that coin tosses exemplify.

Sample Space Calculators - Explore sample spaces for various probability experiments beyond coin tosses.

Random Variable Simulators - Generate samples from different probability distributions to observe empirical behavior.