How to calculate
Track the distribution of capital modulo three as it changes after a win or loss. Add the expected gain for each round. In the mixed game, weight the two win probabilities by the chance of choosing each game.
Worked example
Use Number of rounds 100 · Game A win probability 49.5% · Game B win chance when capital is a multiple of three 9.5% · Game B win chance otherwise 74.5% · Chance of selecting game A in the mix 50%. The result is ≈ 1.28732724988.
Input and result notes
Capital starts at zero. A win adds one unit and a loss subtracts one. The result is a numerical expectation over all paths.
Harmer and Abbott’s original Parrondo example