Welcome :) Okay this is a bit of a special Mathologer today. A number of you have

requested that I do something on blackjack and card counting so here we

go--how to gamble yourself to fame and fortune. I am being assisted today by

fellow mathematician, longtime colleague and part-time gambler Marty Ross who

is really good at this stuff and who has offered to share some of the

mathematical secrets to coming out on top in gambling games like blackjack.

Okay so let's begin with a couple of puzzles. For the first puzzle suppose

you're looking to bet on roulette. The roulette wheel is numbered from 0 to 37

with 18 red numbers, 18 black numbers and the green 0. So the chances of red coming

up is just under 50/50. Now let's suppose you've been watching the roulette wheel

and of the last 100 spins red has come up 60 times. What should you bet will come

up next: red, black, doesn't matter? Sounds too easy? Well this probably comes as a

surprise but most people get this one wrong. We'll give the answer in a little

while. Our second puzzle actually arises in practice--a standard way that casinos

and gambling sites sucker people into betting. For this puzzle you're given a

$10 free bet coupon. You can use the coupon to place a bet on any standard

casino game: roulette, blackjack, craps, and so on. If your bet wins then you receive

the normal winnings. For example, let's say you bet red on roulette. If red comes

up you win $10, of course. Win or lose, the casino takes the coupon. Now here's the

question: what is the value of this coupon? In other words, what should or

would you be willing to pay for such a coupon? We leave that one for you to

fight over in the comments. But we'll give you a hint: whatever you think the

obvious answer is you're definitely wrong :) Now on with making our fortune.

Famously the mathematician Blaise Pascal sorted out the basics of probability in

order to answer some tricky gambling questions.

When not dropping rocks Galileo also dabbled in these ideas. So if we roll a

standard die, then there's a one in six chance that five will come up, on a

roulette wheel there is a 1 in 37 chance that 13 comes up, the usual stuff. And then

comes in the money. What really matters to a gambler is not only the odds of

winning but of course also how much they get paid if they win. right? And that is the

idea of expectation, the expected fraction of the gamblers bet he expects to win or

lose. As an example, suppose we bet a dollar on red on roulette. We have an 18

in 37 chance of red in which case we win $1. There's also a 19 and 37 chance

of losing $1. And so, if we keep betting $1 on red, on average we expect a loss of

18/37 - 19/37 which is - 1/37th of $1, or -0.03 dollars. What this tells us is

that in the long run we expect to have lost about 3% of whatever we've bet. 37

spins and we expect to have lost about one dollar. 370 spins and we've lost

about $10 and so on. Of course, dumb luck can mean that the actual amount we might

win or lose may vary dramatically. Again, in maths we express all this by saying

that the expectation of betting on red is - 1/37th or minus 3%. As another example,

what if you bet that the number 13 comes up? If 13 comes up we win $35 and

there's a 1in 37 chance of that. There's also a 36 and 37 chance of

losing your dollar and so our expectation comes to 35/37 - 36/37 or -1/37

which as in the first roulette game that we considered is equal to minus 1/37. In

fact, no matter what you bet on roulette, the expectation will always be

- 1/37 give or take some casino variation. Expectation

can vary dramatically on gambling games, from close to 0% on some casino games

down to -40% or so on some lotteries. But, unsurprisingly, the

expectation is pretty much guaranteed to be less than zero and minus means losing. So

far so really really bad :) Hmm what can we do about it? Well a popular

trick is to vary the size of your bet depending on whether you win or lose. The

most famous of such schemes is the so called martingale. This betting scheme

works like this: as before let's bet on red in roulette and let's start by

betting $1. If red comes up you win $1 and you repeat your $1 bet. If red does

not come up you lose your dollar. To make up for your loss you play again

but this time with a doubled wager of $2. If red comes up you win $2 which

together with the $1 loss in the previous game amounts an overall win of

2 minus 1 is equals $1. So you've won, so you go back to betting just $1. On the other

hand, if red does not come up you lose your $2 which then adds up to a total

loss of 2 plus 1 is 3 dollars. You've only lost so far so you play again, but this

time with a doubled wager of $4. If red comes up you win $4 which together with

the $3 loss so far means that overall you've won $1. You've won and so you

revert to betting just $1. On the other hand, if red does not come up you lose

your $4 which then adds up to a total loss of 4 plus 3 equals 7 dollars. So far you've

only lost so you play again but this time with a doubled wager of $8, etc. So

basically you keep doubling your bet until your bad luck runs out at which

time you start from the beginning by betting $1 next then keep doubling your

bet again until you win, and so on. As long as you stop playing

after some win, this betting strategy seems to guarantee you always coming out

on top overall. There are many such betting schemes the d'Alembert

the reverse Labouchere. Apparently these schemes work much better if they have

fancy French names, believe it or not. But do bet variation schemes work?

Probability questions like this one can be tricky, depending in a subtle way on

our assumptions. The martingale, for example, obviously works if you happen to

have infinitely dollars in your pocket. But then why bother gambling? And, of

course, whatever you do you can always get lucky but with a finite amount of

money in your pocket, what can we expect to happen? Well, suppose we make a

sequence of bets with the same expectation for each bet, as in the setup

we just looked at. Then the total amount we expect to win or lose is easy to

calculate. It's just E times that positive number there and if E is

negative then uhoh no luck. That brings us to the fundamental and very depressing

theorem of gambling. The theorem says that if the expectation is negative for

every individual bet then no bet variation can make the expectation

positive overall. Damn ! :) Okay, so we're not going to get rich unless we somehow find

a game with positive expectation. For the moment, let's just assume that such a

game exists. How well then can we do? Suppose we're betting on a casino game

for which the chances of winning are 2/3 and therefore a chances of losing are 1/3.

Let's also assume that just like in betting on red in roulette you win or

lose whatever amount you bet. Then the expectation for this game is actually

positive. To be precise it's a whopping 33%. Now such a huge positive expectation

in the casino game is clearly a fantasy. But bear with us. Ok, suppose we start with

$100. What are the chances of doubling our money to $200? Well, obviously, if we

just plunk it all down in one big bet of $100 then the chances of doubling are,

well, 2/3, of course. This may come as a surprise but we can actually improve our

chances if we bet $50 at a time and we play until we are either bankrupt or we have

doubled our money. Let's do the maths. If we place bets of

fifty dollars, after one bet, win or lose, we either have 150 or 50 dollars. And

after two bets we have $0, $100 or $200. Now, reading off the tree, we see

that at this point the probability of having doubled our money in the first

two plays is 2/3 times 2/3 which is equal to 4/9. And, similarly, the

probability to be back to where we started from with $100 is, well, 2/3

times 1/3 plus 1/3 times 2/3 which happens to also be 4/9. But if we're back

at $100 we can keep on playing until eventually we have doubled our money or are

bankrupt. It can actually take it while before this is sorted out, right? Now if

D are the chances of eventually doubling our money in this way, then D is

equal to what? Well, 4/9 the probability of having doubled our money after two

bets plus the second 4/9 the probability of being back where we started from

times the probability to be able to double from this point on. And what is

that? Well we're back to $100. So the probability is D again. It's

actually quite a nifty calculation when you think about it. Anyway, now we just

have to solve for D and this gives that D is equal to 4/5 which is 80%. And this

is definitely a lot better than 66% that going for just one bet of $100

guaranteed. Repeating the trick, we can consider betting 25 dollars at a time.

This results in an about 94% chance of doubling our money. In fact, by making the

bet size smaller and smaller we can push the probability of us eventually

doubling our money to as close to certainty as we wish and once we've

doubled our money, why not keep on playing to quadruple, octuple, etc. our

money. And since we can push the probability of doubling our money as

close to certainty as we like, the same is then also true for

of those more ambitious goals. Even better the same turns out to be true no

matter what probabilities we're dealing with. As long as the expectation of the

game we play is positive, as in the game that was played. The very surprising

conclusion to all this is our second very encouraging theorem of gambling. So

here we go. If the expectation is positive, then we can win as much as

like, with as little risk as we like, by betting small enough for long enough. And

so, finally, a bit of very good news, right? Alright, so all that's holding us back

from fame and fortune is finding a game of positive expectation. For that, of

course, we again turn to the game of roulette.

.. Just kidding :) and we'll get back to blackjack in a minute. But there are

many approaches to gambling and one factor to keep in mind is that games

like roulette are mechanical which means that the true odds aren't exactly what the

simple mathematics predicts. Is this sufficient to get an edge on the game?

Well I won't go into that today but in the references you can find some

fascinating stories of people who have tried to and occasionally succeeded in

beating a casino in this way and such attempts continue to this day.

And with that in mind, we'll now answer our roulette puzzle from the start. So if

60 of the last 100 spins have turned up red, then you should most definitely

bet on red. Of course, feel free to disagree vehemently in the comments. Ok

so finally on to making our fortune at blackjack, a possibility made famous in

the Kevin Spacey movie 21. Well Kevin's out of favour, now so should watch The

last casino instead, it's a much better movie anyway.

For this video we don't really have to worry too much about the rules of

blackjack, so here's just a rough sketch. Now blackjack is played with a standard

deck of 52 cards or nowadays a number of such decks. The goal is to get as close

to 21 without going over. All face cards count as ten, the aces

count as 1 or 11 the player can actually choose whichever works better

for them. In blackjack you're playing against the dealer. You're initially dealt

two cards and the dealer just one, all face-up for everybody to see. You go

first. You can ask for more cards one at a time

until you either bust which means you go over 21 in which case you lose

immediately or you stop before this happens. Then it's the dealer's turn who

will deal herself cards like a robot until she hits 17 or above and then

stops. The person closest 21 without having gone bust wins. The casino's edge

comes from you the player having to go first

knowing only the dealer's first card. So if you bust by going over 21 then you

lose immediately even if the dealer later busts as well. There are however some

compensating factors that favor the player including the ability to make

decisions such as when to stop receiving cards and whether to "split" or to "double".

We won't go on to this. Actually the ability to make decisions only favors

the player if they know what they're doing which is actually hardly ever the

case :) The fundamentals of optimizing blackjack play involve knowing what

decisions to make given any total of your cards and whatever the dealer's

card and this is known as "basic strategy" and was actually first figured out in

the 1950s by some army guys playing with their new electronic calculators. The

basic strategy can be summarized in a table which all expert players know by

heart. Here's a simplified version. Let's use it. At the moment our cards add up to,

well, 10 for the queen plus 5, that's 15, so look up 15 on the left side. The

dealer has 8 and so the basic strategy tells us that we should "hit" which means

ask for another card. Let's do that. Now we've got 19 and this means that the

basic strategy tells us to stand or stop which of course makes total sense at

this point in time. Figuring out the basic strategy just

involves a lot of easy probability tree diagrams and stuff like that. Casino rules

can differ which then changes the basic strategy slightly as well as the

resulting expectation but in a not too nasty casino the expectation,

given optimal play this way, might be about -0.5%. Close but no

banana. Of course plenty of people do worse than

that. Casinos play their cards close to their

chests but it seems that on average the casinos make well over 5% on blackjack, a

clearly better rate of return for the casino than on roulette. Anyway, if we

want to make our fortune we have to somehow get around that -0.5% and that's where card counting comes in.

Card counting arose in the

early sixties, courtesy of mathematician Edward Thorp and the fundamental idea is

very easy. Basic strategy assumes that any card has an equal likelihood of

appearing next. Well it's a fairly natural assumption to make if there's NO

other information to be had but of course there IS other information to be

had as cards get dealt the probabilities change. In general, high cards are better

for the player and low cards are worse. Then, as the cards are dealt out, the

expectation changes and the expectation will be positive if sufficiently many low

cards are dealt. That sounds like a lot of information to keep track of but

counting simplifies it all down to keeping track of just one number called

the running count. Every time the cards are shuffled the running count resets to

0. After the shuffle whenever you see a low card you add one to the running

count. Whenever you see a high card you

subtract one. Otherwise you don't do anything. The running count indicates how

many extra high cards there are among the cards left to be dealt. Keeping track

of the the running count may seem tricky to do in a casino with all the cards

zipping around on the table but it's actually pretty easy watching a blackjack table for about an hour most people can keep track

of the running count pretty accurately. There are also plenty of apps around

like that one there if you want to practice in the safety of your home or

you can just get a plain old deck of cards. Now were any of you fast enough

to keep track of the running count just now, over there. I showed this

one to Marty cold and he just had it straight away. Anyway what we really want

to know is not the number of extra high cards left to be dealt but the fraction

of extra high cards remaining. For example five extra high cards matter

much less if they're within three decks left to be played than if there's only

one deck left to be played. To account for this we simply take the running

count and divide by the number of decks left to be dealt. This number is called the

true count and here's the surprisingly simple formula that relates the true

count to the expectation at the given point of the game and this formula

contains some really good news. A true count of two or greater means that our

expectation is positive, right two minus one is positive. A true count of plus ten

which can easily happen just before the shuffle means the expectation is 4.5%

which is pretty amazing. So what does the card counter do? Well, ideally, she bets

little or nothing when the true count is negative, makes small bets if the true

count is slightly positive and then larger bets when the true count is

higher. The bad news is that betting in such a manner involves a lot of boring

waiting around followed by frantic and really really

suspicious betting perhaps hundreds of dollars on a few brief hands. How well

does it work? Well these days a typical betting scheme going up to say a maximum

bet of 200 dollars might result in an average of about 15 dollars an hour.

Wow, hmmm not what I would call a great hourly pay. And it gets worse, the result

in any given hour can differ massively. You can expect a standard deviation, a

typical plus or minus to be about $500. Of course the way card

counters bet makes them very easy to spot and Marty has had his run-ins with

casinos. So unless you're part of a well drilled team of counters and players or

you're really good at disguises there's a fair chance you get to meet some burly

casino employees within a few short hours. Well we did say blackjack is a

way to win a SMALL :) fortune. Good luck happy gambling and that's all

for today ... Except we've all heard that back in the 70s there were lots of

people making millions of dollars playing blackjack in the casinos. So what

has changed? Why can't we make millions of dollars these days. (Marty) well the casinos

have gotten a lot more careful and a lot smarter: they use more decks which

means the running count matters less, the true count is slower to get going, they

use automatic shuffling machines, they really are on the lookout for suspicious

betting. So unless you're incredibly good at disguising yourself, incredibly good at

team playing, it's pretty much dead. (Burkard) It's dead, that's sad but what about other games? There's

online gambling now so are there other ways to make money with gambling these days.

Absolutely yeah the casino is always looking to sucker more people into

betting and suckering old people into betting more more, so there's always

promotions, there's new games, new rules, some are knowingly have expectation

which is positive and they just watch out, others the casino makes mistakes or

online betting sites make mistakes. So you do a little expectation calculation

and often not always but often you can find a little edge and enough of these

little edges and you can make a nice little profit on the side and definitely

there's some people who just computerized everything, calculate to the

nth degree and there's some secret people I'm sure who are doing very very

well. All right. Well that's a perfect lead-in to our next video, at some point.

Anyway thanks Marty for coming today. Thank you and we'll have you again soon.