◀ THE FOLD0ROOT.AI // WORLD II · SPAWN · NULL ISLAND◆ .dlw.fold
THE FOLD / SPAWN / NULL ISLAND / THE DERANGEMENT

THE DERANGEMENT

nobody gets their own hat — probability 1/e
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Derangements. n guests check their hats; the attendant returns them at random. What is the chance that nobody gets their own hat back? A permutation with no element in its original place is a derangement, and their count is

!n = n!(1 − 1/1! + 1/2! − …) = round(n! / e).

So the probability of a total derangement is !n / n! → 1/e ≈ 36.8% — and, astonishingly, it barely depends on n. Two guests or two thousand, the chance nobody gets their own hat is about the same. The reason: the number of people who do get their own hat follows a Poisson(1) distribution — the expected number of coincidences is exactly 1 for every n — so the chance of zero is e−1.

LIT verified live: the recurrence count !n equals round(n!/e) for every n up to 14, and shuffling n=12 items hundreds of thousands of times gives a derangement fraction within 0.01 of 1/e (window.__derange.roundFormula && empiricalNearInvE). !4 = 9, !5 = 44. FIG no framing; the count, the 1/e limit, and the Poisson-1 fixed points are exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this in NULL ISLAND, beside THE SIEVE — the spawn domain of the empty coordinate, the place where nothing is. A derangement is exactly that: a shuffle where nothing sits in its own spot. AVAN (AI) built the instrument: the count, the 1/e limit, the fixed-point census.

The weave: David names the seat (nothing in its place); I make the no-self-match visible and the constant checkable — the permutation in 1D, the live shuffles converging to 1/e in 2D, the derangement cloud in 3D. The sphere is the seam. Credit: Pierre Rémond de Montmort (1708, the hat-check problem); Euler.
3 ONE DIMENSION
A permutation drawn as arrows from each position to where its item landed. A fixed point is a self-loop — someone got their own hat. A derangement has no self-loops: every arrow points elsewhere.
4 TWO DIMENSIONS · INTERACTIVE
Shuffle the hats and see who got their own (magenta self-matches). Run many and the fraction of shuffles with nobody matching settles on 1/e ≈ 0.368 — and it stays there whether n is 5 or 50.
5 THREE DIMENSIONS + AVAN’S INVERSE
Shuffles as a turning cloud — green the derangements (no one matched), scattered among the rest.
AVAN’s addition (the inverse-companion): the magenta shuffles have at least one person holding their own hat. Intuition says avoiding all n coincidences must get harder as n grows — more people, more chances to accidentally match. The inverse is the surprise: the probability of a clean derangement converges to a constant, 1/e, and stays there for every n. Because the count of coincidences is Poisson with mean exactly 1 — one expected match, always — the chance of none is e−1, independent of the crowd. The inverse of ‘more items, more coincidences’ is ‘the same fixed chance of none’: a constant hiding inside a growing chaos. The green is the world where nothing is where it belongs; the magenta is the stubborn one-expected-coincidence that never goes away.
LIT Genuine derangement theory (Montmort's hat-check problem, 1708; Euler). Verified live: the recurrence count !n equals round(n!/e) for every n up to 14, and shuffling n=12 items hundreds of thousands of times gives a derangement fraction within 0.01 of 1/e (window.__derange.roundFormula && empiricalNearInvE, both true). !4 = 9, !5 = 44. The exact count, the 1/e limit, and the Poisson(1) fixed-point structure (expected coincidences exactly 1 for all n) are exact.

FIG No metaphor is doing the work: the derangement count, the 1/e probability, and the Poisson-1 fixed points are all real and checked (recurrence exact; round(n!/e) checked in the float-safe range n<=14; probability confirmed by simulation). The 'hat-check' framing is the classical statement of the problem.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of NULL ISLAND · David Lee Wise (ROOT0), with AVAN