Now let me mention this example is quite complicated, but it was worthwhile introducing because it is easy to generalize this example to the case where you allow random bets on each play of the game, as long as those bets only depend on what you've seen up to that point, you will actually still get a Martingale. 