I’m afraid the “I’ll stop here” was a lie. Go ahead and report me! 
Once I realized that the exact median-optimizing strategy could be derived with less than 60 LOC, it was irresistible to do so. (To reduce wear and tear on a beleaguered Pentium chip, I stipulated that bets must be multiples of $10 — this should have little effect on the solutions.)
An expected median of $27,520 can be obtained. The bets in the first round with that optimal strategy are
< B[sub]2[/sub], B[sub]3[/sub], B[sub]4[/sub], B[sub]5[/sub], B[sub]6[/sub], B[sub]7[/sub]> = < 100%, 100%, 100%, 78%, 51%, 8% >
but of course these portions vary as the game progresses. (This all depends on the correctness of my code. I hope I’m not too optimistic if I continue to guess correctness as “better than even-money.”)
I will not show the mean winnings achieved with the median-optimizing strategy, since that would require making bets when the median target was no longer possible. And, even though ‘Bet entire bank’ would be as good as anything, that would seem, as in the title of a famous movie, A Line of Code Too Far.
septimus, don’t accuse posters of lying. No warning issued.
Thanks a lot for figuring that out. This has been much more interesting than I would have thought. Does this type of problem of finding the maximized median value have a mathematical solution or is it something that needs an iterative program to solve? And will the maximum median value always be less than or equal to the mean of the pure odds solution?
The median won’t always be less than the mean. A standard Martingale strategy applied to any casino game will give a median result of positive one minimum bet, but a negative mean.
Iterative. Solve for the question “Is there a strategy with >50% chance of achieving at least $20,000?” If yes, repeat with $24,000, and so on, zeroing in on the optimum.
Sure, there are solitaire games where the maximized median exceeds the maximized mean. Perhaps the most obvious example is the ordinary Martingale: you bet $1 on a craps table pass-line bet, then $2 if that loses. Your median winnings, occurring about 74% of the time, are $1. But your mean winnings at the Craps Table cannot exceed zero no matter how you bet.
(Which is not to say that $1 is the optimized median in a casino game. Playing just the pass-line at craps, you have >50% chance of winning 96% of your bankroll if that’s your goal, i.e. turning $1000 into $1960.)
ETA: Ninja’ed by Chronos.