Posted by: rfgarcia | December 18, 2008

## Casino Night Preview: Markov Chains and Blackjack

This post (last post ever!) assumes some knowledge of Markov chains (Wikipedia).

In 2004, two professors from Rice University modeled various aspects of the game of Blackjack with Markov chains (link). Their model for the dealer’s hand is the simplest, but provides valuable insight. The dealer’s hand can be modeled in 36 states:

1. 10 initial states representing the first card dealt to the dealer: Ace, 2, 3, 4, 5, 6, 7, 8, 9, T (where T is any card worth 10).
2. 13 states representing the dealer holding a hand that is worth a “hard” total (no Ace counted as 11) of 4, 5, …, 16
3. 6 states representing the dealer holding a “soft” hand worth 12, 13, …, 17
4. 5 states representing the dealer standing with a total of 17, 18, 19, 20, 21.
5. 1 state for the dealer holding blackjack.
6. 1 state for when the dealer busts.

The last 7 states are absorbing states–once the process reaches one of them, it stays there. Assuming that the dealer is pulling cards from an infinite number of decks, the probability $d_i$ of the dealer drawing card $i$ is simple:

$d_A = d_2 = d_3 = ... = d_9 = 1/13$; $d_{10} = 4/13$

With these probabilities defined, the 36×36 transition matrix, $P$ can be determined, as well as the 1×36 vector $p_0$ representing the distribution of initial states.  Since the dealer is pulling from an infinite deck, there is a possibility that the dealer could draw 17 aces. Thus, the maximum number of time steps in the Markov process is 17. To figure out the probabilities of the dealer reaching a particular outcome, we can observe the probability of being in one of the absorbing states by calculating $p_oP^{17}$.

Assuming the dealer stands on soft 17, here’s the distribution of dealer outcomes:

Besides being a benchmark, this graph isn’t that useful (we can see one of the dealer’s cards at the casino table). Here’s a conditional distribution of dealer outcomes given that the first card the dealer is dealt is an ace:

Showing an ace, the dealer has only an 11.5% chance of busting! This is part of the reason why basic strategy dictates that you hit any total less than 17 facing the dealer’s ace–you have only an 11.5% chance of winning.