← all work01 / 14 · ch. 01 — predict

Keypress Predictor

[ repo · oráculo ]

Press two keys at random. It knows which one is next.

Before every press it commits to a prediction. Chance says 50%. On most people it runs 60–70% once warmed up — and it computes the odds that your score is luck.

Kindruns in the browser
StatusRepo
PlatformWeb
Year2026
Keypress Predictorscreenshotgithub ↗
About

Humans cannot generate randomness. We alternate more than a coin does, we break streaks because three in a row feels wrong, we favour a hand. Those leaks are structure, structure is compressible, and anything compressible is predictable.

The predictor is an ensemble of order-0 through order-6 context models over your press history. Each expert estimates P(next key | last k presses); the ensemble combines them with multiplicative weights, so experts are demoted every time they’re wrong and whichever memory depth you leak at ends up carrying the vote. Structurally it is a miniature language model — a next-token predictor with an alphabet of two — in about 120 lines, and free will loses anyway.

The verdict is a two-sided binomial test against a fair coin, shown as “odds this is luck: 1 in N” rather than a p-value, because that is the version people feel. The RNG button is the falsification test: against a real random source the score must collapse to 50%, and it does.

What's in it
  • Ensemble of order-0…6 context models with multiplicative-weights combination
  • Commits to its guess before your press, then scores itself and learns
  • Binomial test rendered as odds-of-luck, not a p-value
  • Falsification button: a real RNG plays 1,000 rounds and the score collapses to chance
  • Panel showing which memory depth is currently reading you
  • One HTML file, no build, no dependencies, nothing leaves your machine
Stack
JavaScriptNo dependencies