GenerateRandomSearch

Fair Results From a Crooked Coin

A coin that lands heads nine times in ten still yields perfectly even results if you read the flips in pairs and throw away the ones that match. Heads-then-tails and tails-then-heads have exactly the same chance whatever the bias, because both are one head and one tail multiplied in the same way. So keeping only those two, and reading the first flip of the pair, gives an even answer without knowing the bias at all.

What this generator does

Flips a coin with the bias you set, reads the flips two at a time, keeps the pairs that disagree and throws away the pairs that match, and reports both the even results and everything that was spent getting them.

How to use this tool

  1. Set how crooked the coin is and how many even results you want.
  2. Flip, and read the results alongside the raw sequence they came from.
  3. Look at how many pairs were discarded — a very lopsided coin wastes most of them.
  4. Try an extreme bias to see the results stay even while the waste climbs.

Understanding the controls

Chance of heads
How crooked the coin is, as a percentage. Anything above 0 and below 100 works; the closer to either end, the more flips are wasted.
How many fair results
Between 1 and 200. A very lopsided coin may need many times this many flips to produce them.
Seed
A word reproduces exactly the same run of flips, which is useful when showing the same example to a class twice.

Common use cases

  • Demonstrating that fairness can be recovered without measuring bias
  • Teaching conditional probability with a result students can check
  • Showing why a badly biased source is expensive rather than useless
  • A worked example of a randomness extractor
  • Settling how a faulty coin or die could still be used fairly

How this generator works

The check replays the whole procedure over the recorded flips and confirms the kept results follow from them, then confirms the identity the method rests on: at the stated bias, heads-then-tails and tails-then-heads carry the same probability to the last decimal. That is why the output is even no matter how crooked the coin was, and the check reports the figure rather than asserting it.

Randomness and fairness

The flips come from the browser's secure generator, biased to the percentage you set. Give a seed and the same word reproduces the same flips exactly — that path is deterministic, not cryptographic, and is meant for demonstrations.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • The waste is steep. A coin landing heads 95 times in 100 discards about nine pairs in ten.
  • It assumes flips are independent and the bias does not drift. A coin that changes as it wears would break the guarantee.
  • The method evens out the results but produces them more slowly than the source.
  • It is a demonstration of the idea, not a source for anything that needs to be secret.
  • A run of flips is not kept, so record the seed before you close the tab.

Privacy and your data

Flips are produced and read in your browser. No sequence, result or seed leaves the device.