πŸͺ“ Streak Shredder

Feed it a streaky binary sequence. Watch it get shredded into genuinely independent fair-coin flips β€” live, from real data, with real statistics.
The paper: Witold Bednorz, RafaΕ‚ Martynek, RafaΕ‚ Meller, "A short proof of the Bernoulli decomposition theorem" β€” arXiv:2609.21476. The theorem lives in generic chaining theory: for a bounded Rademacher process indexed by a set T βŠ‚ β„“Β², it constructs admissible partitions that split T into T₁ + Tβ‚‚, where T₁ is controlled in β„“ΒΉ norm and Tβ‚‚ has bounded Ξ³β‚‚ (chaining) complexity β€” a clean structural decomposition of something complicated into two well-behaved pieces.
arXiv:2609.21476 Β· Bednorz, Martynek, Meller Β· "A short proof of the Bernoulli decomposition theorem"
Honest framing: that theorem is about metric entropy of stochastic processes, not sports streaks β€” the shared word is "Bernoulli," not the subject matter. This demo borrows its spirit β€” decompose something that looks complex into simple independent parts β€” and makes it literal and checkable with two real, textbook-grade algorithms: a lag-1 XOR decorrelation step, then von Neumann's 1951 bias-removal extractor. Everything below is computed live from the actual bit arrays, nothing is scripted. For the "hot shooter" generator used here (symmetric streak persistence), the pipeline provably outputs exact i.i.d. Bernoulli(Β½) bits; for pasted/arbitrary sequences, the same real pipeline runs and you can judge the result empirically via the stats and charts.
For the sports-betting crowd
A shooter hits 7 in a row. A roulette table lands red six times. It looks non-random β€” but a streaky-looking record is exactly what a process with zero actual memory produces most of the time. This toy makes that concrete: generate a streaky "hot hand" sequence, then mechanically strip out the hidden fair coin underneath it, and check β€” with real run-length histograms and a real runs test β€” that what's left really is 50/50 and memoryless. Looking streaky is not evidence against randomness.
Raw sequence
The "streaky" record as observed β€” makes (green) / misses (red).
Stage A β€” decorrelate
dα΅’ = xα΅’ βŠ• xᡒ₋₁  (did the outcome switch?)
Raw streak-length distribution
n bits
β€”
P(make)
β€”
lag-1 autocorr
β€”
runs-test z
β€”
Extracted fair coins
Stage B β€” von Neumann extractor applied to the Stage-A stream.
pairs (bβ‚€,b₁): 01β†’0, 10β†’1, 00/11β†’discard
Extracted streak-length distribution (vs. theoretical fair-coin curve)
n bits out
β€”
P(1)
β€”
lag-1 autocorr
β€”
runs-test z
β€”
extraction rate
β€”
Autocorrelation by lag: raw vs. extracted
If the extraction worked, the extracted series' bars should collapse toward zero at every lag β€” no memory left.