Course Home

The CHSH Game

An interactive exploration of Bell inequality and quantum advantage

How the CHSH Game Works

The CHSH game is a cooperative game between two players — Alice and Bob — who cannot communicate once the game begins. A Referee coordinates each round.

No Communication A Alice B Bob Referee x=0 y=0 a=0 b=0

Click Play or Step to watch a round of the CHSH game unfold.

Win Condition

The referee’s rule is designed to test whether Alice and Bob can truly coordinate without communication. In three of the four cases, they just need to agree. But in the special (1,1) case, they must disagree — creating a tension that’s impossible to resolve perfectly with any classical strategy.

Formally, Alice and Bob win when their answers satisfy:

$$a \oplus b = x \wedge y$$

The XOR of their answers must equal the AND of their questions:

xyx ∧ yNeed a ⊕ b =To Win
0000a = b (same)
0100a = b (same)
1000a = b (same)
1111a ≠ b (different)
The catch: If they always give the same answer, they win 3 out of 4 cases (75%) but always lose the (1,1) case. No classical strategy can beat 75%. But quantum entanglement can reach ~85.4%!

Play the Classical Game

Try to beat the 75% classical limit! Choose answers for Alice and Bob each round, or pick a strategy and run automatically.

Click "New Round" to start playing!

Alice

Question received:
?
Your answer:
VS

Bob

Question received:
?
Your answer:
Awaiting round...
Rounds
0
Wins
0
Losses
0
Win Rate
--%

All 16 Deterministic Strategies

Each player has 4 deterministic strategies (a function from input to output). That's 4 × 4 = 16 combinations. None beats 75%.

Bob's strategy ↓
Alice's strategy ↓
Click any cell to see details. The best classical strategy wins exactly 75% — no deterministic or randomized strategy can exceed this.

Can We Do Better?

You've seen that every classical strategy maxes out at 75%. This isn't bad luck or a bad strategy — it's a provable mathematical ceiling. No amount of cleverness, pre-planning, or shared randomness can push past it.

But remarkably, quantum mechanics allows Alice and Bob to break this barrier — not by communicating, but through the correlations hidden in entanglement.

If Alice and Bob share an entangled quantum state before the game, they can win ~85.4% of the time — more than 10 percentage points above the classical limit! This is the essence of Bell inequality violation.
Recall: No classical strategy beats 75%. Now let's see how entanglement changes the game.

The Quantum Strategy

The quantum strategy follows the same rules as the classical game — Alice and Bob still cannot communicate once the game begins. The difference is what they share beforehand: instead of just a pre-agreed plan, they share an entangled quantum state.

1

Share Entanglement

Before the game, Alice and Bob prepare a Bell state — a pair of qubits in a specific entangled superposition:

$$|\Phi^+\rangle = \frac{1}{\sqrt{2}}\big(|00\rangle + |11\rangle\big)$$

Alice takes the first qubit, Bob takes the second. This state means: if both measure in the standard \(|0\rangle, |1\rangle\) basis, they always get the same result — either both 0 or both 1, with equal probability. But the power of entanglement goes further than perfect correlation in one basis.

2

Receive Questions

The referee sends a random bit \(x\) to Alice and \(y\) to Bob, exactly as in the classical game. They must each reply with a bit (\(a\) and \(b\)) without communicating.

3

Choose a Measurement Basis

Here is the key quantum ingredient. Each player picks a measurement angle \(\theta\) that depends on their input. This angle defines a rotated basis in the \(|0\rangle / |1\rangle\) plane:

$$|0_\theta\rangle = \cos\theta\,|0\rangle + \sin\theta\,|1\rangle \;\to\; \textbf{outcome 0}$$ $$|1_\theta\rangle = -\sin\theta\,|0\rangle + \cos\theta\,|1\rangle \;\to\; \textbf{outcome 1}$$

Outcome 0 if the qubit is found in \(|0_\theta\rangle\), outcome 1 if found in \(|1_\theta\rangle\).

At \(\theta = 0\), this is just the standard basis: \(|0_\theta\rangle = |0\rangle\) and \(|1_\theta\rangle = |1\rangle\). As \(\theta\) increases, the basis rotates — the “0-direction” tilts away from \(|0\rangle\) toward \(|1\rangle\).

4

Measure & Answer

Each player measures their qubit in their chosen basis. The measurement collapses the qubit to one of the two basis states, giving output 0 or 1. That output is their answer to the referee.

! Key Insight

When Alice and Bob measure in similar directions (small angle difference), the entanglement causes their outcomes to agree with high probability. When they measure in very different directions (large angle difference), outcomes tend to disagree. By carefully choosing which angle to use for each input, they can make agreements happen in the three “same answer” cases and disagreement happen in the one “different answer” case — beating 75%.

The Quantum Circuit

Here is the circuit that implements the quantum strategy. The left half prepares the shared Bell state; the right half shows each player measuring in their input-dependent basis.

|0⟩ |0⟩ H entangled Game starts R(θA) R(θB) → a → b Alice Bob

H = Hadamard, = CNOT, R(θ) = measurement basis rotation. The rotation angle depends on the input: θA(x) for Alice, θB(y) for Bob.

Measurement Angles

Each angle \(\theta\) defines a measurement basis — a rotated version of the standard \(|0\rangle / |1\rangle\) basis. The optimal strategy spaces four angles evenly at \(\pi/8\) increments. Let's examine each of the four input cases and the exact basis states used.

For the Bell state \(|\Phi^+\rangle\), the probability of getting the same outcome is:

$$P(a = b) = \cos^2(\theta_A - \theta_B)$$

The closer the two measurement directions, the more likely the outcomes agree. At 0 difference → 100% agreement. At \(\pi/4\) → 50%. At \(\pi/2\) → 0%.

x = 0, y = 0 Need: a = b
θA = 0°
\(|0_\theta\rangle = |0\rangle \;\to\; \textbf{0}\)
\(|1_\theta\rangle = |1\rangle \;\to\; \textbf{1}\)
θB = π/8
\(|0_\theta\rangle = \cos\tfrac{\pi}{8}|0\rangle + \sin\tfrac{\pi}{8}|1\rangle \;\to\; \textbf{0}\)
\(|1_\theta\rangle = -\sin\tfrac{\pi}{8}|0\rangle + \cos\tfrac{\pi}{8}|1\rangle \;\to\; \textbf{1}\)
Δθ = π/8 P(win) ≈ 85.4%  ✓
x = 0, y = 1 Need: a = b
θA = 0°
\(|0_\theta\rangle = |0\rangle \;\to\; \textbf{0}\)
\(|1_\theta\rangle = |1\rangle \;\to\; \textbf{1}\)
θB = −π/8
\(|0_\theta\rangle = \cos\tfrac{\pi}{8}|0\rangle - \sin\tfrac{\pi}{8}|1\rangle \;\to\; \textbf{0}\)
\(|1_\theta\rangle = \sin\tfrac{\pi}{8}|0\rangle + \cos\tfrac{\pi}{8}|1\rangle \;\to\; \textbf{1}\)
Δθ = π/8 P(win) ≈ 85.4%  ✓
x = 1, y = 0 Need: a = b
θA = π/4
\(|0_\theta\rangle = \tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle) \;\to\; \textbf{0}\)
\(|1_\theta\rangle = \tfrac{1}{\sqrt{2}}(-|0\rangle + |1\rangle) \;\to\; \textbf{1}\)
θB = π/8
\(|0_\theta\rangle = \cos\tfrac{\pi}{8}|0\rangle + \sin\tfrac{\pi}{8}|1\rangle \;\to\; \textbf{0}\)
\(|1_\theta\rangle = -\sin\tfrac{\pi}{8}|0\rangle + \cos\tfrac{\pi}{8}|1\rangle \;\to\; \textbf{1}\)
Δθ = π/8 P(win) ≈ 85.4%  ✓
x = 1, y = 1  ★ Need: a ≠ b
⚠ The hard case — requires disagreement
θA = π/4
\(|0_\theta\rangle = \tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle) \;\to\; \textbf{0}\)
\(|1_\theta\rangle = \tfrac{1}{\sqrt{2}}(-|0\rangle + |1\rangle) \;\to\; \textbf{1}\)
θB = −π/8
\(|0_\theta\rangle = \cos\tfrac{\pi}{8}|0\rangle - \sin\tfrac{\pi}{8}|1\rangle \;\to\; \textbf{0}\)
\(|1_\theta\rangle = \sin\tfrac{\pi}{8}|0\rangle + \cos\tfrac{\pi}{8}|1\rangle \;\to\; \textbf{1}\)
Δθ = 3π/8 P(win) ≈ 85.4%  ✓

Notice the elegant symmetry: the first three cases need agreement (small angle \(\pi/8\) → high cos²), while the special (1,1) case needs disagreement (large angle \(3\pi/8\) → high sin²). All four cases achieve the same ≈ 85.4% win rate!

Combined View — All Four Directions

Interactive: Explore Angles

Adjust the measurement angles and see how the win probability changes. The optimal angles are pre-set — try moving them to see why they're special!

45°
22.5°
-22.5°
xyΔθP(win)Need
Overall Win Probability
85.36%
Classical Best
75.00%
Quantum Advantage
+10.36%

Why π/8? Finding the Optimal Angles

For three of the four (x,y) cases, Alice and Bob need the same output. The probability of agreement is \(\cos^2(\Delta\theta)\), which is maximized when the angle difference is small. But for the (1,1) case they need different outputs, with probability \(\sin^2(\Delta\theta)\), maximized when the angle difference is large.

The geometry forces a tradeoff: the four angular gaps between measurement bases are constrained. If you space them evenly at \(\pi/8\) increments around the circle, three gaps are small (\(\pi/8\) each, giving \(\cos^2(\pi/8) \approx 85.4\%\) agreement) and the remaining gap is \(3\pi/8\) (giving \(\sin^2(3\pi/8) \approx 85.4\%\) disagreement). Every case wins with the same high probability!

Let \(d\) be the angular spacing. With evenly spaced angles, the average win probability over all four cases is:

$$P_{\text{win}} = \frac{3\cos^2(d) + \sin^2(3d)}{4}$$

Taking the derivative and setting it to zero, the optimum is at \(d = \pi/8 = 22.5°\), giving \(P_{\text{win}} = \cos^2(\pi/8) \approx 85.36\%\).

Classical vs Quantum: Head-to-Head

Run the same random questions against both strategies simultaneously. The classical strategy always outputs 0; the quantum strategy uses optimal entangled measurements. Watch the gap emerge!

Classical Strategy

--
Target: 75.00%
0 / 0 rounds

Quantum Strategy

--
Target: 85.36%
0 / 0 rounds
Theoretical limits: Classical = 75.00% | Quantum = cos²(π/8) ≈ 85.36% (Tsirelson's bound). Run more rounds to see tighter convergence.

Per-Case Breakdown

How does each (x,y) input pair contribute? Watch how the quantum advantage concentrates on the special (1,1) case.

CaseClassicalQuantumΔ
x=0, y=0Run a simulation to see results

Round-by-Round Log (last 50)