🪙 Quantum Coin Game

Beat a quantum computer at coin flipping — and find out why you never had a chance.

Heads100%
Tails0%

?

The real Qiskit code

The same game as an interactive Jupyter notebook — the quantum circuit runs on Qiskit, and you can change it.

▶ Open the notebook
~20 min · everyone — no prerequisites · runs in your browser, no account
Opens a free Jupyter session on mybinder.org (via QuBins) — starting it can take a few minutes
Prefer it local? git clone the repository, create the conda environment from environment.yml, and open Quantum-Coin-Game.ipynb.

You and a quantum computer take turns flipping a coin — without looking at it. If it shows heads at the end, the quantum computer wins. Play a few rounds and you’ll notice something unsettling: you lose. Every time.

Show the solution

The trick is that the quantum computer doesn’t flip the coin, it puts it into superposition — heads and tails at once. Whatever you do on your turn, its second move uses interference to steer the coin back to heads with certainty. The game is a gentle introduction to superposition and interference, two effects that quantum algorithms rely on.

In the notebook, two players make the moves: first with ordinary coin moves only, then player A gets the quantum H move. You see the circuit for the moves, run it on a simulator, try your own gate sequences, and follow the short calculation that shows why A wins every time with two H moves.

More games