standarddeviationcalculator.net

Updated Free · runs in your browser

Statistics

Parrondo's paradox calculator

Two coin games, each a slow loser. Play them in turn and the money grows. Set the games, press Simulate, and compare the exact drift of each strategy with simulated runs.

Game B checks whether capital is a multiple of M.

Repeated forever, e.g. ABAB, AABB or ABB.

The games

Each round you win or lose one unit. With a small handicap ε:

Game A: P(win) = 1/2 − ε Game B: P(win) = 1/10 − ε if capital is a multiple of 3, otherwise 3/4 − ε Expected gain per round = 2 × P(win) − 1

Worked example with ε = 0.005

Game A wins with probability 0.495, so it loses 0.01 per round on average.

Game B is harder. Track the capital modulo 3 as a Markov chain. With ε = 0, the chain spends 5/13 of its time at 0 (the bad coin) and 8/13 elsewhere, giving P(win) = 5/13 × 0.1 + 8/13 × 0.75 = 1/2 exactly: a fair game. With ε = 0.005 the long-run win probability drops to about 0.4957, a loss of about 0.0087 per round.

Now flip a fair coin each round to choose A or B. That is the same as a single game B′ whose win probability is 0.5 × 0.495 + 0.5 × 0.095 = 0.295 at a multiple of 3 and 0.5 × 0.495 + 0.5 × 0.745 = 0.62 elsewhere. Its chain spends less time at 0, and the long-run win probability comes out at about 0.5079, a gain of roughly 0.0157 per round. The fixed pattern AABB also wins, at about 0.0147 per round. Not every pattern does: type ABAB into the pattern box and the long-run win probability is about 0.4966, a loss of roughly 0.0067 per round. Strict alternation happens to land B on the bad branch too often.

With ε = 0 the random mix wins with probability exactly 727/1418 ≈ 0.5127, which the calculator reproduces if you set ε to 0.

Reading the simulation

The chart shows mean capital after each round, averaged over many runs from zero. The A-only and B-only lines drift down; the random and pattern lines drift up. Over 1,000 rounds the expected final capital is about −10 for A, −9 for B, +16 for the random mix and +15 for AABB. Single runs are noisy (the standard deviation after 1,000 rounds is about 30), which is why the calculator averages many runs.

Why it works

Game B is losing only because of how often it visits the bad branch. Alone, B tends to fall back to a multiple of 3 after winning, then lose with the bad coin. Game A is close to a fair coin flip, so it shuffles the capital and puts it on a multiple of 3 about a third of the time, less than B does on its own. B then gets to use its good coin more often, and that more than pays for A's small losses.

Common mistakes

  • Expecting it to work with any two losing games. Game B's odds must depend on a state that game A changes.
  • Reading one simulated run as the answer. Compare the exact drift column, or average many runs.
  • Making ε too large. The paradox holds only for small ε; with ε = 0.05, say, every strategy loses.
Parrondo's paradox calculator: the worked example on this page, with its result and chart
Parrondo's paradox calculator: the worked example above, at a glance.

Common questions

What is Parrondo's paradox?

Two gambling games that each lose money in the long run can win money when you alternate between them. Juan Parrondo described it in 1996, and Harmer and Abbott published the classic coin-flipping version in Nature in 1999.

How can two losing games make a winning one?

Game B is not a single coin. It uses a bad coin (win 10%) when your capital is a multiple of 3 and a good coin (win 75%) otherwise. Played alone, B's own dynamics keep landing the capital on multiples of 3 often enough to lose. Game A moves the capital more or less at random, which breaks that pattern, so B's good coin gets used more often. The combination is a different game from either part.

Does this mean I can beat a casino?

No. Game B depends on your capital in a way casino games do not, and switching between two independent losing games (such as roulette and craps) is still losing. The paradox needs a game whose odds depend on the state that the other game changes.

What does ε do?

It takes a small amount off every win probability. With ε = 0, game A is fair and game B is fair too (it wins exactly half the time in the long run). With ε = 0.005, both lose slightly, and the mixes still win: that is the paradox.

How are the long-run win probabilities calculated?

Capital modulo M (and, for a fixed pattern, the position in the pattern) forms a Markov chain. Its stationary distribution says how often each state is visited; the long-run win probability is the average of each state's win probability under that distribution. The calculator finds the stationary distribution numerically.