A single photon hits a 50/50 beam splitter. Quantum mechanics says the outcome — reflected (detector D0, bit 0) or transmitted (detector D1, bit 1) — is not merely unknown but irreducibly undetermined until measured: the photon's state is a superposition of both output ports, and the Born rule gives each path exactly ½ probability. This is what makes it a genuine entropy source rather than a pseudo-random algorithm.
|ψ⟩ = (|D0⟩ + i|D1⟩) / √2
P(D0) = P(D1) = |1/√2|² = 0.5
Real detectors are never perfectly balanced — the detector bias slider models a systematic asymmetry (unequal splitter ratio, differing detector efficiency, dark counts) that skews P(0) away from 0.5. Regulators and standards bodies (e.g. NIST SP 800-90B) require every certified quantum RNG to be tested for exactly this kind of bias before it can be used in cryptographic key generation — a biased entropy source leaks predictability to an attacker.
The randomness quality is quantified by the min-entropy of the empirical bit distribution:
H_min = −log₂( max(p₀, p₁) ) [bits per raw bit]
H_min = 1 for a perfectly unbiased source and falls toward 0 as bias grows — a certification lab rejects any source below its required H_min floor.
Von Neumann debiasing is the classic fix: raw bits are read in pairs. "01" outputs a 0, "10" outputs a 1, and "00"/"11" pairs are discarded entirely. This throws away roughly half the bits but the surviving output is provably unbiased regardless of the input skew — toggle it on to watch P(0) snap back toward 50% even with heavy bias.
Longest run tracks the longest streak of identical bits seen so far — a simple statistical-randomness check (related to the NIST SP 800-22 "runs test") that a real certification suite runs alongside min-entropy estimation.