It would have been a better demo if reduced to more manageable numbers e.g. a deck of 2 black and 2 red cards.
Turn 1 r = b so no bet
Turn 2 bet 1/3 on whichever card wasn't revealed in turn 1.
Turn 3 either you were wrong on turn 2 and you now have 2/3 of your stake but you know the colour of the next two cards so you can double your stake each time to end up with 4/3 after turn 3 or you were right and you have 4/3 of your stake but have one of each red or black left so you don't bet this turn.
Turn 4 you know the colour of the final card so you double your money to 8/3 of your original stake.
And then the exercise to the reader is to prove optimality (which is fairly straightforward but I don't believe there is a short proof)
replies(3):