Blackjack Details

In Blackjack Game, we’ll present elements of the game of Blackjack. Blackjack uses cards and has fairly complex rules for counting the number of points in a hard of cards.

Blackjack offers relatively few bets, most of which are available based on the state of the game. We’ll cover these bets and the conditions under which they are allowed in Available Bets and Choices.

Finally, we will describe some common betting and playing strategies that we will simulate. in Betting Strategies. In this case, we have playing strategies that are unique to Blackjack, combined with betting strategies initially defined in Roulette and reworked in Craps.

Blackjack Game

Blackjack centers around hands composed of cards drawn from one or more standard 52-card decks. The standard deck has thirteen ranks in four suits; the suit information has no bearing on game play. The player and the house are both dealt hands, starting with two cards. The house has one card exposed (the up card) and one card concealed (the hole card), leaving the player with incomplete information about the state of the game. The player’s objective is to make a hand that has more points than the dealer, but less than or equal to 21 points. The player is responsible for placing bets when they are offered, and taking additional cards to complete their hand. The dealer will draw additional cards according to a simple rule: when the dealer’s hand is 16 or less, they will draw cards (or “hit”), when it is 17 or more, they will not draw additional cards (or “stand pat”).

An interesting complication is the point values of the cards. The number cards (2-10) have the expected point values. The face cards (Jack, Queen and King) all have a value of 10 points. The Ace can count as one point or eleven points. When an ace is counted as 11, the total for the hand is called “soft.” When the ace counts as 1, the total is called “hard.” For example, A-5 is called a soft 16 because it could also be considered a hard 6. A-10-5 is a hard 16.

Also, an Ace and a 10 or face card totals 21. This two-card winner is called “blackjack”.

The betting surface is marked with two places for bets: a single bet, placed before any cards are dealt, and an insurance bet, offered only when the dealer’s up card is an ace. There are a few additional bets, and a few player choices. We’ll step through some variations on the sequence of play to see the interactions a player has during a game. Note that a casino table seats a number of players; like Craps and Roulette, the player opposes the house, and the presence or absence of other players has no bearing on the game.

Note

Rule Variations

There are seemingly endless variations in the exact playing rules used by different casinos. We’ll focus on a relatively common version of the rules. With this as a basis, a number of variations can be explored.

Typical Scenario. The player places an initial bet. Since the bet is blind – there is no information on the state of the game – it can also be called an “ante.” The player and dealer are then dealt a pair of cards. Both of the player’s are face up, the dealer has one card up and one card down. If the dealer’s card is an ace, the player is offered insurance. The details will be described in a separate sceanario, below.

Initially, the player has the following choices:

  • If the two cards are the same rank, the player can elect to split into two hands. This is a separate scenario, below. It involves an additional bet. The subsequent bet is not blind; the player knows one of the cards in the new hand before betting.

  • The player can double their bet and take just one more card. In some casinos this opportunity may be limited to certain totals on the cards; for instance, only 10 and 11. The opportunity to double may be limited to a certain number of cards; for instance, two cards.

  • The more typical scenario is for the player to take additional cards (a “hit”) until either their hand totals more than 21 (they “bust”), or their hand totals exactly 21, or they elect to “stand” on a total less than 21.

If the player’s hand is over 21, their bet is resolved immediately as a loss. Resolving these bets early is an important part of the house’s edge in Blackjack. If the player’s hand is 21 or less, however, it will be compared to the dealer’s hand for resolution.

The dealer then reveals the hole card. While the dealer’s total is 16 or less, they take an additional card; if their total is 17 or more, they stand pat. This rule is summarized as “hit on 16, stand on 17”. In some casinos a dealer will hit a soft 17 (A-6), which improves the house’s edge slightly.

If the dealer busts, the player wins. If the dealer did not bust, then the hands are compared: if the player’s total is more than the dealer, the player wins; if the totals are equal, the bet is a push; otherwise the dealer’s total is more than the player and the player loses.

If the player’s hand is an ace and a 10-point card (10, Jack, Queen or King), the hand is blackjack and the the ante is paid off at 3:2. Otherwise, winning hands that are not blackjack are paid off at 1:1.

Dealer Shows An Ace. If the dealer’s up card is an ace, the player is offered an insurance bet. This is an additional proposition that pays 2:1 if the dealer’s hand is exactly 21 (a \tfrac{4}{13} probability). The amount of the bet is half the original ante. If this insurance bet wins, it will, in effect, cancel the loss of the ante. After offering insurance to the player, the dealer will check their hole card and resolve the insurance bets. If the hole card is 10-point card, the dealer has blackjack, the card is revealed, and insurance bets are paid. If the hole card is not a 10-point card, the insurance bets are lost, but the card is not revealed.

In the unusual case that the dealer shows an ace and the player shows blackjack (21 in two cards), the player will be offered “even money” instead of the insurance bet. If the player accepts the even money offer, their hand is resolved at 1:1 immediately, without examining the dealer’s hole card or playing out the hand. If the player declines even money, they can still bet or decline insurance. Checking the odds carefully, there is a \tfrac{4}{13} (30.7%) chance of the dealer having 21, but insurance is paid as if the odds were \tfrac{1}{3} (33.3%). Since the player knows they have 21, there is a \tfrac{4}{13} probability of a push plus winning the insurance bet (both player and dealer have 21) and a \tfrac{9}{13} probability of winning at 3:2, but losing the insurance bet (effectively a push).

Split Hands. When dealt two cards of the same rank, the player can split the cards to create two hands. This requires an additional bet on the new hand. The dealer will deal an additional card to each new hand, and the hands are played independently. Generally, the typical scenario described above applies to each of these hands. The general rule of thumb is to always split aces and eights.

The ideal situation is to split aces, and get dealt a 10-point card on each ace. Both hands pay 3:2. A more common situation is to have a low card (from 2 to 7) paired up with the ace, leading to soft 13 through soft 18. Depending on the dealer’s up card, these are opportunities to double down, possibly increasing the bet to 4 times the original amount.

Some casinos restrict doubling down on the split hands. In rare cases, one or more of the new cards will match the original pair, possibly allowing further splits. Some casinos restrict this, only allowing a single split. Other casinos prevent resplitting in the case of aces.

Note that the player’s election to split hands is given after any offer and resolution of insurance bets.

Available Bets and Choices

Unlike Roulette and Craps, Blackjack has only a few available bets. Generally, the following choices all involve accepting an offer by creating an additional bet.

  • Ante. This bet is mandatory to play. It must be within the table limits.

  • Insurance. This bet is offered only when the the dealer shows an ace. The amount must be half the ante. Note that the even money offer is an option for resolution of the ante instead of an insurance bet. It is sometimes described as a separate kind of bet, but this doesn’t seem accurate.

  • Split. This can be thought of as a bet that is offered only when the the player’s hand has two cards are of equal rank. Or this can be thought of as a playing option, akin to hitting or standing. The amount of the bet must match the original ante.

  • Double. This can be thought of as a bet that is offered instead of a taking an ordinary hit. Or this can be thought of as a playing option, akin to hitting or standing. The amount of the bet must match the original ante.

Blackjack also offers the player some choices that don’t involve creating additional bets. In the casino these are shown through gestures that can be seen clearly by dealers and other casino staff.

  • Even Money. This resolution of insurance is offered only when the the dealer shows an ace and the player shows 21 in two cards. It is offered instead of an insurance bet. If accepted, the hand is resolved. If declined, the insurance offer can then be accepted or declined.

  • Hit. The player is offered the opporutunity to take another card when their total is less than 21. In this case, they elect to take that card. The hand may reach 21, or go over 21 and bust, or remain below 21.

  • Stand. The player is offered the opporutunity to take another card when their total is less than 21. If they decline the hit, they are standing pat. Their hand remains under 21. The game transitions to the dealer taking cards and resolving the bets.

Play begins with a sequence of offers which can be accepted or declined: insurance, even money resolution of insurance, and splitting a hand. After these offers, the player must select between the three remaining choices (hit, double or stand) for each of their hands with a total less than 21.

In Roulette, there are no additional offers for the player to accept or decline.

In Craps, players may be offered opportunities to activate or deactive point odds bets; we ignored this detail of the Craps game. Adding this interaction to Craps would require defining an additional method for CrapsPlayer to accept or decline an offer. We would also have the CrapsGame interrogate the Table for the presence of come point odds bets, make the offer to the player, and then activate or deactivate the bet for the next throw only. This level of interaction was a nuance we elected to ignore.

Betting Strategies

Because of the complexity of Blackjack, the strategies for play focus on the cards themselves, not on the bets. Some players use a single fixed bet amount. Some players will attempt to count cards, in an effort to determine the approximate distribution of cards in the deck, and vary their play or bets accordingly. The casinos actively discourage counting in a number of ways. The most common way is to shuffle 5 decks of cards together, and only deal the first 150 or so of the available 260 cards. Additionally, they will ask people to leave who are obviously counting.

The player’s responses to the various offers are what defines the playing strategy in Blackjack. The information available to the player is their hand (or hands), and the dealer’s up card. Therefore, all of the strategies for play decompose to a matrix showing the player’s total vs. dealer’s up card and a recommendation for which offers to accept or decline.

Most players will decline the insurance offer, except when they hold a 21. In that rare case the even money offer should be declined, since the expected value analysis of the result shows a slightly better payout by competing against the dealer.

The decision matrix has two parts: accepting or rejecting the split offer, and choosing among hit, stand or double down. The decisions are so well-known, casinos sell pocket-sized reminders with playing strategy in a single, colorful matrix with a letter code for split, hit, double and stand.

Note that each decision to hit results in a new card, changing the situation used for decision-making. This makes the strategy an interesting, stateful algorithm.

A player could easily add the betting strategies we’ve already defined to their Blackjack play strategies. A player could, for example, use the Martingale system to double their bets on each hand which is a loss, and reset their betting total on each hand which is a win. Indeed, our current design permits this, since we disentangled the betting strategies from the individual games in Roll-Counting Player Class.

Looking Forward

Now that we’ve considered the details of the Blackjack game, we’ll need to look at the overall structure of the solution. It’s important to consider how the classes will interact with each other. Each class, in isolation, does very little. The aggregation of those classes will provide the required behavior.

The next chapter will propose an initial set of classes, and some revisions to classes we’ve already written.