Randomness 101: Fair coins, PRNGs & seeds
What makes a coin flip "random"? When should you use cryptographic randomness vs a seeded PRNG? How big should N be to see ~50/50?
Fair vs biased
A fair coin has p = 0.5 for Heads each flip. A biased coin has p ≠ 0.5. Our tool lets you set p to simulate weighted coins.
Random number generators
- Secure: cryptographically strong randomness from the browser (Web Crypto).
- Seeded: reproducible pseudo‑randomness; same seed → same sequence.
- Fast: the browser’s
Math.random(), quick but not cryptographically strong.
Law of large numbers
As N grows, the observed Heads % will tend toward the true probability p. Expect short‑term swings for small samples.
Streaks happen
Consecutive Heads or Tails streaks are common in random sequences. Long streaks don’t "correct themselves" — each flip is independent.
FAQ
What’s exported to CSV?
Two columns: index (1‑based) and result (H/T). Use backend for very large runs.
Are results truly random?
The Secure mode uses cryptographic randomness from your device. Seeded and Fast are pseudo‑random, good for demos and reproducibility.