MathomalyA field guide to patterns, proofs and open questions

ExplorationsShuffling two bad bets can make a good one, because one of them looks at where you stand

Two Losing Games That Win Together

Exhaustively checkedprobabilitymarkov chainsparadoxintermediate

Game A wins with 0.495. Game B wins with probability 0.095 when your capital is a multiple of 3, and 0.745 otherwise. Each loses on average, by 0.0100 and 0.0087 per round, because a 0.005 is taken off every winning chance. Yet choosing between them with a fair coin each round gains on average. The paradox is only apparent, since mixing in A changes how often B meets its bad odds. A larger edge, or a B that ignores your capital, removes the gain.

Interactive laboratory

Current view: Expected capital

Follow the exact expected capital of a strategy, and one sample run, round after round.

Expected capital · edge 0.005 · B looks at capital mod 3seed 20,261,009
Working out the exact expected capital over 1,000 rounds.
Play the figure
the expected capital
the exact average
one sample run
one seeded history
A alone
exact, game A only
B alone
exact, game B only
the start
dotted line at 1,000

The horizontal axis counts rounds and the vertical axis is the capital, starting at 1,000. The thick line is the exact expectation, computed rather than simulated. The thin line is one seeded sample run, a single history that wanders about the expectation. The two dashed lines are game A alone and game B alone.

Still updating. The exact expected capital for game B alone, edge 0.005, over 1,000 rounds is not available yet.

How this page is laid out

Make a prediction

units

Working out the true value for this case...

Change the assumption

What this assumes
Mixing two games that each lose on average cannot give a game that wins on average.
What breaks it
Game B looks at the capital modulo 3 and the edge is small: mixing in A changes how often B is played at its bad residue.
Where it holds

Games whose winning chances do not depend on the state, for example game B replaced by a plain coin with the same long-run average, and edges large enough that even the capital-dependent mixture loses (about 0.014 or more for a fair mix).

What you play

Strategy

Game B on every round: its odds depend on the capital modulo 3.

The games

Taken off every winning chance, so it hurts both games a little. At zero both games are fair on average.

What game B looks at

The real game B: bad odds when the capital is a multiple of 3, good odds otherwise.

Win chances now. Game A: 49.50%. Game B: 9.50% when the capital is a multiple of 3, 74.50% otherwise.

Step by step

Run, Step, Reset and Play another run are under the figure. Speed sets how fast Run plays the rounds.

Speed

Moves how far along the run is drawn. The expected line and the sample are both fixed in advance.

Reproducible run

Rounds
Advanced parameters

Cases worth seeing

Try this

Set the fair mix and drag the edge up from zero. At what value does the mixture stop winning, and does game B alone ever win for any edge you can set?

1/3

What is going on

Each explanation begins with a worked example and follows the same operation through intuition, formal statements and proofs. Later sections distinguish what is established from questions that remain open, so you can follow the level of detail useful to you.

Worked by handThe fair mix of A and B, with 0.005 taken off every winning chance. The win chance in a round depends on the capital only through its on division by 3, so three numbers and three shares are enough to weigh it by hand.
  1. capital at a multiple of 3½ × 0.495 + ½ × 0.0950.295half the time A is played and wins 0.495; half the time B is played and, at this , wins only 0.095
  2. capital one away from a multiple of 3½ × 0.495 + ½ × 0.7450.620B has its good odds at the other two , so the same coin toss now wins 0.620
  3. how the capital spreads over the three residuessolve the three balance equations exactly0.34507, 0.25411, 0.40082long-run shares of rounds that begin at 0, 1 and 2; they add to 1
  4. weighing the win chances by those shares0.34507 × 0.295 + 0.25411 × 0.620 + 0.40082 × 0.6200.50785the chance of winning a round in the long run, which is above one half
  5. a win chance above one half2 × 0.50785 − 1+0.0157one unit is won or lost per round, so the expected change per round is twice the win chance minus one
The laboratory computes exactly this, for any strategy and any . The shares behind the weights are what the view draws as blue bars, and the final number is the slope of the thick line in the expected-capital view.
Neither game wins on average, and the mixture's win chance is neither of theirs. It is a weighted average of 0.295 and 0.620, and the weights are not a half and a half. The capital spends more of its time at the where the weight is 0.620 than a simple average would allow.
01

What you are seeing

Two games, one score, and a line that goes the wrong way

You have a score, called the capital, which starts at 1,000. Each round you play one game and win or lose one unit. Game A is a slightly unfair coin: it wins 49.5% of the time. Game B is stranger. It looks at the capital and divides it by 3. If there is no , B wins only 9.5% of the time. Otherwise it wins 74.5% of the time. Both numbers have the same small , 0.005, taken off, which is why neither game is fair.

The picture shows the capital against the number of rounds. The thick line is the exact : the average over every way the rounds could have gone. The thin line is one sample, a single history drawn from a seed. The dashed lines are game A on its own and game B on its own, and both slope downwards.

Choose "Random mix" and the thick line changes direction. Nothing about either game was altered. The only difference is that each round a coin now decides which of them to play.

02

Why it starts to make sense

Game B is only bad at one value out of three

Look at the numbers for B. At a capital that is a multiple of 3 it wins one time in ten, which is terrible. At every other capital it wins three times in four, which is excellent. If B could be played only at the good capitals it would be a fine game. It loses on average because it cannot choose where to be played: each win or loss moves the capital, and the capital decides which odds come next.

Played alone, B keeps returning the capital to the bad value. From a of 2, which is a good capital, B wins three times in four, and a win lands exactly on a multiple of 3. Over a long run the capital sits at a multiple of 3 more than a third of the time, 38.4% at the standard , so the bad odds are used more often than an even spread would give.

Game A has no such preference. It pushes the capital up or down by one with almost equal chance wherever it is, and that spreads the capital out over the three evenly. Mixed in, A shuffles the capital between B's turns, so B finds it on a multiple of 3 less often: 34.5% of the time for the fair mix, and 30.7% for the pattern ABB. B's good odds are used more, and its bad odds less, than when B plays alone.

03

The key idea

A game's value is its odds, weighed by where you stand when you play it

The expected gain of a round is twice the win chance minus one. For game A that is a fixed number, a little below zero. For game B the win chance changes with the of the capital, so what B is worth depends on how often each remainder comes up. The share of rounds at each remainder is not part of the rules of B. It belongs to the whole of games that were played before.

That is why the paradox is only apparent. "Two losing games cannot make a winning one" is true whenever each game's odds are fixed numbers, because a mixture of two fixed losses is a loss. It fails here because B's odds are not fixed: they depend on the state, and the state depends on what else was played. Changing the other games you play changes the shares, and the shares are half of what a game is worth.

The laboratory makes this testable. Replace B by a plain coin that wins exactly as often as the real B does in the long run, and every mixture loses again, even though the average of the two games is unchanged. What was doing the work was never the average. It was the dependence on the capital.

04

Formal statement

A finite chain, solved exactly

Let be the capital and its . Fix an and let game A win with . Let game B win with probability when and when . A win adds 1 to and a loss subtracts 1, so a win sends to and a loss sends it to , both taken 3.

For a strategy that plays A with at random, the win probability at is , and the of remainders is a on three states. For a periodic pattern of length , the state is the pair (position in the pattern, ), a chain on states. Every win probability lies strictly between 0 and 1, so the chain is irreducible and has a unique , with and .

The long-run expected gain per round is

The kernel solves for by elimination in exact arithmetic, and for a rational the answer is a rational number. Starting from capital , the expected capital after rounds is plus the sum, over the first rounds, of the expected gain of that round, and it is also computed exactly, by carrying the distribution over the finite state set forward one round at a time.

05

Proof

One game checked by hand, and the case where nothing can win

Take and game B alone. The three balance are , and , with . The solution is , and substituting shows each equation holds: for the first, . The gain is . Without the , B alone is exactly fair, and A alone is fair too. The fair mixture of the two has and gain : two fair games combine into a favourable one. That is the paradox at its sharpest, and each of those equalities can be checked with a pencil.

With the , the same system has with 200, and the laboratory solves it exactly for every edge it offers. The values it prints are those rationals rounded to four places. The claim that these numbers are proved is the claim that an exact solution, checked against the balance , is a of what it computes. A second computation by a different route, the spanning-tree formula for a three-state chain applied to the product of the transition over one , agrees with the kernel exactly on every pattern up to length seven.

Now suppose B ignores the capital, winning with a fixed , and play any rule at all for choosing between A and B, even one that looks at the whole history. On each round the expected change in capital is if A is played and if B is, and the rule chooses between them or mixes them, so the expected change is never larger than the larger of the two. Summing over rounds, the expected gain of any strategy is at most . If both are negative, so is the total. That is why no mixture wins when the games do not look at the capital, and it is exactly the step that fails for the real game B, where the expected change on a round is not one of two fixed numbers.

06

Limits and further questions

What the , the pattern and the sample can and cannot show

The gain is real but narrow. At a fair mixture it exists for up to 0.013 on the grid of thousandths the laboratory offers and not from 0.014 up, where the edge is large enough that both games lose more than mixing recovers. The page checks those fifty-one edges and no others, and it says nothing about the exact crossing between them. Other mixtures move the boundary: of the mixtures in steps of five per cent, playing A in two rounds in five does best at the standard edge, at +0.0166 per round, and playing A in nine rounds in ten loses.

Not every way of alternating wins. ABB gains more than the random mixture, +0.0574 per round, and AABB less, +0.0147, while ABBB loses, at −0.0027. A longer pattern, ABABB, does better than all of them at +0.0652. The page shows these exact values but does not claim to know which pattern is best of all, nor the full rule for which patterns win. Whether they win depends on the order of the letters as well as their counts, and the laboratory leaves that question to be explored rather than answered.

The sample run is scenery. It wanders about the exact line by roughly the of the number of rounds, which is about 100 units after 10,000 rounds, and another seed gives another path. After 10,000 rounds the fair mixture is expected to gain about 157 units, so a single run can finish well away from that figure, and now and then below its starting capital. The is a statement about the average of many runs, not about yours. The page keeps the exact line and the sample visibly apart for that reason.

Finally, this is a statement about a fixed set of games with unit stakes and unbounded capital. Nothing here says that any real betting system wins: the games have an against the player, the capital is allowed to go negative, and there is no house . What the page establishes is the narrower mathematical fact that, for this one pair of games, shuffling their order is worth more than either of them alone.

What is actually established

Every statement on this page, with its status, its exact scope, and the date that status was last checked.

Proved

At an edge of 0.005 the expected gain per round, in the long run, is −0.0100 for game A, −0.0087 for game B, +0.0157 for a fair random mixture, +0.0574 for the pattern ABB, +0.0147 for AABB and −0.0027 for ABBB, each rounded to four places.

Scope
The standard games on this page: A wins with probability 1/2 − ε, B with 1/10 − ε when the capital is a multiple of 3 and 3/4 − ε otherwise, unit stakes and unbounded capital that may go negative. Long-run means the average over many rounds, which the chain settles on whatever the starting capital. Printed values are rounded; the exact values are rationals.
Why
The state of the process is the position in the pattern and the capital modulo 3, a finite set. Every state wins with a probability strictly between 0 and 1, so the chain is irreducible and has exactly one stationary distribution. The kernel solves it in exact rational arithmetic, checks it satisfies the balance equations exactly, and reads off the gain. A second route, the spanning-tree formula applied to one period of the pattern, agrees exactly for every pattern up to length seven, at four different edges. Because the solution is exact and checked, it is a proof of the printed numbers.
Status checked
Proved

The reason is visible in where the capital sits. Of the rounds in which B is played, the capital is at a multiple of 3 in 38.36% when B is played alone, 34.51% in the fair mixture and 30.68% in the pattern ABB, and game B wins only about one time in ten at that residue.

Scope
The same standard games at an edge of 0.005, as long-run shares of B’s rounds, rounded to two places. The numbers are proved; that mixing in A is the cause of the lower share is the standard explanation of them, not a separate theorem.
Why
These are entries of the same exact stationary distribution. Game A moves the capital up or down with almost equal chance whatever it is, which makes the three residues exactly equally likely under A alone. A alone gives each residue exactly one third of the rounds, and B alone gives residue 0 more than a third. In the random mixture the coin that picks the game ignores the capital, so B’s share of its own rounds at residue 0 equals the overall share of rounds there. For a pattern such as ABB, B is played only at certain positions, so its share is counted among B’s own rounds and differs from the overall share of rounds at residue 0.
Status checked
Proved

Starting from a capital of 1,000, the expected capital after 10,000 rounds of the fair random mixture at an edge of 0.005 is 1,157.23 to two places, which is 1,157 to the nearest unit.

Scope
The fair mixture at an edge of 0.005 and a start of 1,000, which is at residue 1. The result is the expectation over every possible history, not the outcome of any one run, which has a spread of about 100 units either way at this length.
Why
The distribution over the finite state set is carried forward one round at a time in integers scaled by a common denominator, so no probability is ever rounded. It agrees with a walk of every sequence for small numbers of rounds and with a double-precision programme over the whole distribution of capital at 10,000. It differs from ten thousand times the long-run rate, +157.04, by the memory of the start.
Status checked
Exhaustively checked

For the fair random mixture, the expected gain per round is positive for every edge ε = k/1000 with k from 0 to 13, and negative for every k from 14 to 50.

Scope
Only the fifty-one edges that the laboratory offers, in steps of 0.001. It says nothing about edges between them, and nothing about other mixing probabilities.
Why
Each of the fifty-one cases is solved exactly and its sign read from an exact rational, so there is no rounding in the boundary. Between consecutive edges the gain is a continuous rational function of ε, and a sign change between 0.013 and 0.014 follows, but the page does not claim the exact crossing point.
Computation (exact)
Exact rational stationary distribution of the three-state chain for each ε = k/1000, k = 0 to 50, with the fair mixture. Algorithm parrondo-chain-1.
Status checked
Proved

If game B ignores the capital, no way of choosing between A and B, at random or in a pattern or by any rule, has an expected gain per round above that of the better of the two, so two losing games cannot make a winning one.

Scope
Games whose winning chances are fixed numbers, unit stakes and any rule for choosing the next game that may look at the history. The laboratory’s plain-coin setting is one such pair. It does not apply to the real game B, whose chance depends on the capital.
Why
Whatever the rule, the expected change in capital on any one round is the expected change of game A or of game B, each a fixed number, so it is a weighted average of the two and no larger than the larger. Adding the rounds gives the same bound for the total. The unit tests also check every 5 per cent step of mixing probability and every offered edge in the laboratory, and every short pattern, as a cross-check on the kernel and not as the proof.
Status checked
Observed in this run

The thin line in the expected-capital view and the red marks in the residue view are one seeded run, and describe that run only.

Scope
The rounds actually played at the seed printed beside the figure, with the chosen strategy and edge. A different seed gives a different history around the same exact expectation.
Why
The run comes from a seeded generator and never from the browser’s own randomness, so a shared link replays the identical history. The thick line and the blue bars are the exact values; the simulation is drawn beside them for comparison and is not offered as evidence for them.
Status checked

Sources

Review notes show which bibliographic details Mathomaly has checked and which remain unresolved. Checking a publication record does not independently verify its proof.

  1. Gregory P. Harmer, Derek Abbott, Losing strategies can win by Parrondo’s paradox, Nature 402, p. 864, 1999. Link

    The short paper that presented the two games used here, with the capital-dependent game B, and the winning random and periodic mixtures. The probabilities used on this page are the standard ones from that work; every value shown is recomputed exactly rather than quoted.

    Bibliographic record checked. This is not an independent verification of the proof.

    Bibliographic review:

    AI-assisted bibliographic audit. Evidence type: publisher record.

    The DOI registration record supplied by the publisher gives the title, the authors Gregory P. Harmer and Derek Abbott, the journal Nature, volume 402, page 864 and the year 1999. The paper itself sits behind the publisher’s access page and its text was not inspected, so which probabilities it prints was not checked against it.

  2. Derek Abbott, Gregory P. Harmer, Parrondo’s paradox, Statistical Science 14(2), pp. 206–213, 1999. Link

    The longer exposition, with the Markov-chain analysis of the capital-dependent game and the effect of the edge. Cited for where the analysis was published, not for any value computed on this page.

    Bibliographic record checked. This is not an independent verification of the proof.

    Bibliographic review:

    AI-assisted bibliographic audit. Evidence type: publisher record.

    The Project Euclid record gives the title, the authors in the order D. Abbott and G. P. Harmer, Statistical Science volume 14 issue 2, pages 206–213 and the year 1999 (DOI 10.1214/ss/1009212247). The article text was not inspected, so the claim that it contains a Markov-chain analysis rests on its title and this page’s own derivation, not on the record.

Connected by how they work, not by sharing a topic label.