Risk & Reward

The Dynamic Card Game

A dealer turns over a shuffled deck. Each red pays you a dollar, each black costs you one, and you may stop whenever you like. What is the game worth?

solvedhard1 min

A standard deck of 5252 cards, 2626 red and 2626 black, is shuffled and dealt face up one at a time. Each red card drawn pays you one dollar and each black card costs you one dollar, and you may tell the dealer to stop at any moment. What is the optimal stopping rule, and how much is the game worth to you?

Reveal solutionHide solution

#The value recursion

Suppose rr red and bb black cards remain. Whatever you have banked so far is settled, so let f(r,b)f(r,b) be the expected additional profit under optimal play from this point. You may stop, for nothing more, or draw the next card. It is red with probability rr+b\tfrac{r}{r+b}, paying 11 and leaving f(r1,b)f(r-1,b), or black with probability br+b\tfrac{b}{r+b}, costing 11 and leaving f(r,b1)f(r,b-1). So

f(r,b)=max ⁣(0, rr+b(1+f(r1,b))+br+b(1+f(r,b1))),(1)f(r,b) = \max\!\left(0,\ \frac{r}{r+b}\big(1 + f(r-1,b)\big) + \frac{b}{r+b}\big(-1 + f(r,b-1)\big)\right), \tag{1}

with f(0,b)=0f(0,b) = 0 and f(r,0)=rf(r,0) = r.

#Stop when the edge is gone

Keep drawing while the bracket is positive and stop the instant it reaches 00. Draining all remaining cards nets exactly rbr - b, so once black outnumbers the red still to come the deck becomes a drag, but quitting at the right surplus still banks a profit.

1201326
cards of each colour remaining
Draining the whole deck nets zero, yet the freedom to stop at a favourable surplus has value. With k cards of each colour left it grows with the deck, reaching about 2.62 at a full 26 and 26.

#The value

f(26,26)2.62.(2)f(26,26) \approx 2.62. \tag{2}

The full deck holds equal red and black, so playing stubbornly to the last card nets exactly zero. The entire worth of the game, about $2.62, is the value of the option to walk away once you are ahead.