Coin Flipper

Simulate coin flips instantly. Adjust how many times to flip and the bias of the coin to see how the proportion of heads and tails behaves.

Simulate up to 200 flips at a time.

0.5 represents a fair coin. Values above create a bias toward heads.

Heads Probability

50.0%

Theoretical

Tails Probability

50.0%

Theoretical

Flips Simulated

1

Per experiment

How to Use This Calculator

  1. Choose how many times to flip the coin and optionally set a bias toward heads.
  2. Click “Flip the Coin” to simulate the experiment immediately.
  3. Compare empirical counts with theoretical probabilities for heads and tails.
  4. Repeat the experiment to observe convergence to the expected probabilities.

Formula

The probability of heads is set to p. Each individual flip is independent with outcomes:

  • P(Heads) = p
  • P(Tails) = 1 − p
  • The expected number of heads in n flips equals n × p.

Full Description

This simulator demonstrates the law of large numbers. As the number of flips grows, the fraction of heads should approach the theoretical probability p. When the coin is biased, the long-run average reflects that bias. Use repeated simulations to observe how randomness produces short-term streaks yet still gravitates toward the expected value over many trials.

The tool also lets you explore unfair coins by changing the probability of heads. This is useful for studying Bernoulli processes, betting strategies, and statistical experiments.

Frequently Asked Questions

Why do results vary each time?

Each simulation uses independent random draws. Short sequences can deviate noticeably from the expected value, illustrating natural variability.

Can I simulate very large numbers of flips?

To keep the interface responsive, the calculator limits simulations to 200 flips at a time. Run multiple experiments to build intuition without overwhelming your browser.

How does bias affect the outcome?

A higher probability of heads shifts the expected proportion accordingly. The simulator updates both theoretical and empirical values to reflect the change.

Is the random number generator truly random?

It uses JavaScript's pseudo-random generator for demonstration purposes. For cryptographic or scientific applications, specialized random sources are recommended.