Optimal Card Betting With a Known Deck
You have a standard deck of 52 cards (26 red, 26 black), shuffled randomly. Cards are revealed one at a time from the top. Before each reveal, you may bet any amount up to your current bankroll that the next card will be red. If you're right, you win that amount; if you're wrong, you lose it. You start with $\$2$.
What strategy maximizes your expected final bankroll, and what is the expected value under optimal play?
Hints
- You always know the exact composition of the remaining deck. How does that give you an edge?
- Think about the Kelly criterion -- when you have a known edge on an even-money bet, what fraction of your bankroll should you wager?
- The optimal bet fraction is $f^{*} = |r - b|/(r + b)$ where $r$ and $b$ are remaining red and black cards. To get the expected final wealth, use the fact that under proportional betting, the growth factors telescope into a binomial coefficient.
Worked Solution
How to Think About It: Read the objective carefully: you maximize expected final dollars, not the growth rate of wealth. That distinction is what makes the answer counterintuitive. Because the payoff is linear in wealth, the value function is linear in your bankroll, so at every step the optimal bet is *bang-bang* — shove everything or bet nothing, never an interior fraction. The tempting rule is "shove whenever the next card is more likely red," i.e. on one-step edge. That rule is wrong here. The correct test compares *continuation values*, because betting risks capital that is far more valuable saved for the endgame: once the last black card is gone, every remaining card is a certain red and can be doubled risk-free. That endgame value turns out to be so large that you should wait until every black is gone — no matter how favorable the immediate odds look.
Quick Estimate: You start with $\$2$ and a balanced deck. A red bet only ever pays when reds outnumber blacks, and the one situation with *guaranteed* edge is when every black is already gone: then each remaining card is certainly red, so shoving doubles your money risk-free. Doubling through a run of $j$ guaranteed reds multiplies wealth by $2^j$. The chance of a long all-red tail is small, but the $2^j$ payoff is huge, and these rare tails dominate the expectation. Since $\binom{52}{26}\approx4.96\times10^{14}$ and $2^{52}\approx4.50\times10^{15}$, we have $2^{52}/\binom{52}{26}\approx9.08$, pointing to a final answer a little above $\$10$.
Approach: Set up the exact dynamic program over deck compositions $(r,b)=$ (reds remaining, blacks remaining). Because the objective is linear, the value function is linear in wealth, so we track the optimal expected multiplier $V(r,b)$ on the current bankroll, determine the optimal bet at each state, and solve the recursion in closed form.
Formal Solution:
Let $V(r,b)$ be the optimal expected final wealth *per dollar* of current bankroll when $r$ reds and $b$ blacks remain. Betting a fraction $f\in[0,1]$ on red, with $p=r/(r+b)$: on a win the bankroll becomes $(1+f)W$ and the state moves to $(r-1,b)$; on a loss it becomes $(1-f)W$ and moves to $(r,b-1)$. By linearity the expected multiplier is $$g(f)=p(1+f)V(r-1,b)+(1-p)(1-f)V(r,b-1),$$ linear in $f$ with slope $$g'(f)=pV(r-1,b)-(1-p)V(r,b-1)=\frac{rV(r-1,b)-bV(r,b-1)}{r+b}.$$ A linear function on $[0,1]$ is maximized at an endpoint, so $$f^*=\begin{cases}1 & \text{if } rV(r-1,b) > bV(r,b-1),\\ 0 & \text{otherwise.}\end{cases}$$ **The criterion is *not* one-step EV** (whether $r>b$); it is the sign of $rV(r-1,b)-bV(r,b-1)$, which weights each branch by its *continuation* value.
The boundaries are $V(r,0)=2^r$ (all remaining cards are sure reds — shove and double $r$ times) and $V(0,b)=1$ (no reds left, so no red bet can ever win). While a black remains you bet nothing, so $V$ satisfies the plain averaging recursion $V(r,b)=\frac{r}{r+b}V(r-1,b)+\frac{b}{r+b}V(r,b-1)$ — which is just conditioning on the top card.
Key identity (why you always wait while $b\ge1$). Condition instead on the bottom card. With probability $\frac{b}{r+b}$ it is black, which forces the trailing all-red run to be empty and contributes a multiplier of $1$; with probability $\frac{r}{r+b}$ it is red, a guaranteed double sitting beneath the remaining $(r-1,b)$ deck, contributing $2V(r-1,b)$. Hence $$(r+b)\,V(r,b)=b\cdot 1+r\cdot 2V(r-1,b)=b+2rV(r-1,b).$$ Subtracting the top-card recursion $(r+b)V(r,b)=rV(r-1,b)+bV(r,b-1)$ gives, for every state with $b\ge1$, $$\boxed{\,rV(r-1,b)-bV(r,b-1)=-b\,.}$$ So the slope is $g'(f)=-\dfrac{b}{r+b}<0$ whenever a black remains: betting is *strictly* worse than waiting, hence $f^*=0$. Concretely, at $(26,1)$ the next card is red with probability $\tfrac{26}{27}$ — a one-step edge of $+0.93$ per dollar — yet the slope is $-\tfrac{1}{27}<0$, so you *still* bet nothing. The only positive-slope regime is $b=0$, where you shove every card.
Optimal strategy: bet $\$0$ while any black card remains; once the last black is dealt, bet your entire bankroll on each remaining (certainly red) card.
Closed form. With $f^*=0$ for $b\ge1$, unrolling the recursion — equivalently, your $\$2$ is untouched until the tail, then multiplied by $2^J$ where $J$ is the number of reds after the last black — gives $$V(r,b)=\frac{1}{\binom{r+b}{b}}\sum_{j=0}^{r}2^{j}\binom{r+b-1-j}{b-1}\qquad(b\ge1),$$ and for the balanced full deck $r=b=26$, $$V(26,26)=\tfrac12\!\left(1+\frac{2^{52}}{\binom{52}{26}}\right).$$ Starting from $\$2$, the expected final bankroll is $$E[W]=2V(26,26)=1+\frac{2^{52}}{\binom{52}{26}}.$$ With $2^{52}=4{,}503{,}599{,}627{,}370{,}496$ and $\binom{52}{26}=495{,}918{,}532{,}948{,}104$, $$E[W]=1+\frac{2^{52}}{\binom{52}{26}}\approx 1+9.0813=\$10.0813.$$
Verification (small decks, exact DP). - 2-card deck $(1R,1B)$ from $\$2$. First card: bet $\$0$. If black shows first, the last card is a sure red, so you shove and double to $\$4$. If red shows first, the last card is *black* — which you cannot bet on — so you finish at $\$2$. Hence $E[W]=\tfrac12(\$4)+\tfrac12(\$2)=\$3.00$, matching $1+2^2/\binom{2}{1}=3$. (You do not double in both branches.) - 4-card deck $(2R,2B)$ from $\$2$: the same wait-then-shove rule gives $E[W]=1+2^4/\binom{4}{2}=1+\tfrac{16}{6}\approx\$3.67$. Both exact values differ from any Kelly/proportional policy, confirming the expected-wealth objective is genuinely all-or-nothing.
Answer: Bet nothing while any black card remains; once the last black is gone, bet your entire bankroll on every remaining (guaranteed-red) card. Starting from $\$2$, $$E[W]=1+\frac{2^{52}}{\binom{52}{26}}\approx\$10.08.$$
Intuition
This is the canonical example of the Kelly criterion applied to a game with changing odds. The core principle: when you have an edge, bet proportionally to that edge. The Kelly fraction maximizes the expected logarithm of wealth (geometric growth rate), which is the right objective when you're compounding bets. Bet too much and a bad streak wipes you out; bet too little and you leave money on the table.
In practice, this problem shows up whenever you're sizing positions with an informational edge that evolves over time -- market making with a depleting order book, card counting in blackjack, or any sequential decision problem where you learn from past observations. The deep lesson is that even a series of small edges compounds into substantial expected profit when you size correctly, and the deck-of-cards setup makes the math clean enough to get an exact answer.