Published
In this lesson
Wide tables, equations, and code scroll sideways. Swipe, or Tab to focus them and use the left and right arrow keys.
Parrondo’s paradox
You will learn: Explain a winning mixture by computing the capital-state weights of each policy.
Start with: Markov chains
Game A loses on average when played repeatedly. Game B also loses in the long run. Yet choosing randomly between them can produce a positive long-run average gain. The missing detail is that B’s winning probability depends on your current capital. Switching games changes how often you visit its unfavorable states.
This is an explicit token game with no bankruptcy boundary. Each play changes integer capital by plus or minus one, and negative capital is allowed. The experiment compares exact expected capital with illustrative sample paths, so a lucky realization cannot stand in for a long-run calculation.
Inspect the games and their mixture
A wins with probability 0.495000. B wins with probability 0.095000 at multiples of three, and 0.745000 otherwise. A win adds one token; a loss subtracts one. Negative capital is allowed.
Solid: A only. Long dashes: B only. Dots: random mixture. These are exact finite-horizon expectations, not three sample paths.
| Policy | Long-run mean gain per play | Expected capital at cap | One sample's final capital |
|---|---|---|---|
| A only | -0.01000000 | -1.00000000 | 20 |
| B only | -0.00869529 | -1.39232017 | -4 |
| Random mixture | 0.01570423 | 1.28732725 | 6 |
Where the mixture spends time
| Capital modulo 3 | Mixture win probability | B-only stationary weight | Mixture stationary weight | Mixture weight at cap |
|---|---|---|---|---|
| 0 | 0.2950000 | 0.3836118 | 0.3450704 | 0.3450704 |
| 1 | 0.6200000 | 0.1542806 | 0.2541080 | 0.2541080 |
| 2 | 0.6200000 | 0.4621077 | 0.4008216 | 0.4008216 |
Inspect mixed-game decisions
| Play | Capital before | Residue | Game | Win probability | Outcome |
|---|---|---|---|---|---|
| 1 | 0 | 0 | A | 0.4950000 | Win |
| 2 | 1 | 1 | B | 0.7450000 | Loss |
| 3 | 0 | 0 | A | 0.4950000 | Loss |
| 4 | -1 | 2 | A | 0.4950000 | Loss |
| 5 | -2 | 1 | A | 0.4950000 | Loss |
| 6 | -3 | 0 | A | 0.4950000 | Win |
| 7 | -2 | 1 | B | 0.7450000 | Win |
| 8 | -1 | 2 | B | 0.7450000 | Win |
| 9 | 0 | 0 | A | 0.4950000 | Win |
| 10 | 1 | 1 | B | 0.7450000 | Win |
| 11 | 2 | 2 | B | 0.7450000 | Win |
| 12 | 3 | 0 | A | 0.4950000 | Loss |
| 13 | 2 | 2 | B | 0.7450000 | Win |
| 14 | 3 | 0 | B | 0.0950000 | Loss |
| 15 | 2 | 2 | B | 0.7450000 | Loss |
| 16 | 1 | 1 | B | 0.7450000 | Win |
| 17 | 2 | 2 | B | 0.7450000 | Win |
| 18 | 3 | 0 | A | 0.4950000 | Loss |
| 19 | 2 | 2 | A | 0.4950000 | Win |
| 20 | 3 | 0 | B | 0.0950000 | Loss |
| 21 | 2 | 2 | A | 0.4950000 | Win |
| 22 | 3 | 0 | A | 0.4950000 | Win |
| 23 | 4 | 1 | B | 0.7450000 | Win |
| 24 | 5 | 2 | B | 0.7450000 | Loss |
| 25 | 4 | 1 | A | 0.4950000 | Win |
| 26 | 5 | 2 | B | 0.7450000 | Win |
| 27 | 6 | 0 | A | 0.4950000 | Win |
| 28 | 7 | 1 | B | 0.7450000 | Win |
| 29 | 8 | 2 | B | 0.7450000 | Win |
| 30 | 9 | 0 | B | 0.0950000 | Win |
| 31 | 10 | 1 | B | 0.7450000 | Loss |
| 32 | 9 | 0 | A | 0.4950000 | Win |
| 33 | 10 | 1 | B | 0.7450000 | Loss |
| 34 | 9 | 0 | B | 0.0950000 | Loss |
| 35 | 8 | 2 | A | 0.4950000 | Win |
| 36 | 9 | 0 | A | 0.4950000 | Loss |
| 37 | 8 | 2 | A | 0.4950000 | Win |
| 38 | 9 | 0 | A | 0.4950000 | Win |
| 39 | 10 | 1 | B | 0.7450000 | Win |
| 40 | 11 | 2 | B | 0.7450000 | Loss |
| 41 | 10 | 1 | B | 0.7450000 | Win |
| 42 | 11 | 2 | B | 0.7450000 | Win |
| 43 | 12 | 0 | B | 0.0950000 | Loss |
| 44 | 11 | 2 | A | 0.4950000 | Loss |
| 45 | 10 | 1 | A | 0.4950000 | Loss |
| 46 | 9 | 0 | B | 0.0950000 | Loss |
| 47 | 8 | 2 | A | 0.4950000 | Loss |
| 48 | 7 | 1 | A | 0.4950000 | Win |
| 49 | 8 | 2 | A | 0.4950000 | Loss |
| 50 | 7 | 1 | B | 0.7450000 | Win |
| 51 | 8 | 2 | A | 0.4950000 | Win |
| 52 | 9 | 0 | B | 0.0950000 | Loss |
| 53 | 8 | 2 | B | 0.7450000 | Loss |
| 54 | 7 | 1 | A | 0.4950000 | Loss |
| 55 | 6 | 0 | B | 0.0950000 | Loss |
| 56 | 5 | 2 | A | 0.4950000 | Win |
| 57 | 6 | 0 | A | 0.4950000 | Win |
| 58 | 7 | 1 | B | 0.7450000 | Win |
| 59 | 8 | 2 | A | 0.4950000 | Win |
| 60 | 9 | 0 | A | 0.4950000 | Win |
| 61 | 10 | 1 | A | 0.4950000 | Loss |
| 62 | 9 | 0 | A | 0.4950000 | Loss |
| 63 | 8 | 2 | A | 0.4950000 | Win |
| 64 | 9 | 0 | A | 0.4950000 | Win |
| 65 | 10 | 1 | A | 0.4950000 | Win |
| 66 | 11 | 2 | B | 0.7450000 | Loss |
| 67 | 10 | 1 | A | 0.4950000 | Win |
| 68 | 11 | 2 | A | 0.4950000 | Win |
| 69 | 12 | 0 | A | 0.4950000 | Loss |
| 70 | 11 | 2 | A | 0.4950000 | Loss |
| 71 | 10 | 1 | A | 0.4950000 | Win |
| 72 | 11 | 2 | B | 0.7450000 | Win |
| 73 | 12 | 0 | B | 0.0950000 | Loss |
| 74 | 11 | 2 | A | 0.4950000 | Win |
| 75 | 12 | 0 | B | 0.0950000 | Loss |
| 76 | 11 | 2 | A | 0.4950000 | Win |
| 77 | 12 | 0 | A | 0.4950000 | Loss |
| 78 | 11 | 2 | B | 0.7450000 | Win |
| 79 | 12 | 0 | B | 0.0950000 | Loss |
| 80 | 11 | 2 | B | 0.7450000 | Win |
| 81 | 12 | 0 | A | 0.4950000 | Win |
| 82 | 13 | 1 | A | 0.4950000 | Loss |
| 83 | 12 | 0 | B | 0.0950000 | Loss |
| 84 | 11 | 2 | B | 0.7450000 | Win |
| 85 | 12 | 0 | B | 0.0950000 | Loss |
| 86 | 11 | 2 | A | 0.4950000 | Win |
| 87 | 12 | 0 | B | 0.0950000 | Loss |
| 88 | 11 | 2 | A | 0.4950000 | Win |
| 89 | 12 | 0 | B | 0.0950000 | Loss |
| 90 | 11 | 2 | B | 0.7450000 | Win |
| 91 | 12 | 0 | A | 0.4950000 | Win |
| 92 | 13 | 1 | A | 0.4950000 | Loss |
| 93 | 12 | 0 | B | 0.0950000 | Loss |
| 94 | 11 | 2 | B | 0.7450000 | Loss |
| 95 | 10 | 1 | B | 0.7450000 | Loss |
| 96 | 9 | 0 | B | 0.0950000 | Loss |
| 97 | 8 | 2 | A | 0.4950000 | Win |
| 98 | 9 | 0 | B | 0.0950000 | Loss |
| 99 | 8 | 2 | A | 0.4950000 | Loss |
| 100 | 7 | 1 | B | 0.7450000 | Loss |
Game A wins with probability 1/2 − ε. Game B wins with probability 1/10 − ε when capital is divisible by three, and 3/4 − ε otherwise. A win adds one token and a loss subtracts one. At each mixed-game play, choose A with probability γ and B otherwise, independently of current capital and previous choices.
The default ε = 0.005 gives A win probability 0.495. B’s two probabilities are 0.095 and 0.745. The allowed bias range keeps every coin probability valid. Set γ to one or zero to recover the individual games exactly. The mixed policy uses random switching, not a hidden state-dependent choice of which game to play.
Follow the capital modulo three
Only the residue of capital modulo three is needed to calculate the next win probability. The three states are zero, one, and two, with negative capital classified consistently: minus one belongs to residue two. A win moves residue i to i + 1 modulo three; a loss moves it to i − 1 modulo three.
For mixture γ, let pᵢ be the effective win probability in residue i. It is γ(1/2 − ε) plus (1 − γ) times B’s relevant probability. Starting from the chosen capital, the calculation propagates the three state probabilities. At each play it adds Σqᵢ(2pᵢ − 1) to expected capital, where qᵢ is the current state probability. This gives the finite-horizon mean without sampling paths.
The stationary state weights solve πP = π and sum to one. Weighting each state’s expected gain by these stationary probabilities gives long-run drift. This calculation accounts for how the game visits its own states; averaging B’s two coin probabilities equally would not.
What changes under switching
With the default parameters, B alone spends about 0.383612 of its stationary time at residue zero. Its long-run drift is about −0.00869529 tokens per play. A’s drift is exactly −0.01. In the half-A, half-B mixture, the stationary weight at residue zero falls to about 0.345070, and the effective win probabilities become 0.295 there and 0.62 elsewhere. The resulting drift is about +0.01570423.
The mixed gain is not the average of the two separate games’ long-run gains. Those gains use different stationary state weights. A changes the routes through capital space and therefore changes the opportunities B encounters. B contains favorable states even though its own overall long-run drift is negative.
At one hundred plays from zero capital, the exact means are −1 for A, about −1.392320 for B, and +1.287327 for the mixture. These differ from drift multiplied by one hundred because the initial state distribution need not be stationary. A has constant expected gain in every state, so it has no such transient correction.
A path can tell a different short story
For the default seed, A’s sample ends at +20 despite its negative expected gain. The mixed path ends at +6, while B ends at −4. These outcomes illustrate fluctuation; the plotted expectation curves do not fit themselves to those samples. Changing the seed changes the paths while retaining the theoretical means and drifts.
Make a prediction
If two games each have negative conditional expected gain in every possible state, can random mixing of them create a positive conditional gain?
Explore the answer
No. A mixture of two negative conditional gains is still negative. Parrondo’s construction works because B has favorable states and switching changes their long-run weights.
Increasing ε can remove the winning mixture, and γ at either endpoint returns to a single game. The phenomenon is not a theorem that any combination of losing games must win. Harmer and Abbott’s original account introduces this construction; their Statistical Science treatment develops the game analysis. Continue to Markov chains to study stationary weights directly.