123 Street Avenue, City Town, 99999

(123) 555-6789

email@address.com

 

You can set your address, phone number, email and site description in the settings tab.
Link to read me page with more information.

Blog

Will Moyle's personal blog

Blackjack - The House (almost) Always Wins

Will Moyle

The house always wins.

That’s the first rule of gambling. It’s the reason why one casino in Las Vegas made over half a billion dollars of profit in 2014 and why I have historically steered clear of the roulette table. However, is this always the case?

Such lovely smiles... what a fun way to eventually suffer the inevitable wrath of probability

Such lovely smiles... what a fun way to eventually suffer the inevitable wrath of probability

A couple of weeks ago, I decided to look into my favourite way to lose money, Blackjack. I wrote a program using Python (which you can find on my GitHub page) that allowed me to automate the game and run a set number of simple strategies many times to analyse which (if any) would give me the best chance of leaving a casino with cash still in my pocket.

I’m not talking about counting cards in this case. Not many people can do that (I certainly can’t) and it’ll get you kicked out of the casino pretty quickly. It does make for good movies, though. For the sake of this project, I was looking for very simple strategies that should, eventually, leave a player with more money than they started with.

I’m not going to go into the rules in much detail (you can find a very good description here) but the key points are these:

  • The aim of the game is to beat the dealer by holding a hand of cards worth closer to 21 than the dealer but not over
  • Aces are worth one or eleven points
  • Jacks, Queens and Kings are worth ten points
  • All other cards are worth their number (e.g. three of clubs is worth three points)
  • Players start with two cards and can either choose to stand (settle for the total value of their hand) or hit (add a new card to their hand)
  • If the player’s hand is worth 21 initially (with an ace and a card worth ten points) then the player has a ‘blackjack’ and will typically win back 1.5 times her initial bet
  • Once the player has stood or gone bust (i.e. has a hand worth over 21) then the dealer plays
  • The dealer is required to play by a given strategy
  • Depending on the casino, the dealer must either stand on a Soft 17 (i.e. a hand worth 17 points with the ace counting as eleven, designated s17) or only stand when he reaches a Hard 17 (i.e. a hand worth 17 points with the ace counting as one, designated h17)

The last rule is a bit complicated, but makes a big difference (you can find more information here).

There are many variations to the game, but these are the rules that I decided to model. The strategies that I implemented were relatively straight forward: the player hits until he reaches a given limit (from 12 up to 21, depending on the strategy). These, in turn, were modelled for either a hard limit or soft limit.

For example, given the limit of 15, I modelled four separate scenarios:

  • Playing a game with s17 rules, the player stands when she achieves a 15 including an ace counted as one (i.e. Hard 15, or h15)
  • Playing a game with s17 rules, the player stands when she achieves a 15 including an ace counted as eleven (i.e. Soft 15, or s15)
  • Playing a game with h17 rules, the player stands when she achieves a 15 including an ace counted as one (h15)
  • Playing a game with h17 rules, the player stands when she achieves a 15 including an ace counted as eleven (s15)

I simulated a total of 4 million games, 1 million for each scenario, evenly spread for 10 limits from 12 to 21.

The percentage of wins never surpassed 46%. However, given that winning with a blackjack gives a 1.5 multiplier bonus, there were a few scenarios that meant that the player could leave the casino without being in debt to some nasty people. The formula for overall winnings is:

winnings = number_of_games * bet_per_game * [percentage_wins - percentage_losses + percentage_blackjacks * (multiplier - 1) ]

The chart below shows expected winnings for the different strategies (after playing 100 games betting $10 per game)

Notice there are a lot of negative numbers there!

Notice there are a lot of negative numbers there!

As you can see, after putting $1000 at risk, the best case scenario has the player expecting to leave with a grand total of $18… maybe enough for the cab ride home. Still, this experiment has at least allowed me to conclude the following:

  • If the dealer must stand on Hard 17 (h17), then the best simple strategy is to stand on a Soft 14
  • If the dealer must stand on Soft 17 (s17), then you’d be better off leaving the $1000 under the mattress, as you should expect to lose (although to minimise your loss, play s15, you'll only lose $12)

I had a lot of fun with this, so I think I’m going to dig a little deeper, perhaps finding the best scenario that takes into account the number of decks being used or the dealer’s face up card - so look out for that post in the near future.

Until then, gamble responsibly… or better yet, not at all - it's probably not worth it.