Exact Calculation of Expected Values for Splitting Pairs in Blackjack
EExact Calculation of Expected Values for Splitting Pairsin Blackjack
John A. Nairn
Oregon State University, Wood Science & Engineering, 112 Richardson Hall , Corvallis, OR 97330, USA
October 1, 2019
Abstract
Computer calculations for most exact expected values in blackjack have been avail-able since the 1960’s, but exact results for pair splitting and resplitting have previouslybeen too computer intensive. This paper describes a new algorithm for exact pair-splitting. By using dealer probability caching methods and revising the method forrecursively generating possible player hands, the estimated calculation time comparedto standard methods was reduced by five orders of magnitude. The resulting algorithmwas used to calculate the first exact and complete pair splitting results for a single deckgame. The exact results were compared to prior approximate theories for resplitting.The prior theories are accurate for many calculations, but inaccurate for resplittingtens. A new approximation method was developed that is accurate for all resplittingcalculations.
Many books and articles describe calculation of expected values in blackjack by computermethods. The first accurate derivation of correct strategy was done by Baldwin et al. [1].Due to limited computer capabilities at that time, they used several approximations. In the1960’s, it was realized the problem was sufficiently small that all hands could be generatedand therefore exact expected values could be calculated. Tables of results are given in Thorp[2] and Epstein [3].Most blackjack calculations can be completed in seconds. The one exception is for pairsplitting. When a player’s first two cards match, that player is permitted to split the cardsand play two separate hands. If another matching card is dealt to one of the separate hands,some casinos permit resplitting to make a third or fourth, or potentially even more hands inmultideck games. For N possible player hands, computer generation of up to h split handsrequires on the order of N h hands. This calculation is feasible for h = 2 but because N islarge, it becomes computer intensive for h ≥ a r X i v : . [ c s . OH ] S e p plitting in a single-deck game for h = 2, 3, and 4. Initial calculations using conventionalblackjack computational methods led to an estimate that serial calculations for h = 4 wouldrequire about 3 . × seconds or 11,000 years of CPU time. By using memory caching andrevising the approach to enumerating split hands, total calculation time was reduced by fiveorders of magnitude to 3 . × seconds or 45 days. This paper describes an algorithm thatwas optimization based on performance in serial calculations. A simple approach to parallelcalculations is outlined.The derived algorithm was used to calculate a table of exact splitting expected values forall rule options. The exact results were compared to a prior approximate approach developedby Griffin [4], and to other tables of splitting results. Griffin’s methods are extremely accuratewhen resplitting is not allowed, but have some deficiencies when resplitting is allowed. A newapproximate method was developed that corrects those deficiencies and agrees with nearlyall exact results with absolute errors less than ± . This section briefly describes casino blackjack rules with emphasis on defining terms and onvarious options for pair splitting. The reader is referred to many references for more details( e.g. , [2, 5]). A hand starts by a player making a wager — the initial bet size. Cards arethen dealt from a single deck or from multiple decks. The player and dealer each receive twocards. One of the dealer’s cards is exposed and therefore known to the player (the dealer “upcard”). Cards 2 through 9 are valued with their number; 10’s and all face cards are valued10; aces may be valued 1 or 11 at the player’s option. A hand’s score is a sum of values ofits cards. A hand with no aces is a “hard” hand. A hand with an ace that does not exceed21 when the ace is counted as 11 is a “soft” hand ( e.g. , (A,8) is a soft 19). If all aces in ahand must be counted as 1 to avoid exceeding 21, it becomes a hard hand ( e.g. , (8,7,A) is ahard 16).If the dealer’s up card is an ace or a ten card, the “hole card” ( i.e. , the hidden card) ischecked to see if the dealer has a “natural” or blackjack defined as an ace and a ten cardadding to 21. If the dealer has a natural, the hand is over. The player loses the initial bet,unless the player also has a natural, the hand is a draw or “push” with no loss or gain tothe player. If the dealer does not have a natural, play continues. A player with a natural,wins 1.5 times the initial bet. A player that does not have a natural, can “stand,” “hit,” or“double down”. When a player stands, that player is done. A player that hits can continueto hit while the hand total is less than or equal to 21 or stop play at any time by standing.If the final total exceeds 21, the hand is a “bust” and the initial bet is lost regardless ofthe dealer’s final hand. A player that doubles down, doubles the initial bet size and thenreceives one and only one additional card. Some casinos allow the player to double down onany two cards; others restrict doubling down to only hands of hard 10 or 11.If a player finishes without busting, the dealer plays out the hand by fixed rules regardlessof the player’s hand. The dealer exposes the hole card and then takes additional cards until2he score is 17 or greater. In some casinos, the dealer will hit a soft 17 but stand on allother hands 17 or greater. When done, the dealer’s score is compared to the player’s. Theplayer wins the current bet size if the dealer busts or if the player’s score is higher than thedealer’s. The player loses the initial bet for scores lower than the dealer’s score. If the scoresare equal, the hand is a push.This paper is about an additional player option known as pair splitting. If the first twocards are matched ( e.g. , hands with (8,8), (4,4), or (10,Q); the last example indicates thatany two ten cards can be split), the player can split the hand. When splitting, the two cardsare separated into two hands and a second bet equal to the initial bet size in placed onthe second hand. These hands get a second card and play continues as for non-split handswith the following exceptions. If first two cards of a split hand total 21, the hand is not anatural, but just a hand totaling 21. When splitting aces, the player receives one additionalcard on each hand, but cannot continue with other options. At the two-card stage, therules between casinos vary. Some casinos do not allow doubling down on such hands. Othercasinos allow doubling down on any two-card hand or perhaps only on hands of hard 10 or11. The rules also vary if the second card matches the original split card. Some casinos allowresplitting, while others do not. For those that allow resplitting, that option is often limitedto a maximum of 4 hands or occasionally is allowed for any number of hands (splitting tomore than four hands is possible when splitting ten cards or in multideck games). Normallyaces cannot be resplit even in casinos that allow resplitting. In rare cases, aces can be resplitand the additional hands again receive just one card.A complete pair-splitting analysis requires analysis of all double down options:1. ND — No double down after splitting2. DD1 — Double down on any two cards after splitting3. DD2 — Double down only on hard 10 or 11 after splittingTo analyze resplitting options as well, the splitting process is allowed to proceed to a maxi-mum of h hands. Setting h = 2 gives results when resplitting is not allowed. When h > h = 4, which corre-sponds to a common limitation in casinos that allow resplitting. In a single deck game, h = 4is also unlimited splitting except when splitting 10’s. The expected value for any strategy decision is defined as the expected win per unit bet formaking a decision and then completing the hand by the zero-memory, basic strategy. Zero-memory basic strategy is defined as the decision that maximizes expected value based onlyon knowledge of the dealer’s up card and the player’s initial two cards [3]. The zero-memorybasic strategy for any number of decks and for dealers that stand or hit soft 17 is given inGriffin [4]; for completeness, the single-desk basic strategy used for these calculations is inAppendix A. 3he exact expected value when choosing to hit a hand, (cid:126)h , against dealer up card u , canbe expressed in a recursive equation as: E ( (cid:126)h, u ) = (cid:88) i =1 p ( i ) (cid:40) E ( (cid:126)h + i, u ) if (cid:126)h + i should be hit S ( (cid:126)h + i, u ) if (cid:126)h + i should stand (1)Here (cid:126)h = ( c , c , c , . . . ) is a player hand with cards c , c , etc. , (cid:126)h + i is the new hand formedby adding card i to (cid:126)h , p ( i ) is the probability that the next card in the deck has value i , S ( (cid:126)h + i, u ) is the expected value if the player stands on the new hand, and “should be hit”or “should stand” refers to basic strategy decision based on the new hand (cid:126)h + i . A recursivecalculation terminates when hand (cid:126)h + i should stand for all values of i because the exactexpected value when choosing to stand is given by a closed-form, non-recursive equation: S ( (cid:126)h, u ) = − s ( (cid:126)h ) > d ( >
21) + (cid:80) i
21) is the probability the dealer busts with a score greater than 21.The first option means the player loses one bet size for a busted hand. Otherwise the playerwins one unit if the dealer busts or if s ( (cid:126)h ) is higher than the dealer’s score, loses one if thedealer’s score is higher (without busting), or ties if the dealer’s and player’s scores are equal.Because expected values during hand play imply the dealer does not have a natural, theplayer card probabilities, p ( i ), are conditional on this fact. The conditional p ( i ) from Griffin[4] are: p ( i ) = n i n deck for 2 ≤ u ≤ n i n deck − u = 1 ,
10 and i = 11 − un i n deck − (cid:18) n deck − n − u − n deck − n − u (cid:19) for u = 1 ,
10 and i (cid:54) = 11 − u (2)Here n i is the number cards remaining in the deck with value i and n deck is the total numberof cards remaining in the deck.Dealer probabilities required for S ( (cid:126)h, u ) can be expressed as a vector function (cid:126)D ( u, (cid:126)r ) = ( d (17) , d (18) , d (19) , d (20) , d (21) , d ( > u ), (cid:126)r , thathave been removed from the deck. The probabilities can be calculated by a simple recursivealgorithm [4]. Like player card probabilities, dealer probabilities are always made conditionalon the dealer not having a natural. Exact expected value calculations require consideration of all possible hands and each hand(or set of hands when splitting) requires a new calculation of dealer probabilities, because4hey depend on the contents of the player’s hands. A common approach is to use recursivesubroutines to generate all hands and sum the results for the exact expected values. Thissection outlines C++ code that extends this approach to recursive generation of all possiblesplit hands to any maximum number of hands (a software project with complete source codeis available on GitHub [6]). The code is based on three objects called
Deck , Dealer , and
Hand . The
Deck object is responsible for tracking cards in the deck and calculating playerweights, p ( i ). The Dealer object is responsible for calculating dealer probabilities, (cid:126)D ( u, (cid:126)r ).Each Hand object tracks one hand and is the focal point for recursive generation of hands.First consider recursive generation of all possible single hands for E ( (cid:126)h, u ) in Eq. (1). Asimple recursive method in the Hand object is: float Hand::hitExval(Deck &deck,Dealer &dealer){ float exval=0.,wt;for(int i=ACE; i<=TEN; i++){ if(!deck.removeAndGetWeight(i,&wt,dealer)) continue;hit(i);if(basicHit(deck,dealer))exval += wt*hitExval(deck,dealer);elseexval += wt*standExval(deck,dealer);unhit(i,deck);}return exval;}
The loop is over the ten possible cards. deck.removeAndGetWeight() uses the
Deck objectto remove a card from the deck and calculate p ( i ) = wt ; it returns false if no such cardsremain in the deck. The hit() method adds a card to the hand. If the basicHit() methodsays to hit again, the hitExval() method is called recursively; otherwise the final hand ex-pected value is calculated by standExval() . Finally the loop card is removed from the handand restored to the deck (by unhit() ). When the loop is done, the exact expected value isreturned ( exval ).A similar method is the core of all blackjack programs for exact expected values. Aextension of this approach to recursively generating all possible combinations of split hands,including resplitting, is given by the exactSplitExval() method in Appendix B. For splittinga hand with ( s, s ) against dealer up card u , this method is called as follows: deck.remove(u,s,s);dealer.setDDAfterSplitOption(option);hands[0] = new Hand(s);hands[1] = new Hand(s);numHands = 2exval = hands[0]->exactSplitExval(deck,dealer,hands,numHands,maxHands); The first line removes the dealer up card, u , and two split cards, s , from the deck usinga Deck object. The second line sets the desired double-down-after-split option. Finally, two
Hand objects are created each with a single split card and the calculation is launched in the5rst hand. maxHands determines h with h = 2 for no resplitting or h > exactSplitExval() is very similar to hitExval() . The major difference is thatthe recursion proceeds through two or more Hand objects rather than being confined to asingle
Hand .The first calculations considered splitting all possible pairs ((A,A), (2,2), ... (T,T)) vs. dealer up card 6 and all double down options (ND, DD1, and DD2). The calculations formaximum number of hands h = 1, 2, or 3, took 0.69 sec, 49 sec, and 8666 sec, respectively(note: the single hand calculation assumes the expected value of splitting ( s , s ) is twicethe expected value for playing a single hand of ( s ) [4]). All calculations were done using3 GHz Intel Xeon processors (either a Mac or HP Linux cluster node from 2008). Recursivegeneration of h hands should scale roughly as N h where N is the effective number of possiblesingle hands. The effective N for dealer up card 6 was 73 to 176. Repeating that calculationsfor dealer up card 9 for for h = 1 or 2, took 2.75 sec and 4482 secs, for an effective N = 1631.Calculations for h = 3 were too slow to attempt.Calculations for dealer up card 6 (and other low cards 2-6) have lower N and completefaster. Calculations for dealer up card 9 (and other high up cards 7-10, A) have a higher N and take much more time. The reason for lower N vs. low up cards is that basic strategystops hitting at a low score (12 or 13). Against high up cards basic strategy continueshitting to 17 thus requiring consideration of longer hands. By considering all up cards andextrapolating observed scaling effects, it was estimated that completing splitting calculationsfor all up cards and all splitting rule options up to h = 4 would take 3 . × seconds or11,000 years of CPU time. The following sections give strategies for faster calculations. The last step for each generated hand is to calculate its expected value. This step requiresenumeration through all possible dealer hands for the current deck composition to find (cid:126)D ( u, (cid:126)r ). In the process of generating player hands, however, the same deck composition willoccur many times. A significant improvement in performance is possible by caching dealerprobabilities such that the next time the same composition occurs, (cid:126)D ( u, (cid:126)r ) can be found ina look-up table. The key task is an addressing mechanism for storing dealer results.Imagine a table to hold all dealer results for decks with 0 to j cards removed. Becauseremoval order does not matter, the removed cards are first put into decreasing sequence( x , x , . . . , x j ) with x ≥ x ≥ x ≥ . . . x j and x i = 0 to 10 for card type removed. Avalue of x i = 0 is used to signify no card removed to handle compositions with less than j removed cards. Define K j ( x , x , . . . , x j ) as the address found by enumerating through allcompositions K j ( x , x , . . . , x j ) = x (cid:88) i =0 min( i ,x ) (cid:88) i =0 · · · min( i j − ,x j ) (cid:88) i j =0 i = x , i = x , · · · , i j = x j . This address is better defined using a recurrence relation: K ( x ) = 1 + x and K j ( x , x , . . . , x j ) = K j − ( x , . . . , x j ) + x − (cid:88) i =0 T j − ( i + 1) (3)6here T j ( N ) = K j ( N − , N − , . . . , N − j items in which each itemcan assume N states (0 to N −
1) and is thus the length of that table. Evaluation of K j ( N − , N − , . . . , N −
1) using Eq. (3) gives T j ( N ) = N − (cid:88) i =0 T j − ( i + 1)which leads to K j ( x , x , . . . , x j ) = 1 + j (cid:88) i =1 T i ( x j − i +1 ) (4)From the definition of T j ( N ) initiated with T ( N ) = N : T ( N ) = N ( N + 1)2 , T ( N ) = N ( N + 1)( N + 2)2 · , T j ( N ) = (cid:32) N + j − j (cid:33) (5)A dealer cache is created by setting j to maximum allowed by available memory. Eachtime the dealer probabilities are needed, the address is calculated by Eq. (4). To avoidrepeated evaluation of T j ( N ), all needed values can be pre-calculated and stored in a j × T j (11). The largest cache used was j = 23 requiring 2.23 GB ofstorage (when using standard four-byte floats)Figure 1 shows the effect of dealer cache size when evaluating splitting of all pairs withall double down options (ND, DD1, and DD2) for dealer up cards 6 or 9 and various h values(as mentioned above, calculations for high up card of 9 take longer than for low up card6). Very small caches are no help, but once the cache size reaches the common hand size,the calculation time drops rapidly showing improvements of up to two orders of magnitude.Larger cache sizes are required as h increases. The time increases at very large cache size( e.g. , 1 hand results in Fig. 1) if the time needed to allocate and initialize the cache isnon-negligible compared to calculation time.The next calculations reconsidered splitting of all pairs with all double down options(ND, DD1, and DD2) for all possible dealer up cards using optimum cache sizes. Averagecalculation times for the recursive method with a dealer cache for low ( vs. vs. h , in Fig. 2 as thin, red lines. The scaling was approximately N h , with N effectively N = 50 to 100 for low up cards and over 2200 for higher up cards. Note that N is similarto the first calculations, but the pre-factor for absolute time is significantly reduced. Cal-culations up to 4 hands with low dealer up cards were completed, but calculations for highdealer up cards were still too slow. The dashed line in Fig. 2 extrapolates the time to h = 4for high dealer up cards by mimicking the increase in effective N for low up cards. Thisextrapolation provides and estimate of 5 . × or 160 years of CPU time for all calculations— a significant improvement, but still too long.7 ealer Cache Size C P U T i m e ( s e c ) -2 -1 -0 vs 6, 3 handsvs 9, 2 handsvs 6, 2 handsvs 9, 1 handvs 6, 1 hand Figure 1:
The effect of dealer cache size on splitting calculation times for dealer up card 6 (solidlines) or 9 (dashed lines) with total play allowed to 1 hand, 2 hands, or 3 hands. The “ vs 9, 3hands ” were too slow and are not plotted.
Hands C P U T i m e ( s e c ) -1 vs. 7-T, A (avg), Recursivevs. 2-6 (avg), Recursivevs. 7-T, A (avg), Hands vs. 2-6 (avg), HandsTotal CPU Time, Hands Figure 2:
Splitting calculation times for various up cards done be either “Recursive” methods(thin, red lines) or by pre-enumerated “Hands” method (thick, blue lines) as a function of themaximum number of allowed split hands. The solid, black line is the total execution time vs. alldealer up cards using the pre-enumerated “Hands” method. .5 Pre-enumerated Hands Method The problem with recursive hand generation is that it is inefficient. The method revisits manyidentical hands that differ only by order in which the hand receives cards. For example, whensplitting 2’s vs. dealer 9, recursive methods generate 21,166 hands, but only 1527 of thosehands are unique. The next improvement was to catalog all unique hands and then evaluatesplitting expected values by enumerating over only the unique hands.Cataloging of unique hands was done by recursive generation of all possible single hands.An array of
PlayHand objects was constructed to hold the hands. For each unique hand, the
PlayHand object tracks hand composition, the number of times the hand occurs, the numberof times the second card in the hand is another split card, total bet size on all hands,and total bet size on potential split hands. Tracking the second card is needed to allowresplitting calculations. Tracking bet size is needed to support doubling down after splittingoptions. The dealer-cache-addressing methods were used to efficiently determine whethereach generated hand is a new hand or corresponds to a previously generated hand. A handlook-up table of T j (11) integers, where j is the maximum hand length, was created and filledwith -1. Each hand uses Eq. (4) to find an address from its decreasing card composition.If the table entry at that address is -1, a new PlayHand object is created and added to theunique hands array. The location of the new hand in that array is stored in a hand lookup table. The next time the same hand occurs the look up table will provide its locationin the array of unique hands and the new information can be appended to the existing
PlayHand object. Notice that building a unique hands list requires recursive generation ofhands. Because splitting calculations revisit the same individual hands many times, a uniquehands list provides significant benefit. All other calculations visit each hand only once andtherefore a unique hands list provides no computational benefit.Once the unique hands are collected, the exact splitting expected values are evaluated asabove except using the new handExactSplitExval() method in Appendix C: exval = hands[0]->handExactSplitExval(deck,dealer,hands,numHands,maxHands,handList);
The last argument is an array of
PlayHand objects for all possible unique hands for thecurrent splitting rules. Average calculation times when using a hands list for low ( vs. vs. h , in Fig. 2 as thick, blue lines. For low up cards, the calculation timesdecreased by an order of magnitude for h > N was reduced to 12 to50. For high up cards the times for h = 4 decreased about three orders of magnitude. Theeffective N was reduced to 250 and did not increase with h . Figure 2 also shows the totalcalculation time to find expected values for all dealer up cards, all splitting pairs, and allsplitting options (ND, DD1, and DD2) for a single deck game. Calculations for h = 4 took3 . × sec or 45 days — five orders of magnitude faster than non-optimized recursivemethods. The calculations were done using on a 32-processor cluster by partitioning intodifferent up cards and different splitting pairs. Some calculations took much longer than The maximum hand length in a split hand played by basic strategy with infinite decks is 14 cards. Thehand is (1,1,1,1,1,1,1,1,4,1,1,1,1,1) corresponding to split aces played out as normal hands. The 4 as theninth card is when hitting soft 18 converts the hand to a hard 12.
The above algorithm describes a serial calculation of exact expected values for pair splittingthat minimizes computer time. The algorithm could possibly be parallelized, but its use ofcaches for dealer probabilities and unique player hands complicates that task. To achievegood scaling, each processor would need separate caches. By this approach, separate proces-sors would lose the benefit of learning from dealer calculations done in a other processors. Inshared-memory parallelization, multiple copies of caches would limit the memory availableto each one thus limiting dealer probabilities that could be cached. Multiple processors couldshare a single cache, but the frequent locks needed to write new results to the cache wouldreduce scaling performance. The dealer cache, however, applies only to a single dealer upcard. The best strategy for parallel code, therefore, is for each processor to do calculationsfor a single up card. The simplest approach to this parallelization, is simply to run 10 serialcalculations with each one considering a single dealer up card.
Tables 1 and 2 give exact splitting expected values for all split pairs against all dealer upcards in a single-deck game where the dealer stands on soft 17. Each table cell has fournumbers. The first row is when resplitting is not allowed; the second row is when resplittingis allowed (to a maximum of 4 hands). Within each row, the first value is when doublingdown after splitting is not allowed; the second value is when doubling down after splitting onany two cards is allowed. Splitting of aces assumes each hand gets a single card. Resplittingof aces means if the single card is another ace, that new pair can be split again, but stillonly receives a single card. Exact calculations were also completed for dealer hitting soft 17and for double down after splitting on only 10 and 11. Those results are not included intable, but are included in the total CPU times. Thus total CPU time is the time requiredto analyze all possible splitting rule variations in a single deck game.Prior to these exact calculations, the best splitting calculations used the approximatemethods developed by Griffin [4]. If (cid:126)h i for i = 1 to N is the collection off all possible uniquehands for one splitting situation, the exact expected value used in the hands-lines methodfor splitting a pair of s cards when resplitting is not allowed can be written explicitly as E s ( (cid:126)h ( s, s ) , u ) = N (cid:88) i =1 N (cid:88) j =1 w ( (cid:126)h i ) w ( (cid:126)h j | (cid:126)h i ) (cid:20) b ( (cid:126)h i ) S ( (cid:126)h i , u, (cid:126)h j ) + b ( (cid:126)h j ) S ( (cid:126)h j , u, (cid:126)h i ) (cid:21) (6)Here w ( (cid:126)h i ) is the weight for hand i defined as the probability of hand i times the number oftimes that unique hand occurs, w ( (cid:126)h j | (cid:126)h i ) is the analogous weight for hand j given that hand i has been removed from the deck, b ( (cid:126)h ) is the average bet size for a hand, and S ( (cid:126)h i , u, (cid:126)h j )is the expected value for standing on hand i against dealer up card u given that both hand i and j have been removed from the deck. Note that b ( (cid:126)h ) = 1 when doubling down after10 a b l e : E x a c t s p li tt i n g e x p ec t e d v a l u e s v s . d e a l e r up c a r d s A ce t h r o u g h f o r a s i n g l e d ec k ga m e w h e r e d e a l e r s t a nd s o n s o f t . T h e fi r s t r o w o f e a c h ce lli s w h e n r e s p li tt i n g i s n o t a ll o w e d ; t h e s ec o nd r o w i s w h e n r e s p li tt i n g i s a ll o w e d t o4 h a nd s . T h e fi r s t c o l u m n o f e a c h ce lli s w h e nd o ub li n g d o w n a f t e r s p li tt i n g i s n o t a ll o w e d ; t h e s ec o nd c o l u m n i s w h e n i t i s a ll o w e d o n a n y t w o c a r d s . D ec i m a l p o i n t s i n f r o n t o f e a c hnu m b e r w e r e o m i tt e d t o s a v e s p a ce . H a nd A ce A , A , - - - - - - - - - - , - - - - - - - - - - - - , - - - - - - - - - - - - - - , - - - - - - - - - - - - - - , - - - - - - - - - - - - - , - - - - - - - - - - , - - - - , - - - - T , T - - a b l e : E x a c t s p li tt i n g e x p ec t e d v a l u e s v s . d e a l e r up c a r d s t h r o u g h T e n f o r a s i n g l e d ec k ga m e w h e r e d e a l e r s t a nd s o n s o f t . S ee c a p t i o n t o T a b l e f o r m o r e d e t a il s . H a nd T e n A , A , - - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - , - - - - - - - - . - - - - , - - - - - - - - T , T - - - - b ( (cid:126)h ) > E s ( (cid:126)h ( s, s ) , u ) ≈ E ( (cid:126)h ( s ) , u, s ) = 2 N (cid:88) i =1 w ( (cid:126)h i ) b ( (cid:126)h i ) S ( (cid:126)h i , u, s ) (7)where E ( (cid:126)h ( s ) , u, s ) is the expected value of playing out a hand with a single card s against adealer up card given that the second s card has also been removed from the deck. The exactand approximate methods agree within ± . S ( (cid:126)h i , u, s ) = 12 N (cid:88) j =1 w ( (cid:126)h j | (cid:126)h i ) (cid:20) S ( (cid:126)h i , u, (cid:126)h j ) + b ( (cid:126)h j ) b ( (cid:126)h i ) S ( (cid:126)h j , u, (cid:126)h i ) (cid:21) Because averaging over all hands (cid:126)h j is expected to average out variations in S ( (cid:126)h i , u, (cid:126)h j ),the equation is likely to be accurate. Calculations show it is extremely accurate, but theapproximate approach is not an exact result.Calculations when resplitting is allowed are much more complicated. The state-of-the-art,prior to these exact results, is again due to Griffin [4]. The approximate equation is E s ( (cid:126)h ( s, s ) , u ) ≈ h (cid:88) i =2 iP ( i ) E ( i )where P ( i ) is the probability of playing exactly i hands, h is the maximum number of hands,and E ( i ) is a single hand expected value calculated as follows:1. Calculate the expected value for a single hand starting with an s card for a deck withthe dealer up card and i of the s cards removed from the deck.2. The player hand cannot draw an s card as the second card in the hand.3. The dealer expected values are found conditional that the i − s cards.The third requirement means dealer expected values calculated for this analysis differ from allother calculations and thus results stored in the dealer cache cannot be used. The probabilityof card k for dealer play when finding E ( i ) for splitting s cards is p ( k, i, s ) = n k n deck − i + 1 for k = sn k n deck − i + 1 (cid:18) n deck − n s − i + 1 n deck − n s (cid:19) for k (cid:54) = s For calculations to a maximum of four hands ( h = 4), E (4) allows the hand to draw an s for its second card, the dealer expected values are unaffected by player hole cards, and P (4)is set to P (4) = 1 − P (2) − P (3). 13his approximate analysis was compared to exact results. For splitting aces, and resplit-ting 2 through 9, the approximate equation is very accurate. Nearly all results agree within ± . vs. vs. ± . ± . P (4) is much larger and the calculation of E (4)is less accurate.A new approximate analysis was developed that significantly improves on Griffin’s ap-proach when resplitting 10’s and also improves the accuracy for all other calculations. When h = 4, it takes 4 cards to resolve the hand play. Let s be a split card and n be a non-splitcard. The 16 possible orders for n and s cards in 4 cards are classified as in Table 3. Forexample, the first row is all combinations where the first two cards are non-split cards. Thesetwo non-split cards mean exactly two hands will be played. The approximate expected valueis 2 E (2) and the probability of those four sequences in P (2). The remaining lines partition3- and 4-hand situations to refine approximate calculations. For example, the second rowhas order nsnn . The first n means the first hand is played when only two s cards have beenremoved from the deck and thus has approximate expected value E (2). The next s meansthe second hand is split; the following two n ’s mean those two hands are played resultingin three final hands. Since the last two hands are played with three s card removed, theirapproximate expected values are E (3) each. The expected value of the second row is this E (2) + 2 E (3). The probability is denoted as P (3 / E s ( (cid:126)h ( s, s ) , u ) ≈ (cid:104) P (2) + P (3 /
1) + P (4 /
1) + P (4 / (cid:105) E (2)+ (cid:104) P (3) − P (3 /
1) + P (4 /
1) + 2 P (4 /
3) + P (4 / (cid:105) E (3)+ (cid:104) P (4) − P (4 / − P (4 / − P (4 / − P (4 / (cid:105) E (4) (8)Notice that this new approximation still depends only on E (2), E (3), and E (4) and thusis no more work than Griffin’s method. It simply revises the probabilities associated witheach expected value. These probabilities can be easily calculated by methods in Griffin(see Appendix D) and it is noted that P (3) = P (3 /
1) + P (3 / P (4) = P (4 /
1) + P (4 /
2) + P (4 /
3) + P (4 /
4) + P (4 / ± .
100 to ± .
006 with many errors under ± . Beat the Dealer [2]. His tablesgive expected values (to three significant digits) for all pairs against all up cards for a singledeck game where resplitting is not allowed, doubling down after splitting is allowed on anytwo cards, and the dealer stands on soft 17. Epstein [3] gives essentially the same expectedvalues (but to four significant figures). Although Epstein claims to have analyzed resplittingallowed, his tables are much closer to results when resplitting is not allowed. The mean errorsin these tables compared to the exact results for no replitting are ± .
022 with some errors ± .
07. Neither reference gives sufficient information to explain the discrepancy. Epsteinstates an approximate formula analogous to Eq. (7), but since that equation is accurate, he14able 3:
All sequences four cards of type n (for non-split card) and s (for split card) and theapproximate expected value and probability appropriate for that sequence. Card Order Approximate Expected Value Probability nnnn , nnns , nnsn , nnss E (2) P (2) nsnn E (2) + 2 E (3) P (3 / snnn E (3) P (3 / nsns E (2) + E (3) + 2 E (4) P (4 / nssn , nsss E (2) + 3 E (4) P (4 / snns E (3) + 2 E (4) P (4 / snsn , snss E (3) + 3 E (4) P (4 / ssnn , ssns , sssn , ssss E (4) P (4 / ± .
011 and maximum error to ± . et al. [8], did calculations for a four deck game with resplitting allowed, doublingdown allowed on any two cards, and dealer stands on soft 17. They estimated that exactcalculations would take 100 times longer than their other calculations (an estimate that is offby about 9 orders of magnitude), and therefore did all splitting calculations by Monte Carlosimulations. Their table only gives splitting expected values for hands in which splittingis favorable. Because exact results for multiple decks have not be done yet, these resultswere compared instead to the new approximate analysis for resplitting in four decks to fourhands. The mean absolute error of all their available calculations is ± . ± .
04. These errors are similar to independent Monte Carlo simulations run duringthis work and probably representative of expected errors for a simulation approach.Hawkins [7] gives results for a six deck game with no doubling down after splitting anddealer hits soft 17. His analysis used the Griffin [4] approximate methods and gives expectedvalues for either resplitting allowed or resplitting not allowed, depending on which was morefavorable. When the table gives non-resplitting results, the results are usually identical tocalculations by Eq. (7). The two exceptions are vs. dealer up cards ace and ten and forsplitting (3,3) vs. dealer up card 8. The inaccuracies for dealer up card ace and ten suggestHawkins did not follow Griffin’s method to account for the effect on player card probabilitiesof the knowledge that the dealer does not have blackjack [4]. Hawkins results for splitting(3,3) vs. i.e. , omitted the 2in Eq. (7)). Hawkins resplitting results were compared to the new approximate analysis forresplitting; they agree well with a mean absolute error of ± . i.e. , standing on the twenty), two hands, three hands, or four hands, vs. dealer up cardof 6 are 0.697403, 0.525105, 0.426506, and 0.363571. In basic strategy, it is never favorableto split tens and thus the decreasing expected values are not relevant. In card-countingstrategies, however, one can calculate a cutoff count for splitting tens [4]. When the countexceeds that cutoff value, splitting tens becomes favorable. But, the cutoff values to continuesplitting to more hands will be higher than the cutoff value for the first split. Furthermore,because additional tens that allow resplitting lower standard counts, it is highly unlikely forthe count to ever be high enough to recommend splitting tens more than once or twice. Acommon story in card-counting books is about using a count to split and resplit tens [9, 10].In these stories, the first split may have been correct, but it is likely each resplit is givingadvantage back to the house. The stories are meant to convey card-counting prowess, butrather show a misunderstanding of the expected values for resplitting. An extreme examplein Uston [9] describes splitting tens up to 11 hands resulting in a $5000 loss. This outcomewas attributed to bad luck despite “correct plays.” More likely, the correct play was to splitonly once or twice.Finally, by combining exact splitting results with easily-calculated exact results for stand-ing, hitting, and doubling down [6, 11], one can calculate the exact expected value for basic-strategy blackjack including the influence of all splitting rule variations. Such calculationsfor a single-deck game when dealer stands on soft 17 are summarized in Table 4. The lefthalf of the table is for games that allow doubling down on any hand with the two columnsfor whether or not doubling down is also allowed after splitting. The first row is a baselinecalculation when resplitting is not allowed. The next two rows give the change in expectedvalue by allowing resplitting except for aces and by allowing resplitting including aces. Forcomparison, the last row gives the change in expected value by prohibiting splitting. Thesame calculations for games that restrict doubling down to 10 and 11 are in the right halfof the table. The player benefits of allowing resplitting are small and range from 0.0170%to 0.1889%. Similarly, the penalty to the player of eliminating the splitting option is only0.3566% to 0.3595%. This benefit of resplitting and penalty of eliminating splitting aresmall because the total number hands worth splitting is small. Although 11.8% hands couldbe split, most are hands that should not be split ( e.g. , (10,10)). Under favorable rules,only 2.5% of hands provide beneficial splitting opportunities. The game calculations wererepeated when dealer hits soft 17. All expected values decrease by 0.19% to 0.20% ( i.e. ,hitting soft 17 is less favorable to the player). Because all expected values change the sameamount, the effects of different splitting rules are essentially unchanged.Single-deck blackjack is a remarkably fair game with the non-resplitting game rangingfrom 0.2964% house advantage to a 0.1007% player advantage (the table entries in bold aregames that provide a player advantage). These calculation were based on exact computercalculations (tabulated to six-digit precision) and therefore very accurate. Repeating gamecalculations using the new approximate splitting in Eq. 8 gives essentially the same resultswith maximum expected value difference of only 0.00039%. Because the approximate split-ting analysis is extremely accurate, it can be used to calculate expected values in multi-deckgames. All expected values decrease about 0.35%, 0.51%, and 0.56% for two-, four-, andsix-deck games. That largest incremental decrease is between one- and two-deck games.16able 4: Effect of splitting rules on total expected values for single-deck blackjack (in percent)when dealer stands on soft 17. The two halves are for doubling down on any two hands or doublingdown on just 10 & 11 with two columns in each section for whether or not doubling down is alsoallowed after splitting. The first row gives baseline game when resplitting is not allowed. The nextthree rows give the change in expected value by allowing resplitting (but not aces), by allowingresplitting (including aces), and by eliminating the splitting option. Entries in bold are when thegame is favorable to the player.
Options DD Any Hand DD 10 & 11 OnlyND DD1 ND DD2Base — No Resplit -0.0283 -0.2964 -0.1904∆ Resplit (-A’s) +0.0170 +0.1577 +0.0170 +0.1327∆ Resplit (+A’s) +0.0482 +0.1889 +0.0482 +0.1638∆ Eliminate Splitting -0.3566 -0.3595Thereafter, the effect of more decks has diminishing penalty and approaches a limit of about0.60% decrease for an infinite number of decks.Note that the first significant digit in some expected values is the second digit after thedecimal point for percentages (or in the fourth digit for absolute expected values). For theseresult to be accurate in that digit, tabulated expected values need more digits of precision.Figure 3 plots game expected value (game rules indicated on the figure) as a function of digitsof precisions in tabulated expected value tables for standing, hitting, doubling down, andsplitting. This plot shows that tables need at least five digits of precision. Prior publisheddata to three [2] or four significant digits [3] might lack precision in full-game expected values.Tables 1 and 2 provide six digits of precision, which is enough precision for accurate gameexpected value calculations.
The calculation of exact splitting expected values in a one deck game when resplitting isnot allowed or when resplitting is allowed to a maximum of four hands were both solved bycomputer methods. The calculations when resplitting is not allowed can be done reasonablyfast. The results showed that prior approximate calculations are extremely accurate. Thecalculations when resplitting is allowed are time consuming, but the methods here makethem possible given sufficient computer power. The new exact results showed that priorapproximate methods were inaccurate for resplitting 10’s. A new approximate solution wasdeveloped. It can be done rapidly and is accurate to ± .
001 for all resplitting calculationsexcept for resplitting 10’s. The approximate analysis for replitting 10’s is accurate to ± . igits of Precision G a m e E x pe c t ed V a l ue ( % ) Figure 3:
Calculation of total game expected value based on expected value tables reported todifferent number of digits of precision (in the absolute expected values). The analyzed game rulesare indicated on the figure.
Whenever computer recursion is too repetitive, significant improvements may be possible byrevising enumeration methods.Although exact calculations for splitting are lengthy, if all rule variations are included,they only need to be done once. A complete table requires twelve calculations for each splitpair vs. each dealer up card — three double down options (ND, DD1, and DD2) when thedealer hits soft 17, the same three options when the dealer stands on soft 17, and these sixcalculations have to be done for both resplitting not allowed and resplitting allowed. Thetables in this paper only include four of these twelve results for a one-deck game. Theyinclude results are for ND and DD1, for resplitting allowed or not allowed, and only fordealer stands on soft 17. The remaining exact calculations for one-deck games are in thesoftware project [6] and posted on the web [11]. The exact calculations for multideck gameshave not been done and would require somewhat more computer time. Multideck results forall twelve calculations, however, were run using the new approximate methods; these resultsare also in the software project [6] and posted on the web [11].
Appendices
A. Basic Strategy
The single-deck basic strategy for hitting and doubling down used in these calculations was1. Hard Hitting: Hit 12 or less vs. dealer up card 2 or 3 (except hit (10,3) vs. vs. vs. vs. vs. vs. vs.
10 and stand on 16 with 3 or morecards vs. vs. dealer up card 2 or 8, hit soft 18 or less vs.
9, 10and Ace (except stand soft 18 vs.
Ace if dealer stands on soft 17).3. Hard Doubling Down: Double 9 to 11 vs. dealer up card 2 to 4, double 8 to 11 vs. vs. vs. vs. vs.
10 and Ace.4. Soft Doubling Down: Double (A,6) vs.
2, double (A,6) and (A,7) vs.
3, double (A,2)to (A,7) vs. vs.
B. Recursive Hand Generation
Exact expected values by enumerating through all possible split hands is accomplished bythe following algorithm (see software project for full code [6]): float Hand::exactSplitExval(Deck &deck,Dealer &dealer,Hand **hands,int &numHands,int maxSplitHands){ float exval = 0., wt, totalVal;bool newHand = false;for(int i=TEN; i>=ACE; i--){ if(!deck.removeAndGetWeight(i,&wt,dealer)) continue;// add new hand or new cardif(i == firstCard && cards == 1 && numHands < maxSplitHands){ hands[numHands++] = new Hand(firstCard);newHand = true;}elsehit(i);// hit again, continue to next hand, or add to probabilitiesif(basicSplitHit(deck,dealer))exval += wt*exactSplitExval(deck,dealer,hands,numHands,maxSplitHands);else if(this != hands[numHands-1])exval += wt*nextHand->exactSplitExval(deck,dealer,hands,numHands,maxSplitHands);else{ totalVal=0.;for(int j=0; j
Deck object to remove a card from the deck and calculate p ( i ) = wt ; it returns false if nosuch card remains in the deck. If the current card is another split card (and is the sec-ond card in the hand), a new hand is created providing the total number of hands inless than h (in maxSplitHands) , otherwise the hit() method adds the card to the hand.If the basicSplitHit() method says to hit again, the method is called recursively; the basicSplitHit() method also checks if the hand should be doubled down. If the hand is nothit and the current hand is not the last hand, the exactSplitExval() method is called inthe next hand object; otherwise for the last hand, the results for all hands, accounting fordoubled down hands, are summed and added with proper weighting to the expected value.If a new hand was created, it is deleted; otherwise the card is removed from the hand (by unhit() ). Finally, the loop card is restored to the deck. When the loop is done, the exactexpected value is returned ( exval ). C. Pre-Enumerature Hands Method
Exact expected values using a previously calculated list of all possible hands (in handList )is accomplished by the following algorithm (see software project for full code [6]): float Hand::handExactSplitExval(Deck &deck,Dealer &dealer,Hand **hands,int &numHands,int maxSplitHands,handset &handList){ float exval = 0., wt, totalVal;// check for resplittingif(numHands
PlayHand objects in handList ; these objects have all possible hands that can be played inthe current splitting calculation. Because the hands list is for playable hands, the methodhas to begin with a separate check for resplitting opportunities. If it is possible to resplit, anew hand is created, handExactSplitExval() is called recursively, and then the new hand isdeleted.The main loop is over all possible hands rather than over possible cards. The first stepsare to remove all cards in the next playable hand, get the weight for that hand, and populatethe current
Hand object with those cards. The key to these steps is to account for playablehands that may include one or more hands that could be resplit; i.e. , one or more of the21ands described by the
PlayHand object is a hand where the second card is another splitcard. When the current number of hands is less the the maximum and the current
PlayHand object includes hands than can repslit, the weighting must be adjusted to include just thefraction of the hand that cannot be resplit; otherwise the entire
PlayHand content is used.The removeAndGetNonsplitWeight() or removeAndGetWeight() functions remove all cards inthe PlayHand object from the deck and adjust the weight according to the frequency of thathand; the methods return false if the hand is not possible from the current remaining cards.The fillNonsplitHand() and fillHand() methods add the cards to the current
Hand objectand also calculate the average bet per hand to adjust for frequency of doubled down handsin the current
PlayHand object.Next, if the current hand is the last hand, the total expected win for all hands is summedand added to total expected value. The getExpectedSplitWin() function adjusts the winrate to average bet size per hand to allow calculations with doubling down after splitting. Ifthe current hand is not the last hand, control is passed to the next player hand. Finally, allcards in the current
PlayHand object are removed from the current
Hand object and restoredto the deck. When the loop is done, the exact expected value is returned ( exval ). Thisrevised enumeration approach was verified as correct by comparison to the direct recursivemethod in Appendix B when that method was not too slow to be used.
D. Probabilities for Approximate Splitting Calculations
Define p j ( s ) as the probability that the first split card is drawn in the j th position and p j ( s | s )as the probability that the second split card is drawn in the j th position. They are calculatedfrom player card probabilities in Eq. (2): p ( s ) = p ( s ) p ( s ) = p ( s ) given n deck → n deck − p ( s | s ) = p ( s ) given n s → n s − , n deck → n deck − p ( s ) = p ( s ) given n deck → n deck − p ( s | s ) = p ( s ) given n s → n s − , n deck → n deck − p ( s ) = p ( s ) given n deck → n deck − p ( s | s ) = p ( s ) given n s → n s − , n deck → n deck − P (2) = (cid:104) − p ( s ) (cid:105)(cid:104) − p ( s ) (cid:105) P (3 /
1) = (cid:104) − p ( s ) (cid:105) p ( s ) (cid:104) − p ( s | s ) (cid:105)(cid:104) − p ( s | s ) (cid:105) P (3 /
2) = p ( s ) (cid:104) − p ( s | s ) (cid:105)(cid:104) − p ( s | s ) (cid:105)(cid:104) − p ( s | s ) (cid:105) P (4 /
1) = (cid:104) − p ( s ) (cid:105) p ( s ) (cid:104) − p ( s | s ) (cid:105) p ( s | s ) P (4 /
2) = (cid:104) − p ( s ) (cid:105) p ( s ) p ( s | s ) P (4 /
3) = p ( s ) (cid:104) − p ( s | s ) (cid:105)(cid:104) − p ( s | s ) (cid:105) p ( s | s ) P (4 /
4) = p ( s ) (cid:104) − p ( s | s ) (cid:105)(cid:104) − p ( s | s ) (cid:105) (4 /
5) = p ( s ) p ( s | s ) References [1] Roger R. Baldwin, Wilbert E. Cantey, Herbert Maisel, and James P. McDermott.The optimum strategy in blackjack.
Journal of the American Statistical Association ,51(275):429–429, 1956.[2] Edward O. Thorp.
Beat the Dealer . Random House, New York, NY, 1962.[3] Richard A. Epstein.
The Theory of Gambling and Statistical Logic . Academic Press,New York, 1977.[4] Peter A. Griffin.
The Theory of Blackjack . Sixth Edition. Huntington Press, Las Vegas,NV, 1999.[5] E. O. Thorp. A favorable strategy for twenty-one.
Proc. Nat. Acad. Sci, U.S. , 47(1):110–112, 1961.[6] John A. Nairn. Blackjack software project. https://github.com/nairnj/Blackjack ,15 SEP 2019, SEP 2019.[7] Willliam G. Hawkins. Blackjack subsets: Software for the study of blackjack, and anapplication to resplitting in six deck blackjack. In Olaf Vancura, Judy A. Cornelius,and William R. Eddington, editors,
Finding the Edge: Mathematical Analysis of CasinoGames , pages 103–113. Institute for the Study of Gambling and Commercial Gaming,2000.[8] A. R. Manson, A. J. Barr, and J. H. Goodnigh. Optimum zero-memory strategy andexact proabilities for 4-deck blackjack.
The American Statistician , 29(2):84–88, 1975.[9] Ken Uston.
Million Dollar Blackjack . SRS Enterprises, Inc., Hollywood, CA, 1981.[10] Ben Mezrich.
Bringing Down the House . Free Press, New York, 2002.[11] John A. Nairn. Blackjack software for calculation of exact expected values.