Optimal Card Betting With a Known Deck

Game Theory · Hard · Free problem

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

  1. Read the objective again: you maximize expected DOLLARS, not expected log wealth. What does that linearity say about the shape of the optimal bet?
  2. Because the value function is linear in your bankroll, every bet is all-or-nothing. The test is not the one-step edge but a comparison of continuation values: is $r\,V(r-1,b)$ bigger or smaller than $b\,V(r,b-1)$?
  3. Look at the endgame: once the last black card is dealt, every card left is a certain red, so a trailing run of $j$ reds multiplies your money by $2^j$. Condition on the BOTTOM card of the deck to turn that observation into a closed form.

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

Everything here turns on which objective you are optimizing. Maximizing expected wealth is linear in your bankroll, so the value function is linear too, and a linear function on $[0, W]$ is maximized at an endpoint: you either shove or you pass, never anything in between. That is the opposite of the Kelly answer, which maximizes expected LOG wealth and gives the smooth interior fraction $f = |r-b|/(r+b)$. Same game, different utility, completely different policy -- so the first thing to do with any bet-sizing question is pin down what is being maximized.

The second lesson is that a positive one-step edge is not by itself a reason to bet. Capital here has option value: every dollar you keep is a dollar you can double once the deck runs out of black cards, and that endgame is worth so much that even a $26/27$ shot at the next card does not justify risking it. The exact criterion compares continuation values, $r\,V(r-1,b)$ against $b\,V(r,b-1)$, and it comes out negative at every state with a black card left. Traders meet the same structure whenever a trade competes with a better use of the same capital later: the hurdle is not "is this positive EV" but "does it beat what this capital is being saved for." Worth noting too that the $\$10.08$ figure is driven by rare all-red tails paying $2^j$ -- an expectation dominated by tiny-probability, huge-payoff events, which is exactly why expected wealth is usually the wrong objective for a real bankroll.

Open the full interactive solver →