Bell–CHSH inequality
Compare spin-singlet expectations with finite, seeded CHSH samples.
About this tool
This demonstration samples the predicted correlations of a spin-½ singlet, with each measured spin normalized to an outcome of +1 or −1. For settings separated by Δ, the model uses E = −cos Δ. This is the spin-singlet angle convention, not the doubled-angle convention used for photon polarization. The setting pairs are (a,b), (a,b′), (a′,b) and (a′,b′), and S = E(a,b) + E(a,b′) + E(a′,b) − E(a′,b′).
Local hidden-variable models with setting-independent preparation obey |S| ≤ 2. Quantum expectation values obey |S| ≤ 2√2. These are bounds on expectations. A finite sample can exceed 2√2; its algebraic range is −4 to +4. A raw sample value beyond ±2 is not by itself experimental evidence against a classical model.
The program draws joint outcomes (++,+−,−+,−−) with probabilities ((1+E)/4, (1−E)/4, (1−E)/4, (1+E)/4). Each party has equal marginal probabilities. The predetermined total N is distributed cyclically across the four setting pairs, so their sample counts differ by at most one. All counts are shown. The seed drives Mulberry32 for reproducible demonstrations. Pause and frame size do not change the sequence. This pseudorandom simulation is neither an independent physical experiment nor a test of the assumed quantum model.
At the fixed endpoint only, the conservative two-sided Hoeffding interval is [Ŝ−r, Ŝ+r], clipped to [−4,4], with r = √(2 ln(40) Σₖ 1/nₖ). Under independent draws, it covers the underlying CHSH expectation in at least 95% of repeated fixed-size samples. The guarantee does not apply to an arbitrary early stop or to repeatedly searching seeds for a desired result. An interval wholly outside [−2,2] is reported as a property of this simulated sample, not as experimental confirmation.
Run starts or resumes the sample. Pause, a hidden page and navigation stop sampling. Editing angles, N or the seed discards the previous result. Reset keeps the inputs and clears the sample. Valid inputs are retained across navigation. The interval is withheld until all N pairs have been drawn.
Sources: Cambridge, Principles of Quantum Mechanics, §10.6.2 and Carnegie Mellon, concentration inequalities and Hoeffding’s inequality.