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.

Theory updates immediately with valid inputs. Run explicitly starts a finite sample, or repeats the same sample after completion; Pause resumes from the same random sequence. Presets change only angles, keeping N and seed. Editing any input discards the previous sample. Reset restores all defaults and the live theory preview. A hidden page or navigation pauses sampling. Only exact input texts are retained, including unfinished/invalid/comma values; legacy numeric inputs migrate. No samples, outcome counts, intervals or progress positions are saved. Reload returns to theory, and the interval is withheld until all predetermined N pairs have been drawn. Expand the data section for exact group counts/correlations; advanced sample size and seed are under Options.

Sources: Cambridge, Principles of Quantum Mechanics, §10.6.2 and Carnegie Mellon, concentration inequalities and Hoeffding’s inequality.