Вы находитесь на странице: 1из 95

The following presentation is for entertainment / general

education purposes only and does not represent this


company or any of its views.

The contents of this presentation should not be


interpreted as condoning gambling of any kind.

This presentation is not a replacement for sound legal


advice. If you desire legal advice, you should consult
… well … a lawyer*.

* Let’s be clear about something up front--if you go around getting legal advice from software engineers and something
goes wrong, you have nobody to blame but yourself.
The Math of Blackjack - by Ricky Walker
Most people know about blackjack from pop culture ...
… except there’s usually this part ...

The names of many of the characters and locations in this book have been
changed. Some of the events and characters are also composites of
several individual events or persons.

... which is a euphemism for ...


I filled this book with nothing but lies to make myself look good.
I'm not even remotely sorry.

Throughout this presentation, I will do my best to address common misconceptions with


facts that (I’m pretty sure) are true.
Misconception #1
Card counting requires advanced math.
Misconception #1
Card counting requires advanced math.

Basic probability theory enables you to derive basic strategy. Deriving card a
counting strategy is just an extension of deriving basic strategy.

Card counting involves almost no math and requires nothing more than rote
memorization and practice.
Misconception #2
Casinos don’t want you to know about card counting.
Misconception #2
Casinos don’t want you to know about card counting.

While it is true that casinos try to prevent skilled players from winning, they know
that card counting books and movies tend to increase their blackjack revenue.

The reason is because most players grossly underestimate the frequency and
severity of the errors they make.
Rough Agenda

1. Expected Value and Deriving Basic Strategy

2. The Basics of Card Counting

3. Variance and the Law of Large Numbers


A Simplifying Assumption ...

We will assume that the probabilities of drawing a card is static for the
duration of a hand (a.k.a. -- infinite decks).

For example, if the probability of drawing an ace is (1/13), we assume that


the drawing of an ace will remain (1/13), no matter how many aces are
drawn. *

* Deriving basic strategy without this simplifying assumption is left as an exercise for the reader.**
** (... which is a euphemism for: “I’m not as smart as you think I am. Do the work for me so I can take the credit later.”)
Rough Agenda

1. Expected Value and Deriving Basic Strategy

2. The Basics of Card Counting

3. Variance and the Law of Large Numbers


Expected Value

The long run average outcome from a sequence of random events.

The expected value of a known outcome is just a number


representing the value of that outcome.
Expected value in gambling is always relative to a unitless bet of “1”,
in order to make the following equation true:
Examples (assuming a $2000 bankroll and a $100 bet):
In general, this means:

Good for the Player

Neutral for the Player

Bad for the Player


If we are dealing with a range of possible outcomes:

and probabilities for each outcome:

The expected value of X is the weighted average of the expected values of each
outcome xi :
Example #1

What is the expected value a game where you roll a die and
win the face value of the die if it is 1-5, but lose 6 if you roll a 6?

Because E[X] > 0, you should play this game.


Example #2

What is the expected value of a game where 8 coins are flipped at the same time, and the
following payouts are given:

● If all 8 coins are tails, you are paid 250:1.


● If all 8 coins are heads, you keep your original bet.
● Any mix of heads and tails results in you losing your original bet.

Because E[X] < 0, you should not play this game.


Example #3

What is the expected value of hitting a Hard 8 vs a Dealer’s 4 in Blackjack?


(Why is this so hard?)
Reason #1 Reason #3
Reason #2

Drawing a 10 would give you 18, Drawing a 2 would give you 10, Drawing a 4 would give you 12,
making it obvious to stand ... making it obvious to hit ... making your next move unclear ...

… but the dealer has a 4, meaning the … but this means it is always possible … but our expected value number
dealer will have to draw multiple for the player to need to draw multiple must incorporate all future (and
cards. cards. potentially difficult) player decisions!

Our expected value must account for Our expected value must account for Our expected value must include all of
the dealer drawing a (potentially) the player drawing a (potentially) the player’s future decisions.
large number of cards. large number of cards.
Example #3

What is the expected value of hitting a Hard 8 vs a Dealer’s 4 in Blackjack?

So how to we escape?
(Don’t look at the door)

Answer: Dynamic Programming


Dynamic Programming:

Dynamic programming is a method of solving problems that have two key


characteristics: optimal substructure and overlapping sub-problems.
Optimal Substructure
Optimal substructure means that the solution to a given optimization problem can be
obtained by the combination of optimal solutions to its sub-problems.

Ace 2 3 Ten

...
Overlapping Sub-Problems
Overlapping sub-problems means that any recursive algorithm solving the problem
should solve the same sub-problems over and over.

...
Memoization

Dynamic programming problems are solved using “memoization” which is


nothing more than complicated bookkeeping.

We’re going to build out a table of expected values “backwards” starting


from the end of the game. We choose the order of our calculations carefully
to ensure all sub-problems are solved before they are needed.
First Table:

The expected value ... of standing ... when the dealer has M ...

and the player has N.


...
...
...
...
...
(...do that over and over again…)
If the dealer draws an Ace,
the dealer will have to draw
another card ...

… but it doesn’t matter. We


already know the expected
value when the dealer has 16
vs a player’s 21.

(Just grab existing values like


we did last time)
(...do that for the entire chart…)
We now know the expected value of
standing with every player hand against
every dealer hand.

Cool
Roadmap to the End: Five Tables

Whichever of these 5 tables has the highest EV is the


correct move. Period.

(your “hunch” doesn’t matter)


(winning streaks and losing streaks don’t matter either)
(it also doesn’t matter what “worked” or “didn’t work” last time--the chart is always correct)
Table #2:

Unlike the dealer who plays according to fixed rules, the player can choose
their actions, so we another table to track this complication.

and

The expected value of either hitting or


The same as E[Stand]
standing--whichever is better
(Because if you hit a hard 21 … you lose)
(compare)

Standing gives us the better expected value.


Store that value in E[HS].
Note that we have to fill out and at the same time. The
calculation for shows us why.
Unless the player busts, the player always has a By using E[HS], we are taking
choice between hitting and standing. this into account.
We can now fill out both tables using the exact same steps we just used.
We now know the expected value of standing or hitting for
every hand. Basic strategy is just doing whatever action has
the highest expected value.
Really Cool
By the way … the expected value of hitting a Hard 8 vs a Dealer’s 4:

Now you know.


Table #3:

Although doubling increases our bet, we don’t just do it whenever we have a


positive EV, as assumes we can draw multiple cards.

To correctly calculate, we build two more tables:

and

The expected value of hitting, standing,


The same notation we’ve seen
or doubling--whichever is better
Calculating the expected value of doubling is easy.

We multiply by 2 to account for


our doubled bet.

After doubling, you are required to


stand. This means we pull future
expected values from E[Stand].
...
is trivial:
Table #4:

Compared to the other tables, splitting is a little complicated. Before


looking at why, first we shorten our notation:

* We will pull our expected values from E[HSD] under the assumption that doubling after split is allowed. If this is not
allowed, we just pull expected values from E[HS] instead.
Calculating the expected value of splitting looks the same:

We multiply by 2 since we If we draw any card other than a 2, use a weighted average
have two hands which of the expected values, just as before.
doubles the outcome.
The problem is that when draw a 2, we’re back where we started. We need E[2,2]
in order to calculate E[2,2].

So how can we get the answer without resorting to dark magic*?

(* This is obviously a joke. Of course we’re going to use dark magic.)


Answer: These are like terms. Use basic algebra* to combine and solve.

* dark magic
(First shorten our equation by
combining easy to calculate
values into the constant ‘k’)
To solve … it’s back to grade school ...

Distribute

Subtract 2Pr(2)E[2,2] from both sides

Factor out E[2,2]

Divide by (1-2Pr(2))

Voila.

It’s far from intuitive, but it’s correct.


Finally:

Every hand vs. every dealer card. Not much more to say.
Last:

Finally, we check whether Blackjack has a positive or negative expected


value:

For every dealer / player card Multiply the expected value by the
combination likelihood of that starting hand (1/133)
Last:

Finally, we check whether Blackjack has a positive or negative expected


value:

Because E[X] < 0, you should not play this game.


Rough Agenda

1. Expected Value and Deriving Basic Strategy

2. The Basics of Card Counting

3. Variance and the Law of Large Numbers


Blackjack’s Fatal Flaw

Games of chance are comprised of “independent trials.” In other


words, the system has no memory.
Blackjack’s Fatal Flaw

Blackjack uses of a standard deck of cards. Every time a card is dealt, the
probability distribution changes.

(after 2 is dealt)

... ...

In other words ... the system does have a memory.


Some Background

Basic strategy and card counting were


developed in tandem in the early 60’s by
several people, most notably Edward
Thorp.

Before Thorp published his seminal work Beat the Dealer,


there were several popular strategies for playing
Blackjack--all of which were completely wrong.
Some Background

Because nobody knew the “correct” way to


play blackjack, Thorp discovered that
some casinos were using rules that gave
the player an edge over the casino!

Since the expected value had not been calculated (and nobody knew how to
play correctly anyway), this inversion went mostly unnoticed.
Thorp outlined several counting strategies, but they are
based on the same observation:

High cards favor the player. Low cards favor the dealer.

Card counters leverage this by tracking whether the deck has more high cards
or low cards.
True or False?
Card counting requires you to track every card in the deck.
True or False?
Card counting requires you to track every card in the deck.
False. Not only is tracking every card in your head (probably) impossible, it is also
unnecessary.

Card counting strategies are about looking for favorable situations using the simplest
possible strategy. This involves tracking only one or two numbers.
True or False?
Card counting is illegal.
True or False?
Card counting is illegal.

False. As long as you are not changing the nature of the game, you cannot be arrested for
something you do entirely within your head.
True or False?
Casinos deal with card counters … harshly.
True or False?
Casinos deal with card counters … harshly.
False. MGM Resorts International owns ~10 casinos on the Las Vegas strip and reported
$5.9 Billion dollars in gaming revenue in 2017.

Casinos simply won’t risk losing their gambling license over one player. They will ban card
counters (and have them arrested for trespassing if they return), but that’s about it.
Example: The Hi-Lo Counting System

In Hi-Lo, each card in the deck is assigned a point value:

These points are added together to get a “Running Count.” In this way, we
know the ratio of high cards to low cards.
The problem is that running count does a poor job approximating probabilities:

2 decks 6 decks

Cards dealt: 2-2-2 - 3-3-3 - 4-4-4 - 5-5-5 - 6-6-6

Running Count: +15 Running Count: +15

Not even close...


The Solution? Use the “True Count”

Running Count / Remaining Decks = True Count

+15 / = +7.5 True count is a


good measure of
the high card /
~2 decks
low card ratio.

We can use this to

+15 / = +2.5 make decisions.

~6 decks
How to Use the True Count

The true count is used as a way of approximating how the probabilities of


receiving cards has shifted. Basic strategy is then simply recalculated using
these new probabilities.

The process of converting the true count into probability distributions is


both involved and imprecise. For this reason, we won’t cover it here*.

*Many books have been written about card counting and most of them eschew precise calculations in favor of computer
simulations. Not only is this easier, but usually gets better results as it does not require the use of simplifying assumptions.
Rough Agenda

1. Expected Value and Deriving Basic Strategy

2. The Basics of Card Counting

3. Variance and the Law of Large Numbers


Let’s Play Blackjack! (Sort Of)

Enough theory. Let’s see how things pan out in the


real world.
This green line represents our expected value over time if we play
perfectly. Our outcome should (more or less) follow this line.
Wait … what happened?
Blackjack has a negative expected value. How did we earn money?
Blackjack’s Variance

The problem is that Blackjack has an extremely large variance (~1.3 vs the
expected value of -0.00343).

In fact, blackjack’s variance is so large, that (virtually) nobody


plays enough hands for the expected value to matter …

… except for the casino. Unlike players, the casino does play
enough hands for expected value to matter.
What the casino sees:
Player’s Outcome Casino’s Outcome

This apparent paradox between the player’s experience and the casino’s experience
explains why people will stand in the shadow of a multi-billion dollar casino complex
and swear they made money off the casino.

All gambling games exhibit this behavior.


Soooo … can we tell if we’re winning or losing?

It would be nice to analyze the player’s experience without playing millions


of hands. We can do this, but we need more than just expected value.

What we will do is define regions (a.k.a. cones of uncertainty) in our graph


that will contain 90%, 75%, 67%, 50% of the player’s experiences.
90% of all outcomes will fall within this cone
75% of all outcomes will fall within this cone
67% of all outcomes will fall within this cone
50% of all outcomes will fall within this cone
When we look at our previous outcome …
When we look at our previous outcome …
… we see that we were well within the expected range of outcomes.
The law of large numbers tells us that as the number of hands gets large, the these cones will
converge towards our expected value line. This process cannot be prevented.

This … will become this.


Always.
True or False?
MIT Students in the 1990’s used card counting to win over $1 million.
True or False?
MIT Students in the 1990’s used card counting to win over $1 million.

True! (but misleading). There have been a large number of MIT blackjack teams since
1970, but “The MIT Blackjack Team” is usually a reference to Strategic Initiatives, a
limited partnership founded in 1992 that hired students from MIT and Harvard to count
cards.
How did they do it?

It is wise to be skeptical of anyone who claims to have won substantial


amounts of money counting cards.

The story of Strategic Investments however, is true. (Though the truth


bears little resemblance to what has been portrayed in movies.)

To understand how they succeeded, you have to look at what they did that
was different from what is portrayed in the movies.
Difference #1

Strategic Investments was not an underground club, but rather a legally


incorporated limited partnership.

The students were (in effect) employees, and they treated Blackjack like a job.
Difference #2

Strategic Investments was meticulous. Players were required to fill out


forms describing their playing conditions and outcomes.

The information in these forms was constantly checked to ensure that all
results fell within the expected range of outcomes.
Difference #3

Strategic Investments was large. At its peak, Strategic Initiatives had


almost 80 players, and up to 30 would play simultaneously every weekend at
casinos all over the world.

The managers of SI were well aware of the Law of Large Numbers, and by
utilizing a large number of players, were able to remove much of the
uncertainty one typically experiences when playing blackjack.

If you’re interested in the story of the MIT Blackjack Team, watch the
documentary, Breaking Vegas--The True Story of the MIT Blackjack Team.
Questions?

Вам также может понравиться