## Saturday, February 22, 2014

### Gambler's Ruin Problem Part 4: Odds in Video Poker

Click here to see part 1 of this four week series.
Click here to see part 2 of this four week series.

Suppose that you find yourself in a city with a casino and you have \$60 in your pocket. There is a concert in town that you really want to see, but the tickets cost \$100. You decide that you will place \$1 bets until you either reach \$100 or go broke. Which casino game should you play? How likely are you to reach your goal of \$100?

This week is the final week in my series on the Gambler's Ruin Problem, which I have explained again in the paragraph above. We have analyzed roulette, craps, and blackjack, finding out various odds, expected values, and success probabilities. Here is what we have so far:

GameAvg Gain Per \$1 BetP of Reaching \$100
Favorable Game (51-49 odds)92.6%
Fair Game (50-50 odds)60%
Blackjack-0.5¢47.8%
Craps-1.4¢28%
Roulette-5.3¢1.3%

Let's see how video poker fairs. I chose not to do Texas Hold'em or another popular version of real poker because there is so much strategy involved, and determining a universal statistic is near to impossible. If you are also considering reading players, pot odds, and the occasional bluff, it becomes extremely complicated. However, video poker is another game that is you against the house and can be played with a more concrete strategy like blackjack. Let's go over the rules.

As you can see in the picture, video poker is pretty much a slot machine, except it gives much better odds. The game of poker played on it is five card draw. The player is given five cards to start. They then are given the opportunity to either keep them all, get rid of one, get rid of two, get rid of three, get rid of four, or get rid of all of them. The cards they got rid of are then replaced, and the hand they have left is identified and the proper money exchange is made. If you are unfamiliar with the poker hands, click here. This is the list of odds the casino gives for each hand:

Royal Flush - 250:1
Straight Flush - 50:1
Four of a Kind - 25:1
Full House - 9:1
Flush - 6:1
Straight - 4:1
Three of a Kind - 3:1
Two Pair - 2:1
Pair of Jacks or Better - 1:1

As you can see, the rarer the hand, the bigger the payoff is. This creates the difficulty in choosing which cards to hold and which to discard in any given turn.

I will start by just going through the basic strategy. Then, we will look at some of the exceptions and why they are encouraged.

1. With two pair or higher, keep the cards needed for the hand and discard the rest (for instance, draw one card in a two pair, don't draw any in a flush)
2. With one pair, keep the pair and discard the rest
3. With no high cards, discard all five
4. With one high card, keep it and discard the rest
5. With two high cards, keep them and discard the rest
6. With three or four high cards, keep two. If there are two of the same suit, keep them. Otherwise, take the two with the lowest value.

Pretty simple when it comes to poker strategy. That one won't take up an entire book. Now let's look at some exceptions. The first one is the following:

If four cards are in a straight flush, discard the fifth one (but don't break a straight or flush unless it can become a royal flush)

For instance, take the following example:

7C  8C  9C  JC  JD

In this hand, the basic strategy would say to discard the seven eight and nine, but this exception tells us to discard the jack of diamonds. Let's see why. There are 52 cards in a deck, and five have been used in this hand. So, the remaining possibilities to take the place of the jack of diamonds should total 47.

Here are the possible hands and their probabilities:

P(Straight Flush) = 1/47
P(Flush) = 8/47
P(Straight) = 3/47
P(2 Jacks) = 2/47
P(Nothing) = 33/47

EV(Discard JD) = (1/47)(50) + (8/47)(6) + (3/47)(4) + (2/47)(1) + (33/47)(-1) = 79/47 ≈ \$1.68

And here are the possible hands and their probabilities for keeping the jacks:

P(4 of a Kind) = (3 ways of choosing)(2/47 third jack options)(1/46 fourth jack options) = 3/1081
P(Full House) = (3 ways of choosing placement of third jack)(2/47 third jack options)(46/46 • 3/45 pair options) + (12 value choices of three of a kind)(4/47 first cards)(3/46 second cards)(2/45 third cards) = 62/5405
P(3 Jacks) = (3 ways of choosing placement of third jack)(2/47 third jack options) = 6/47
P(2 Pair) = (3 ways of choosing)(47/47 • 3/46 pair options) = 9/46
P(2 Jacks) = 1 - P(4 of a Kind) - P(Full House) - P(3 Jacks) - P(2 Pair) = 7161/10810

EV(Keep Jacks) = (3/1081)(25) + (62/5405)(9) + (6/47)(3) + (9/46)(2) + (7161/10810)(1) = 17397/10810 ≈ \$1.61

As you can see, keeping the jacks has less of a payoff than this exception. It isn't a huge difference, but still one to take note of.

Here are some other exceptions:

If you have four cards in a flush, go for the flush.
If you have three cards in a royal flush, go for the royal flush.
If you have an open-ended straight, go for the straight.
If you have three straight flush cards, go for the straight flush.
If you have J 10 suited, Q 10 suited or K 10 suited, keep the 10 in addition to the high card.

All of those exceptions could be proven with the probability techniques. Using this strategy, you will have very similar odds to blackjack with about a 0.5¢ loss per turn. Most players will lose 4¢ per turn, so this puts us way ahead of the game.

GameAvg Gain Per \$1 BetP of Reaching \$100
Favorable Game (51-49 odds)92.6%
Fair Game (50-50 odds)60%
Blackjack-0.5¢47.8%
Video Poker-0.5¢47.8%
Craps-1.4¢28%
Roulette-5.3¢1.3%
Average Vegas Slot Machine-6.6¢0.5%

I added an average for Vegas slot machines onto the bottom of our table just to give a taste as to how bad their odds are. Of course, each slot machine varies and I'm not sure how accurate the information I found was for them. But the odds for the games we discussed are all completely based on mathematics and are a lot of fun to play around with. If you play other games in the casino, I'm sure you can determine all of the same information for the Gambler's Ruin Problem and looking for optimal strategy.

So what's the answer to the Gambler's Ruin Problem? I don't know. We took a close look at many different games, but we can never have enough information to have a solid answer. There are dozens of different games and bets out there, many of whom can't be completely analyzed with probability and game theory. But this problem is a gateway to having fun with numbers and probability to make yourself a better player at the casino and learn a bit about mathematics. I hope some of the things we've learned in the last month become useful to you next time you have sixty bucks in a city with a casino.

## Saturday, February 15, 2014

### Gambler's Ruin Problem Part 3: Odds in Blackjack

Click here to see part 1 of this four week series.

We spent the last two weeks talking about the Gambler's Ruin Problem and how it is a gateway to analyze different games like craps and roulette. Here is a refresher of what we have discovered so far, as well as what the Gambler's Ruin Problem is:

Suppose that you find yourself in a city with a casino and you have \$60 in your pocket. There is a concert in town that you really want to see, but the tickets cost \$100. You decide that you will place \$1 bets until you either reach \$100 or go broke. Which casino game should you play? How likely are you to reach your goal of \$100?

And here were the probabilities we found for all bets in roulette, the pass line bet in craps, and the other two control statistics.

GameAvg Gain Per \$1 BetP of Reaching \$100
Favorable Game (51-49 odds)92.6%
Fair Game (50-50 odds)60%
Craps-1.4¢28%
Roulette-5.3¢1.3%

We found that roulette is a game of minimal strategy; each bet had the same expected value. Craps is a more difficult game because of the many different bet options each with different perks and odds, but players still don't have to worry about utilizing strategies on the fly. Blackjack starts to get into some more complicated strategy building.

Though there are other players at the table, like craps and roulette, blackjack is a game of you against the house (which is represented by the dealer). You will receive two face up cards and the dealer will receive one face up and one face down card. The sum of the numbers on the card is what your total is (J = 10, Q = 10, K = 10, A = 1 or 11). For instance, K 2 would be 12, 9 7 would be 16, A 5 would be 6 or 16. Hands with an ace counting for eleven are called soft hands because they are easier to work with; they can be lowered by ten at any time if need be.

Once you get your two hands, the dealer will ask if you want to "hit" or "stand." Hitting is when you take another card and add it to your total. Standing is when you do not take any more cards and your hand becomes final. If you hit and your total goes over 21, you "bust" and lose your bet.

Once everyone at the table stands or busts, the dealer then turns over his facedown card. He then must hit until his total is 17 or above. Once he gets to there, he must stand. You then lose your bet if his/her total beats yours and you get even money (1:1) if you beat his/her total.

When you get 21 with just two cards (A K, A J, etc), your hand is called blackjack. As you can see on the table above, blackjack pays 3:2 instead of just 1:1. This is one of the perks that you have as a player; the dealer cannot request that you pay him extra because he got blackjack.

As a player, you also have a few additional betting options that I will explain below.

Doubling Down is when you double your bet on the table and agree to only take one more card. With certain types of starting hands, you can increase your payoff in this way.

Splitting is only allowed when you have two cards of the same number. You can "split" the cards, put a second equal bet on the other card, and play both hands simultaneously against the dealer. Most casinos let you re-split cards, but rarely do they let you double down after splitting.

Taking Insurance is only allowed when the dealer's face up card is an ace. You can bet up to half of your original bet that the dealer's facedown card is a 10, J, Q, or K. This bet pays 2:1, as depicted on the table above.

Blackjack doesn't have to deal with as many weird ratios and random bets as craps does, but developing strategy becomes more difficult because of this. Aside from taking insurance, it is all just inflicting different probabilities into a lone 1:1 bet. But how can we optimize our odds on this 1:1 bet?

When you think about it, it seems like you have a pretty big advantage over the dealer. You can stand before 17, hit after 17, split, double down, take insurance, and get paid 3:2 on blackjack. How do the casinos make money? Well, there is one thing that the dealer has an advantage on, which doesn't even cross our minds. Every time you bust, you lose. Even if the dealer busts. This one advantage is what makes blackjack worth it for the casinos.

This doesn't mean that we can't try our best though. A beginner might just make random bets based on intuition, but more experienced players are able to get their odds much closer to 1:1. Let's start with looking at when to hit or stand. First, hard hands:

Dealer's Up Card Hit Until You Reach
7, 8, 9, 10, A 17
4, 5, 6 12
2, 3 13

So let's say your starting hand is 7 2 and the dealer is showing a 3.

7 2
? 3

Your total is nine, and you hit until you reach 13. So you hit.

7 2 2
? 3

Now your total is eleven, so you must hit again.

7 2 2 K
? 3

Now your total is 21, and you obviously would stand here.

7 2 2 K
5 3 J

You win! Great job. That guideline is probably the most basic part of the strategy, and will come into play in almost every round. If you memorize any of the strategies I discuss here, that is the one to remember.

That was for hard hands (without an ace acting as an eleven). What about soft hands?

Dealer's Up CardHit Until You Reach
9, 10, ASoft 19
8 or belowSoft 18

Let's try it.

A 5
? 9

Our strategy says we should hit.

A 5 7
? 9

Now we have a hard hand of thirteen, so we must switch back to the hard hand strategy and hit until we reach seventeen.

A 5 7 4
? 9

This is one of the most debated parts of blackjack. We have a hand totaling sixteen and we need to hit or stand. Many players are conservative and choose to stand here. However, we know that probability tells us to hit. You could map out all of the possible outcomes of this hand for yourself and the dealer and compare them, and you would find that hitting actually does end up giving you more success.

A 5 7 4 Q
? 9

And you busted.

A 5 7 4 Q
K 9

But you would have lost anyways, so hitting was worth a try on that one. Now let's look at double down and splitting strategies.

Your First Two CardsDouble if Dealer Has
Total 1110 or below
Total 109 or below
Total 94, 5, 6
A2 through A74, 5, 6

When do you splitIf Dealer Has
A, 8any card
4, 5, 10never
2, 3, 6, 72, 3, 4, 5, 6
92, 3, 4, 5, 6, 8, 9

Those are for doubling down and splitting. What about taking insurance? This is the easiest rule of them all.

Don't take insurance

Ever. Let's look at why. The dealer's face down card could be any of the following:

A  2  3  4  5  6  7  8  9  10  J  Q  K

There are nine cards that don't win you the bet and four cards that do. So, the fair odds for the casino to offer would be 9:4. But, they only offer 2:1 or 8:4, meaning that insurance is not worth it (unless you are a card counter).

If you figure out the expected value of your \$1 bet incorporating all of these strategies, you end up getting an average loss of 0.5¢. This is much better than craps and roulette! These are the best odds we have seen so far!

GameAvg Gain Per \$1 BetP of Reaching \$100
Favorable Game (51-49 odds)92.6%
Fair Game (50-50 odds)60%
Blackjack-0.5¢47.8%
Craps-1.4¢28%
Roulette-5.3¢1.3%

These odds are not bad. In fact, we are not far from having a 50-50 shot of turning our \$60 into \$100!

This strategy is great. But what I always wonder is why it works. Why do we hit on sixteen if the dealer has a seven showing? Let's figure it out.

First, we determine the dealer's odds of busting with a seven. To do this, we start with the odds of busting with sixteen (the dealer won't bust if they get to seventeen because they are required to stand). This is a sum of their odds of getting a 6, 7, 8, 9, or 10 as their next card value (remember that 10 can be achieved four ways).

P(bust with sixteen) = P(6) + P(7) + P(8) + P(9) + P(10)
P(bust with sixteen) = 1/13 + 1/13 + 1/13 + 1/13 + 4/13
P(bust with sixteen) = 8/13 ≈ 0.615

Now, we can determine the odds of busting with a fifteen. They could either hit and get a 7, 8, 9, 10, or an ace followed by a bust.

P(bust with fifteen) = P(7) + P(8) + P(9) + P(10) + [P(A) • P(bust with sixteen)]
P(bust with fifteen) = 1/13 + 1/13 + 1/13 + 4/13 + [1/13 • 8/13]
P(bust with fifteen) = 99/169 ≈ 0.586

We could then figure it out for busting with a fourteen. They could either hit and get a 8, 9, 10, ace-bust, or two-bust.

P(bust with fourteen) = P(8) + P(9) + P(10) + [P(A) • P(bust with fifteen)] + [P(2) • P(bust with sixteen)]
P(bust with fourteen) = 1/13 + 1/13 + 4/13 + [1/13 • 99/169] + [1/13 • 8/13]
P(bust with fourteen) = 1217/2197 ≈ 0.554

This process can be continued until you get to the probability of busting with a seven, which ends up being around 0.262. All of the probabilities of the dealer's outcomes with certain face up cards are on the table below:

So the chances of our sixteen beating the dealer's seven if we stand is 0.262; the only way we would win is if the dealer busts. If we hit, then we have a good chance of busting but also a chance of getting a number between 17 and 21, each with their own chance of winning.

P(win with an A) = P(dealer busts) + ½P(dealer gets 17)
P(win with an A) = 0.262 + ½(0.369)
P(win with an A) = 0.447

P(win with a 2) = P(dealer busts) + P(dealer gets 17) + ½P(dealer gets 18)
P(win with a 2) = 0.262 + 0.369 + ½(0.138)
P(win with a 2) = 0.730

P(win with a 3) = P(bust) + P(17) + P(18) + ½P(19)
P(win with a 3) = 0.262 + 0.369 + 0.138 + ½(0.079)
P(win with a 3) = 0.809

P(win with a 4) = P(bust) + P(17) + P(18) + P(19) + ½P(20)
P(win with a 4) = 0.262 + 0.369 + 0.138 + 0.079 + ½(0.079)
P(win with a 4) = 0.886

P(win with a 5) = P(bust) + P(17) + P(18) + P(19) + P(20) + ½P(21)
P(win with a 5) = 0.262 + 0.369 + 0.138 + 0.079 + 0.079 + ½(0.074)
P(win with a 5) = 0.963

P(win with a 6, 7, 8, 9, 10, J, Q, K) = 0

Now that we have all of this, let's do an expected value equation to see what our average odds are.

EV(hit on 16) = (1/13)(0.447) + (1/13)(0.730) + (1/13)(0.809) + (1/13)(0.886) + (1/13)(0.963) + (8/13)(0) = 0.295

So hitting on 16 gives 0.295 odds while standing gives 0.262 odds. And surprisingly enough, the hitting odds do end up better. Yes you are likely to bust when you hit, but it is better than banking on the worse odds of the dealer busting. The strategies for all of the other things can be derived in similar ways.

Next week, we will complete our series on the Gambler's Ruin Problem and see if video poker can offer odds as good as blackjack.

## Saturday, February 8, 2014

### Gambler's Ruin Problem Part 2: Odds in Craps

This week is week two in a four week series on the Gambler's Ruin Problem. Unlike my series on the proof to Bertrand's Postulate, this one can be started in the middle if you have an understanding of some elementary probability concepts like expected value. It will take away some of the initial surprise when faced with the probability of success in previous games, but it is not like Bertrand's Postulate where I am recalling or building upon information that was developed in an earlier post. They are all very separate pieces of information that can be understood on their own or together as an attempt at the Gambler's Ruin Problem.

The idea of the Gambler's Ruin Problem is simple. Here is the problem if you have forgotten it:

Suppose that you find yourself in a city with a casino and you have \$60 in your pocket. There is a concert in town that you really want to see, but the tickets cost \$100. You decide that you will place \$1 bets until you either reach \$100 or go broke. Which casino game should you play? How likely are you to reach your goal of \$100?

Last week, we discovered that roulette loses on average 5.3¢ per dollar bet, which gives you a shockingly low 1.3% chance of reaching your goal of \$100.

Game Avg Gain Per \$1 Bet P of Reaching \$100
Favorable Game (51-49 odds) 92.6%
Fair Game (50-50 odds)
60%
Roulette
-5.3¢
1.3%
Note: I added a 51-49 "favorable game" and its statistics. This was not discussed last week, but it is more informative for our needs than a 100% probability game like we discussed last week. It has a 2¢ average gain and a 92.6% success probability.

We have found all of the necessary data with roulette, and odds didn't look great. So let's try another game. This week we will look at craps, which is one of the most popular casino games involving dice.

The rules of craps take a couple minutes to remember in its entirety, but are pretty easy to understand.  This explanation comes from bigmcasino.com, which laid them out very well.
The players take turn rolling two dice. The player that is rolling the dice is considered the shooter. The shooter MUST bet at least the table minimum on either the pass line or the don’t pass line.
The game is played in rounds consisting of two phases: come out and point.
Come Out – to start a round, the shooter makes a “come out” roll
If the come out roll is a 2, 3, or 12, then the round ends. The rules of craps state that the shooter is said to “crap out” and players lose their pass line bets.
If the come out roll is a 7 or 11, this results in a win for pass line bets.
The shooter continues to make come out rolls until he rolls 4, 5, 6, 8, 9, or 10. This number becomes the point and in turn the point phase begins.
Point – during this phase, if the shooter rolls a point number then it’s a win for the pass line bets. If the shooter rolls a seven, it’s a loss for the pass line bets and the round is over.

There are many different bets that can be made in craps, but each can be analyzed through probability. I don't have nearly enough time and energy to go through them all, but I will discuss a few.
The most common craps bet is the pass line bet. This is the one discussed in the rules that wins on a seven, eleven, or the roll of the point number. To figure out its odds, we can just create a table of percentages for each of the eleven possible dice totals, determine the probability of winning the pass line bet, and perform an expected value equation like we mastered last week.
Come Out Roll Odds for Pass Line
2 0
3 0
4
5
6
7 1
8
9
10
11 1
12 0

I have already put in the ones that we know from the craps rules. The other six become point rolls and need to appear before a seven. Here are the possible roll totals from two dice:

Let's start with determining the odds for four. There are three ways to roll a four, six ways to roll a seven, and twenty-seven ways to roll something else. To determine the odds of success with a four, there are a few different methods. We will use a more logical method the first time, and then discover a quicker method to figure out the rest.

To roll a four before a seven, you must add up the probabilities of rolling it on the first try, rolling something other than a four/seven on the first and a four on the second, rolling something else on the first two and a four on the third, and so on.

Rolling a four on the first try would be simply 3/36. Rolling something else on the first try (27 possibilities) and a four on the second try, the odds would be (27/36)(3/36). Rolling something else the first two times and a four on the third would be (27/36)(27/36)(3/36), or (27/36)2(3/36). Rolling something else on the first three times and a four on the fourth would be (27/36)(27/36)(27/36)(3/36), or (27/36)3(3/36). This pattern will continue forever.

Adding this infinite series up will give the following:

3/36 + (27/36)(3/36) + (27/36)2(3/36) + (27/36)3(3/36) + (27/36)4(3/36) + ...
(3/36)(1 + 27/36 + (27/36)+ (27/36)+ (27/36)+ ...)
(3/36)(36/9)
1/3

So your probability when rolling a four is 1/3. That way was the most direct way to calculate it, but also a little complicated and requiring some basic knowledge of infinite series. A much easier approach would be to realize that the remaining 27 options have no significance as to your success. There are 3 good rolls and 6 bad rolls and that is all that matters.

So out of the nine total significant rolls, three of them are winners. Using this logic, the odds for success would be 3/9, or 1/3 as discovered before. Either method generates a 1/3 chance of success.

Using the approach we just discovered, we can very quickly determine the odds for the other totals and complete the table from before.

Come Out RollOdds for Pass Line
20
30
41/3
52/5
65/11
71
85/11
92/5
101/3
111
120

This could then be used to determine the probability of winning the pass line bet. Keep in mind that it is not averaging the eleven totals, but multiplying their odds by roll frequency.

(1/36)(0) + (2/36)(0) + (3/36)(1/3) + (4/36)(2/5) + (5/36)(5/11) + (6/36)(1) + (5/36)(5/11) + (4/36)(2/5) + (3/36)(1/3) + (2/36)(1) + (1/36)(0) ≈ 49.293%

There is about a 49.293% chance of winning the pass line bet. Let's see what our expected value is when we make a dollar bet.

EV(\$1 bet on pass line) = 0.49293(1) + 0.50707(-1) = -1.4¢

A pass line bet in craps has an average loss of 1.4¢, which is much better than the 5.3¢ loss we continued to see in roulette. But are there other bets in craps that beat that?

Another bet in craps is called the don't pass line. This is pretty much betting that the shooter will lose rather than the shooter winning. Seems fair, right? It actually seems pretty favorable. But before you bet your mortgage payment on it, keep in mind one little rule. If the shooter rolls a twelve on his come out roll, then it is a push. In other words, a roll of twelve will not be included in the table or equations.

Come Out RollOdds for Don't Pass Line
21
31
42/3
53/5
66/11
70
86/11
93/5
102/3
110
(1/36)(1) + (2/36)(1) + (3/36)(2/3) + (4/36)(3/5) + (5/36)(6/11) + (6/36)(0) + (5/36)(6/11) + (4/36)(3/5) + (3/36)(2/3) + (2/36)(0) ≈ 47.929%

EV(\$1 bet on don't pass line) = 0.47929(1) + 0.52071(-1) = -4.1¢

With this minuscule adjustment of pushing a twelve, this bet actually becomes less favorable than the pass line bet. Rather than losing 1.4¢ on average, you would lose 4.1¢. Still better odds than roulette, but why bet against the shooter when you are benefiting more by betting for him?

There are many more bets in craps that I don't have the time to go through, but I would encourage you to perform the calculations with some of them. If you play craps at the casino, try taking one of your favorite bets and see if it measures up to the pass line bet or other options either within craps or in other casino games. Here are a few different options:

Place Bets are bets on a specific number. After the come out roll, if your number appears before a seven, you win the bet. Place bets on a six or eight pay 7:6, bets on a five or nine pay 7:5, and bets on a four or ten pay 9:5.

Place to Lose Bets are bets against a specific number. After the come out roll, if a seven appears before your number, you win the bet. Place to lose bets on a six or eight pay 4:5, bets on a five or nine pay 5:8, and bets on a four or ten pay 5:11.

Buy Bets are like place bets, except the casino gives you better odds in exchange for a 5% commission fee for making the bet. For instance, a \$1 bet would be split where about 4.76¢ go to the casino and 95.24¢ go towards your bet. Buy bets on a six or eight pay 6:5, bets on a five or nine pay 3:2, and bets on a four or ten pay 2:1.

Lay Bets are like place to lose bets, except the casino gives you better odds in exchange for a 5% commission fee for making the bet (see buy bets). Lay bets on a six or eight pay 5:6, bets on a five or nine pay 2:3, and bets on a four or ten pay 1:2.

Hard Way Bets are bets on a specific pair (either two 2's, two 3's, two 4's, or two 5's). After the come out roll, if your pair appears before a seven, you win the bet. In the United States (and most other countries) hard way bets on a pair of twos or fives pay 9:1 and bets on a pair of threes or fours pay 7:1.

Hop Bets are bets on a specific combination of numbers (1&4, 3&5, 2&2, etc.), but they only last for one roll. During the point rolls, you can make a hop bet for that turn. If you get your combination, you win. If you don't, you lose that money. Hop bets on a combination with two different numbers (such as 1&4 and 3&5) pay 15:1 and bets on a pair (such as 2&2 and 4&4) pay 30:1. This is different from a hard way bet because the hop bet lasts for one turn while the hard way bet lasts until the shooter gets a seven.

There are still even more bets such as odds bets and proposition bets, but these should be a good start. The most common craps bet is the pass line bet, so we will use this when comparing casino games. Our table of games now looks like:

GameAvg Gain Per \$1 BetP of Reaching \$100
Favorable Game (51-49 odds)92.6%
Fair Game (50-50 odds)60%
Craps-1.4¢28%
Roulette-5.3¢1.3%

If you find some craps bets or combinations of bets (ex: pass line/odds - odds bets cannot be placed on their own) that have better odds than the ones we've discussed, please comment your insights. Probability in casino games is always a fun area of mathematics to discuss and debate about.

## Saturday, February 1, 2014

### Gambler's Ruin Problem Part 1: Odds in Roulette

When I was at MAAthFest (a mathematics conference run by the Mathematical Association of America) last summer, I got to spend the first two days in a short course on the Mathematics of Games and Puzzles put on by Dr. Arthur Benjamin, who is actually my mentor in learning mental math. He recently came out with a video course through the Great Courses on the Mathematics of Games and Puzzles, which you can click here to see or purchase.

Last month, we did a four week series on Bertrand's Postulate. It was a fun and interesting proof, but it did require some hard concentration as well as relatively heavy algebra, number theory, and combinatorics. So, I thought looking at a lighter and more practical problem might be a good idea. It is certainly still deep and thought-provoking, but it won't require as much higher-level mathematics. This problem is called the "Gambler's Ruin Problem," and we spent a lot of time discussing it in that short course. This problem goes as follows:

Suppose that you find yourself in a city with a casino and you have \$60 in your pocket. There is a concert in town that you really want to see, but the tickets cost \$100. You decide that you will place \$1 bets until you either reach \$100 or go broke. Which casino game should you play? How likely are you to reach your goal of \$100?

This problem can go on forever because there are so many casino games, each one with different betting options and strategies and variations. But it is also a really fun problem, because throughout the process of figuring it out, you will learn a lot about how to improve your skills at the casino. Though probability shows that you likely won't make money, you will learn ways to play for a longer period of time without going broke. And if you use these strategies enough times, you might just get lucky. As a side note, I find it ironic that I as a fourteen-year-old am choosing to write blog posts about casino games.

There are too many casino games to fully analyze in just a few posts, but we do have time to take a look at some of the most popular. This week, we will focus on roulette. Next week will be craps. February 15th will be blackjack. February 22nd will be video poker (I would have probably preferred to do Texas Hold'em, but there is so much strategy, bluffing, reading players, and chance involved that it would be way above my head to analyze odds in that game). Notice that I am choosing to ignore slot machines. This is because they are one of the worst bets one can make in the casino. Just look at the rearrangement of the letters!

SLOT MACHINES
CASH LOST IN 'EM

So now let's start our basic analysis of roulette.

I'm sure many of you know the rules of roulette already, but I will quickly try to explain them to refresh everyone's memory. Though roulette can be played by many people at once, the game itself is just you against the house. Each spin of the wheel (at the bottom right corner of the picture above) is a game. The wheel is numbered from 1 to 36 with alternating red and black numbers. There is also a green zero as well as a green double-zero. The objective is to correctly guess a characteristic of the slot that the ball falls in to, whether it be the color, number, size, or parity (odd/even). Bets are placed on the green felt table, as shown more clearly in the picture below.

One of the more popular roulette bets is to bet on a color, say betting red. This bet pays evenly; you risk one dollar to gain one dollar (or whatever money amount you choose). When you bet red, there are 18 red numbers out of 38 total numbers, giving an 18/38 or 47.3% chance of winning.

To figure out how worthwhile this bet is, we do something called finding the expected value, which I discussed in my post about the Saint Petersburg Paradox. Expected value is essentially a weighted average; you average together your winning payoff and your losing payoff with the odds of achieving each one taken into account. For this example, winning a \$1 bet would earn you 1 dollar and losing a \$1 bet would cost you 1 dollar, or earn you -1 dollars. So, the calculation would be set up as follows:

EV(\$1 bet on red) = (18/38)(1) + (20/38)(–1) = -2/38 ≈ -0.0526316

In other words, each \$1 bet on red will lose you 5.3¢ on average. Let's look at another bet, say betting on the first twelve numbers. This bet pays 2 to 1; you risk one dollar to gain two dollars. But, the odds of landing on one of those twelve are now 12/38 instead of 18/38.

Setting up the expected value equation gives us:

EV(\$1 bet on 1st 12) = (12/38)(2) + (26/38)(–1) = -2/38 ≈ -0.0526316

Again, the answer comes out to -2/38, or an average 5.3¢ loss. What if we were to place a bet on a single number. Let's say we bet on 26, the only natural number that is directly between a square (25 = 52) and a cube (27 = 33).  Casinos pay 35 to 1 on this bet; you risk one dollar to gain thirty-five dollars. The odds of landing on the number 26 would be 1/38. This expected value calculation would be:

EV(\$1 bet on 26) = (1/38)(35) + (37/38)(–1) = -2/38 ≈ -0.0526316

The answer is the same again: an average loss of 5.3¢. In fact, casinos choose the ratios for roulette such that every bet is the same expected value. Because of this, it does not matter to them what the players choose to bet on. They will always be making the same amount of money on average.

Let's return to the Gambler's Ruin Problem, and see how likely these odds are to achieve the \$100. We mentioned before that the odds for winning with a bet on red is 47.3%. Though the odds differ with other bets, the properties of expected value end up making the game of roulette come out to a 47.3% chance of success. In other words, really close to 50-50, but just a hair below.

With the Gambler's Ruin Problem, a game with 0% odds would give 0% chance of success. A game with 100% odds would give 100% chance of success. Since you are starting with \$60, a game of 50% odds actually gives a 60% chance of success. With a fair game, your amount of starting money determines your success interestingly enough.

What about a game of 47.3% odds? Would it be above 50% or below 50%? Sounds like it would be around that neck of the woods, considering that a 50-50 game gives a 60% chance. Turns out that there is a formula for determining the probability of turning \$60 into \$100.

Let p = probability of winning the game (in decimal form)
Let q = probability of losing the game (in decimal form)

Plugging 0.473 in for p and 0.527 in for q predicts the probability of success to be about 1.3%. This was really surprising to me at first. Just that 2.7% difference between fair and unfavorable costs you so much when it comes to succeeding in the Gambler's Ruin Problem. But probability is full of surprises, as you can see in my past probability posts as well as the posts in the rest of the month.