Efficiency of card counting in blackjack (Part 2)

Introduction

Continuing from last time, recall that card counting systems may be used in two different ways: to vary betting strategy, betting more or less on each round based on an estimate of the current expected return; but possibly also to vary playing strategy, affecting decisions to stand, hit, etc., based on estimates of favorability of the various options.

My objective in this still-introductory post is to focus on the first of these two roles, describing how typical card counting systems work, and how they are used to estimate expected return.  Next time, I will finally get to the new stuff, dealing with playing strategy “indices,” and the concept of “efficiency” as a measure of how close various card counting systems are to being optimal.

The True Count

Given a playing strategy (which we are currently assuming is the fixed, total-dependent basic strategy from the last post), we can compute the exact expected return for a round played with that strategy, as a function of the shoe composition prior to the deal.  A shoe composition is specified by a vector s indicating the number of cards of each rank ace through ten.  For example, a full n-deck shoe is given by

\mathbf{s} = n \mathbf{d} , where \mathbf{d} = (4,4,4,4,4,4,4,4,4,16)

The actual expected return is a complicated non-linear function of s.  A typical card counting system estimates this expected return using the true count (TC), a simpler linear function that a player can compute in his head: basically, the true count is a weighted average of the probabilities of card ranks remaining in the shoe.

To make this precise, let t be a vector of “tags,” or weights, associated with each card rank ace through ten.  Different systems use different tags; for example, the very common Hi-Lo system, first described by Harvey Dubner 50 years ago, uses the tags

\mathbf{t} = (-1,1,1,1,1,1,0,0,0,-1)

Then the true count for a given shoe composition is defined to be

TC_\mathbf{t}(\mathbf{s}) = \frac{-\mathbf{t} \cdot \mathbf{s}}{n(\mathbf{s})}

where, if we temporarily define n(s) to be the total number of cards remaining in the shoe, we see that the true count is just a sum of the card probabilities, weighted by –t.

We need to revise this definition slightly, though, to reflect how the true count is actually computed at the table.  First, the numerator in the formula is the running count (RC); the reader can verify that we can mentally maintain the running count throughout a shoe by adding the tag t_i for each card of rank i that we see dealt, starting with an initial running count (IRC) of -\mathbf{t}\cdot(n\mathbf{d}) for a full n-deck shoe.  (Note that the IRC for the Hi-Lo system above is conveniently equal to zero for any number of decks; more on this later.)

Whenever we need to compute the true count, we simply divide the running count by n(s).  The problem is that it is difficult to keep track of exactly how many cards remain in the shoe.  The solution in most card counting systems is to instead divide by the number of decks remaining (i.e., blocks of 52 cards), estimated with some coarser resolution.  For example, if we estimate the number of decks by rounding to the nearest half-deck, then the true count divisor is

n(\mathbf{s}) = \frac{1}{2} \left \lfloor \frac{\sum s_i}{26} + \frac{1}{2} \right \rfloor

I will use this definition of the true count divisor for the rest of this discussion.  At this point, I think it is important to note two effects of this change.  First, we have relaxed the amount of mental effort required, by approximating the number of cards remaining in the shoe.  But a second effect, perhaps more important but rarely made explicit, is that we have effectively introduced a scale factor, multiplying all of our previously computed true counts by 52.  This is also helpful for the human player, since the resulting true counts range over a wider interval and may be approximated by integers, instead of being confined to small fractional values typically in the interval (-1, 1).

Accuracy of true count estimation of expected return

So how well does this work?  The following figure shows the actual expected return– still using fixed total-dependent basic strategy– vs. the Hi-Lo true count, for each of 4.3 million rounds (gray points) played over 100,000 shoes.  Here again, the color is an overlaid smoothed histogram to show the greater density of points near the origin.

Expected return vs. Hi-Lo true count, using fixed total-dependent basic strategy.

Expected return vs. Hi-Lo true count, using fixed total-dependent basic strategy.

The correlation coefficient is 0.953; for example, if the true count were a perfect predictor of expected return, these points would all lie exactly on a straight line, with a correlation of 1.0.

Can we do better than this?  It turns out that we can… but only if we relax some constraints on the counting systems we are allowed to use.

First, recall that the initial running count (IRC) for the Hi-Lo system is zero.  Such systems are called “balanced”; systems with a non-zero IRC are called “unbalanced.”  It is not clear to me how useful this distinction is, or in particular why unbalanced counts are often advertised as “not requiring a true count conversion,” as if the definition of the true count above depends in any way on whether the IRC happens to be zero or not.

At any rate, if we expand our space of possible counting systems to include unbalanced counts, then the Knockout, or K-O system, which counts sevens as +1, has a slightly higher correlation of 0.955.

However, these two systems– one balanced, one unbalanced– are only optimal among “Level 1” systems, i.e., systems with tags in {-1, 0, +1}.  If we consider “Level 2” systems with tags chosen from {-2, -1, 0, +1, +2}, then the balanced count with the highest correlation with basic strategy expected return is (-2, 2, 2, 2, 2, 2, 1, 0, -1, -2), with a correlation of 0.967.  The best overall Level 2 count is the unbalanced (-2, 1, 2, 2, 2, 2, 1, 0, -1, -2), with a correlation of 0.973.

Betting isn’t everything

There is a reason why you have probably never heard of or seen these two Level 2 counts in the wild.  Note that the optimality of these counting systems depends on the specific rule variations, penetration, and fixed playing strategy assumed so far.  Also, these systems are only “optimal” in the sense of maximizing correlation between true count and actual expected return.  This is still an imperfect measure of “betting efficiency,” which we have yet to define precisely.

But before diving deeper into betting efficiency, we are now in a position to address playing efficiency… where these systems generally suffer.  So far, the playing strategy has been fixed, total-dependent “basic” strategy, depending only on the cards in the player’s current hand (and the dealer’s up card).  For example, basic strategy is to always hit hard 16 against a dealer 10.  But we can improve performance by allowing playing strategy to vary based not only on the cards in the current hand, but also on the current true count.

Next time, I will describe how this is done, including new software for evaluating the resulting improvement in expected return, compared with the best possible improvement from perfect play.

Efficiency of card counting in blackjack (Part 1)

Introduction

In the past, I have discussed some of the mathematics and algorithms involved in analyzing the game of blackjack (see here and here, for example).  Most of that discussion focused on the accuracy and speed of computation.  Here, however, I want to discuss actually playing the game, and in particular, the practice of card counting.  It is possible for an “advantage player” to make money playing blackjack; I propose to consider the question, “How much money can possibly be made, and what is the tradeoff in advantage versus complexity of card counting systems?”  I have conjectured in the past– without any analysis or data to back up the claim– that relatively simple systems are “good enough,” and that the marginal additional advantage of more complicated systems is not worth the greater mental effort needed to practice and execute them.

Trying to answer this question involved writing some new software, some analysis, and a lot of data.  There are several main points in the punchline, so I plan to break this up into a few reasonably-sized pieces.  But first, I want to begin at the beginning, so to speak, with a description of some of the basic concepts involved in card counting, at least as I understand them.  I think this will be useful, partly to collect my thoughts and make this self-contained, but also because I find many such descriptions online and in the literature to be unsatisfying, misleading, or downright inaccurate.

Rules of the game and basic strategy

For consistency, I will assume the following rules throughout: 6 decks dealt to 75% penetration, dealer stands on soft 17, doubling down is allowed on any two cards including after splitting pairs, pairs may be split and re-split up to a maximum of four hands, except that aces may be split only once, with no surrender.

Given these rules, we can describe the simplest “basic” playing strategy with the following table, condensed from the output of the strategy calculator:

S17, DOA, DAS, SPL3, NRSA, CDZ-

  Hard |                Dealer's up card
  hand | 2    3    4    5    6    7    8    9    10   A
-----------------------------------------------------------
   19  | S    S    S    S    S    S    S    S    S    S   
   18  | S    S    S    S    S    S    S    s    s    s   
   17  | s    s    s    s    S    s    s    s    s    s   
   16  | s    s    s    s    s    h    h    h    h    h   
   15  | s    s    s    s    s    h    h    h    h    h   
   14  | s    s    s    s    s    h    h    h    h    h   
   13  | s    s    s    s    s    h    h    h    h    h   
   12  | h    h    s    s    s    h    h    h    h    h   
   11  | DH   DH   DH   DH   DH   DH   DH   DH   DH   H   
   10  | DH   DH   DH   DH   DH   DH   DH   DH   H    H   
    9  | H    DH   DH   DH   DH   H    H    h    h    h   
    8  | h    H    H    H    H    H    h    h    h    h   
    7  | h    h    h    H    H    h    h    h    h    h   
    6  | h    h    h    h    h    h    h    h    h    h   
    5  | h    h    h    h    H    h    h    h    h    h   

  Soft |                Dealer's up card
  hand | 2    3    4    5    6    7    8    9    10   A
-----------------------------------------------------------
   20  | S    S    S    S    S    S    S    S    S    S   
   19  | S    S    S    S    S    S    S    S    S    S   
   18  | S    DS   DS   DS   DS   S    S    h    h    h   
   17  | H    DH   DH   DH   DH   H    h    h    h    h   
   16  | h    H    DH   DH   DH   h    h    h    h    h   
   15  | h    H    DH   DH   DH   H    h    h    h    h   
   14  | H    H    H    DH   DH   H    H    h    h    h   
   13  | H    H    H    DH   DH   H    H    h    h    h   

  Pair |                Dealer's up card
  hand | 2    3    4    5    6    7    8    9    10   A
-----------------------------------------------------------
  A- A | PH   PH   PH   PH   PDH  PH   PH   Ph   Ph   Ph  
 10-10 | S    S    S    S    S    S    S    S    S    S   
  9- 9 | PS   PS   PS   PS   PS   S    PS   ps   s    s   
  8- 8 | Ps   Ps   Ps   Ps   Ps   Ph   ph   ph   ph   ph  
  7- 7 | ps   ps   Ps   Ps   Ps   ph   h    h    h    h   
  6- 6 | ph   ph   Ps   Ps   Ps   h    h    h    h    h   
  5- 5 | DH   DH   DH   DH   DH   DH   DH   DH   H    H   
  4- 4 | h    H    H    PH   PH   H    h    h    h    h   
  3- 3 | ph   ph   Ph   Ph   Ph   ph   h    h    h    h   
  2- 2 | ph   ph   Ph   Ph   PH   Ph   h    h    h    h   
-----------------------------------------------------------

S = Stand
H = Hit
D = Double down
P = Split

Uppercase indicates action is favorable for the player
Lowercase indicates action is favorable for the house

When more than one option is listed, options are listed
from left to right in order of preference.

Note that this strategy is “total-dependent.”  That is, the strategy depends only on the total of the cards in the player’s hand, not on the specific cards that make up that total.  For example, we always hit hard 16 against a dealer 10, whether that 16 is made up of 10-6, 10-3-3, 8-4-4, etc.  Playing this strategy off the top of a full 6-deck shoe yields an expected return of -0.4065%, or a house edge of less than half of one percent of the initial wager.

A first incremental improvement to our strategy might be to make it “composition-dependent.”  For example, although it is indeed optimal to hit 10-6 vs. 10, and to hit 10-3-3, we should stand with 8-4-4.  These are all very close calls; with 8-4-4, the expected return for standing is -53.99%, compared with -54.43% for hitting.  And there are not many of these composition-dependent strategy variations, yielding an overall expected return for the round of -0.4029%, an improvement of less than 4 thousandths of one percent.

Hand composition matters because it affects the distribution of card ranks remaining in the undealt shoe, which in turn affects the probabilities of winning, losing, or pushing the round.  However, let us stick to our total-dependent strategy for now, since as we will see, card counting effectively handles composition-dependence for us.

The effect of not shuffling

Now consider playing multiple rounds from the same shoe before reshuffling.  Given knowledge of the cards dealt in previous rounds, the expected value of using this same fixed total-dependent strategy will in general be different for the next round, possibly higher or lower than before.  Also, the optimal strategy for the next round may also be different.  For example, it may no longer be optimal to hit a particular hard 16 vs. 10, but instead to stand.

Card counting is an attempt to estimate one or both of these two effects: the simplest systems involve only betting strategy, betting more when the expected return is thought to be favorable.  More complex systems also vary playing strategy, e.g., sometimes hitting a hard 16 vs. 10, sometimes standing, depending on which cards have already been dealt in previous rounds.

To see the potential benefit of merely varying your wager, while always playing the same fixed total-dependent strategy above, the following figure shows the distribution of expected return, as a percentage of initial wager, vs. penetration; i.e., how much of the 6-deck shoe is depleted when the round is dealt.  Each of the 4.3 million gray points corresponds to one round in a simulation of 100,000 shoes.  The additional color is an overlaid smoothed histogram to show the density of points in the scatterplot.

Expected return vs. penetration, using a fixed total-dependent strategy.

Expected return vs. penetration, using a fixed total-dependent strategy.

At the start of each shoe, the expected return is the same -0.4065% every time.  But as we move deeper into the shoe, the range of possible returns increases.  The challenge is to find a way to recognize where we are on this plot, and to bet more when expected return is positive, and bet less– or even sit out– when expected return is negative.

Next time, I will get into how this is done, using card counting systems of varying complexity.  Admittedly, so far none of the above is really anything new.  But my eventual goal is to define and accurately measure the efficiency of these card counting systems; that is, how well do they perform, not only relative to each other, but also relative to the theoretically best possible performance?