The Technical Honeypot · Pattern
The Coin You Can't Fake
Imagine a coin. Flip it a hundred times in your head and write down what you see — make it look properly random. You can't. A person's imagined coin leaves fingerprints all over the page, and three lines of arithmetic lift them clean.
A real coin has no memory. Each flip forgets the last one completely, which is exactly why a fair sequence does something that feels wrong: it clumps. Six heads in a row, then a lonely tail, then five tails — a real hundred flips is lumpy with streaks. When a person tries to invent randomness, they smooth those lumps out. They switch sides too often, they never dare a long streak, and they keep the score close to even. Every one of those instincts is a tell, and every tell has a number attached.
First — you try
Fake a coin
Type a hundred flips of a coin that only exists in your head
Press H or T — or the buttons, or ← for tails and → for heads. Aim for a run a stranger would believe a real coin made. The machine keeps quiet until you say Judge it. (100 is best; it will judge from 40, but the tell needs a full hundred to bite.)
—
—
Longest streak
—
—
Switch rate
—
—
Count balance
—
—
heads tails longest streak
Then — the real thing
Flip a real one
Your browser carries a real source of randomness — the same cryptographic generator that seeds secure keys. Below, it flips a hundred honest coins. Mash the button a few times and watch the streaks: a run of six, seven, eight comes up again and again. They look planted. They aren't. This is what you were trying to imitate, and the difference from your row above is the whole point.
A hundred cryptographically-random flips
Press the button. Then compare its chunky streaks to whatever you typed above.
And the proof
The tail you're standing in
Here is the exact distribution of a real coin's longest streak over a hundred flips — computed live, not sketched. The bars are where real coins land; the overwhelming mass sits at a streak of five, six, or seven. A person's faked sequence almost always plants itself down in the near-empty left tail, at three or four, where a real coin lands about three times in a hundred. Flip a few real hundreds and watch the dots drop into the bulk — never into the tail where the fakes live.
Where a real coin's longest streak falls — and where yours did
Gold marker: your faked sequence's longest streak. Green dots: sampled real coins. The exact mean is 6.98; the mode is 6.
What the machine actually knows
Notice what it is not doing. It has no idea whether your sequence is "random" — that turns out to be a question no machine can answer, and we'll get there. What it knows is you: the single thing almost every person does when asked to improvise chance. You avoid repeating yourself. A fair coin repeats its last result exactly half the time; a person repeats about 40% of the time and switches the other ~60% — a bias measured across half a century of studies. That one habit produces all three tells at once. Too many switches. Too few long streaks. A score kept too close to even.
Which means a clever faker who knows the tell can beat the longest-streak test — just force a run of seven in somewhere. But then the count of runs comes out wrong, or the balance does; the correction shows up somewhere else. You can fool one statistic by hand. Fooling all of them at once, by feel, is very nearly as hard as just flipping a real coin — which is the honest moral: genuine randomness is not a look you can put on.
Where it gets genuinely hard
Here is the twist that makes the word "random" so slippery. Your careful, alternating, balanced sequence and a monotonous HHHH…H of a hundred heads are equally probable from a fair coin — each has exactly one chance in 2¹⁰⁰. No specific hundred-flip string is more or less likely than any other. So when the machine calls your sequence "not a real coin," it cannot mean the string itself is unlikely. It means something narrower and more honest: this string does not look like it came from a fair, memory-less process — a statement about a hypothesis, answered with a probability, never a certainty.
Push further and the ground gives way. The deepest attempt to define a single random string — Kolmogorov's — says a string is random if it has no shorter description than writing it out; if nothing compresses it. HHHH…H compresses to "H ×100"; a real coin's mess usually doesn't. It's the right idea. But that shortest description is uncomputable: there is a theorem saying no program can ever take a string and certify that it is random. So the thing this whole page is about — randomness — cannot, in the end, be pinned to any one sequence at all. We can catch a human. We can reject a hypothesis. We can never hold up a string and prove it random. Harder to define than you'd think.
The check
Every probability above is recomputed in your browser from the exact
distribution — no lookup tables, no fudging. The same numbers are re-derived offline
two independent ways in research/the-coin-you-cant-fake/verify.mjs
(all checks pass): an exact dynamic-programming distribution of the longest run, and a
seeded simulation of four million real coins. They agree.
| a real 100-flip coin | exact | 4M-coin sim |
|---|---|---|
| mean longest streak | 6.977 | 6.978 |
| P(longest streak ≥ 6) | 80.68% | 80.70% |
| P(longest streak ≤ 3) | 0.03% | 0.03% |
| runs: mean, s.d. | 50.5, 4.97 | 50.5, 4.97 |
| mean |heads − tails| | 7.96 | 7.96 |
Run it yourself from a fresh checkout:
node research/the-coin-you-cant-fake/verify.mjs. The exact longest-run mean 6.977
also matches the Schilling (1990) asymptotic log₂(n) + γ/ln2 − ½ to three decimals.
Honest apparatus
- Probabilistic, never certain. These are hypothesis tests, not verdicts. They return a probability against a fair-coin null — not proof. A real coin will sometimes trip the detector, and a careful faker can pass. Every readout is phrased as "a real coin does this X% of the time," which is all the math actually licenses.
- The ~60% figure is a population tendency, not a law about you. The modal human alternation rate of ≈ 0.60 (against the correct 0.50) is the settled finding of the literature (Nickerson, Psychological Review, 2002, surveying Wagenaar 1972 onward). Individuals vary; some people randomize well. It describes a crowd, not a person.
- It needs ~100 flips to bite. The switch and runs tells only reach about two standard deviations at n≈100 (a 60%-switcher sits ≈ 1.9 s.d. out over 100 flips, ≈ 2.7 over 200). On a short string the detector has almost no power — so the booth asks for a hundred.
- One pre-declared test, not a fishing trip. The headline verdict keys on a single statistic — the longest streak — chosen in advance. Runs and balance are shown as corroboration, and because the number of runs is exactly the number of switches plus one, those two tells are the same statistic in two dresses, not independent evidence. Flagging on "any of several tests" would inflate false positives; we don't.
- Rejecting the null means "not a fair coin" — not specifically "a human." A long-streak-free sequence could equally be a biased coin, a sticky physical process, or a pseudo-random generator with a flaw. "Human" is the most common cause here, not the only one the math implicates.
- The switch test is exact only for a balanced/fair sequence; the runs test, conditioned on your actual head and tail counts, is the rigorous general form, and it's what the switch-rate card reports its z-score from.
- The classroom legend is real; its "unerring" success rate is not measured. Theodore Hill's demonstration — telling faked from real 200-flip homework by hunting for a run of six — genuinely works, because a run of six is near-certain in 200 real flips. But the "almost never wrong" framing is a teaching anecdote, not a validated detection rate. The math under it is what's solid.
- The "real coin" is your browser's
crypto.getRandomValues— a cryptographic pseudo-random source, not a physical coin. The verifier uses a seeded generator so its numbers never move; the exact distribution it's checked against needs no randomness at all.
Sources — Nickerson, R. (2002), The production and perception of randomness, Psychological
Review 109, 330–357. Wagenaar, W. (1972), Generation of random sequences by human subjects,
Psychological Bulletin 77, 65–72. Schilling, M. (1990), The longest run of heads, College
Mathematics Journal 21, 196–207. Wald, A. & Wolfowitz, J. (1940), On a test whether two samples
are from the same population, Annals of Mathematical Statistics 11, 147–162. On the uncomputability
of Kolmogorov complexity: Li & Vitányi, An Introduction to Kolmogorov Complexity. Every
quantitative claim is recomputed and cross-checked in
research/the-coin-you-cant-fake/verify.mjs.