## Shooting craps 2

Posted by Chris on October 28, 2011 – 5:59 pm

On average how many rolls does a craps game take if you:

a) win, b) lose and c) either win or lose?

Rules of craps: You use a pair of dice. You make a first roll (the “come-out”

roll). If you get a 7 or 11 (a “natural”) you win. If you get 2, 3 or 12

(“craps”), you lose. If you roll 4, 5, 6, 8, 9 or 10 then that sets a target number

(the “point”); you then proceed to roll until you either roll the point again (and

win) or you roll a 7 (and lose). If you roll any other number, you just roll again.

Blame Cazayoux and Ragknot for this one

See http://trickofmind.com/?p=1227#comment-7667 for actual probabilities.

But I’ll put them in the first comment.

October 29th, 2011 at 5:26 pm

Here’s that link again: http://trickofmind.com/?p=1227#comment-7667

The numerical calculations are slightly tedious. I recommend using http://www.wolframalpha.com for that number grinding.

However, the problem is far easier than I had supposed.

A few probabilities:

sum,x 2 3 4 5 6 7 8 9 10 11 12

36p(x) 1 2 3 4 5 6 5 4 3 2 1

p(natural) = p(7 or 11) = (6+2)/36 = 2/9

p(craps) = p(2 or 3 or 12) = (1+2+1)/36 = 4/36 = 1/9

p(point) = p(4 or 5 or 6 or 8 or 9 or 10) =2 (3+4+5)/36 = 24/36 = 2/3

October 30th, 2011 at 8:37 pm

Clarification: Starting from scratch, roll away. You will eventually either win or lose. I simply want the average number of rolls you made for games that you win, lose, either win or lose.

There are many similar questions that I could have asked (don’t panic) I won’t ask them, such how many rolls on average before you win – that will be greater than the asked for win average because it will include lose games too.

November 2nd, 2011 at 10:52 am

Hi Chris … I am looking at this during breaks.

I’m trying to approach it like the Fair Coin Toss problem where we needed to get two heads.

http://trickofmind.com/?p=734

(post 15, is luv2fap’s solution)

I’m trying to create a state machine to evaluate.

States:

ComeOut (leave this state with first role, no ’starting over’)

P4,10 (Point is 4 or 10, stuck here until Point is rolled)

P5,9 (Point is 5 or 9, stuck here until Point is rolled)

P6,8 (Point is 6 or 8, stuck here until Point is rolled)

W (Win: get here from ComeOut or any of the Points)

L (Lose: get here from ComeOut or any of the Points)

Another state machine would be drawn up to replace W and L with ‘Finish’ (W or L).

Luv2fap explained his solution in the Fair Coin Toss problem, but I have questions about it.

Luv2fap … are you there?

November 2nd, 2011 at 11:44 am

Hi cazayoux. Some clues were given in one of the recent dice problems. That’s what caused me think up the current problem.

I’ve been distracted by the “swap or not?” problem. I’ll be back here later on.

November 9th, 2011 at 7:07 pm

This problem turned out to be more difficult than I had thought. I found some very counter-intuitive results on the way to the solution, so there’s a result . I doubt that I would have done it without computer assistance. The following pair of subroutines helped enormously: http://trickofmind.com/wp-content/uploads/2011/11/Craps-2.txt

If an event occurs on average every N trials, then the probability of the event occuring in a trial is p = 1/N => N = 1/p. That is practically the definition of probability. Using the recursion idea, the number of trials is:

N = 1 + 0*p + (1-p)N => N = 1/p.

I’ll not always say “on average”, just assume that I always mean that.

First I’ll tackle the average game length. The probability of the game ending in the come-out phase is p(natural) + p(craps) = 2/9 + 1/9 = 3/9 = 1/3.

If we rolled point, x, in the come-out phase, the in the point phase, the expected number of rolls to finish is:

Nx = 1 + 0(p(x) + p(7)) + (1 – p(x) – p(7)) Nx => Nx = 1/(p(x) + p(7))

For x = 4 or 10, Nx = 36/(3+6) = 4

For x = 5 or 9, Nx = 36/(4+6) = 18/5 = 3.6

For x = 6 or 8, Nx = 36/(5+6) = 36/11 = 3.2727272…

Altogether, the average number of rolls per game is:

N = 1 +0(p(natural) +p(craps)) + Σ(p(x) Nx) = 1 + Σ(Px Nx)

where the sum is taken over x = 4,5,6,7,8,9,10

NB you might prefer to see that as

N = 1 +0(p(natural) +p(craps)) +p(point) Σ(Px Nx) = 1 +p(point) Σ(Px Nx)

where Px is the conditional probability of rolling x, given that you rolled a point. But then Px = p(x)/p(point) and we recover the previous equation. The choice really is down to what seems more natural to you.

So putting that altogether and using the symmetry of the table, we get the average number of rolls per game, N, is:

N = 1 + 2(3*4 + 4*(18/5) + 5*(36/11))/36 = 557/165 ≈ 3.3757575757575.

(thank you http://www.wolframalpha.com ).

Now for the average length of a winning and losing games. This should make most people’s brain’s melt. Assuming we make it to phase 2, with the point x (the probability of which is p(x)), the average number of rolls when we roll x or 7 is 1/(p(x)+p(7)). Given that we rolled x or 7, the probability that we rolled x is p(x)/(p(x)+p(7)) and that we rolled 7 is p(7)/(p(x)+p(7)). Altogether (phase 2 only) the average number of rolls if we win is Nwin2 = Σ(p(x) (1/(p(x)+p(7)) p(x)/(p(x)+p(7)) = Σ(p(x)/(p(x)+p(7))

^{2}= 26012/27225 ≈ 0.95544536271809 and if we lose it’s Nlose2 = Σ(p(x) (1/(p(x)+p(7)) p(7)/(p(x)+p(7))) = Σ(p(x)p(7)/(p(x)+p(7))^{2}= 38668/27225 ≈ 1.42031221303949. The probability of getting to phase 2 and winning is Pwin2 = Σ(p(x)^{2}/(p(x)+p(7))), and of getting to phase 2 and losing is Plose2 =Σ(p(x)p(7)/(p(x)+p(7)).Now to deal with what Nwin2 and Nlose2 actually mean. The sum of those two probabilities is Pwin2 + Plose2 = Σ(p(x)

^{2}/(p(x)+p(7)) + p(x)p(7)/(p(x)+p(7))) = Σ(p(x)^{2}/(p(x)+p(7)) + p(x)p(7)/(p(x)+p(7))) = Σp(x) = p(point) = 1 – p(natural) – p(craps), as it should be. So Nwin2 is the number of rolls if we actually win in phase 2 divided by the probabity of winning in phase 2. So the average number of rolls given that we win in phase 2 is N2win = Nwin2/Pwin2. Similarly, N2lose = Nlose2/Plose2. N2win and N2lose are the numbers that we are interested in.I haven’t finished. I’ll be back.The probability of winning altogether (see: http://trickofmind.com/?p=1227#comment-7667 ) is 244/495 ≈ 0.4929292929292 and of losing is 251/495 ≈ 0.507070707.

The average number of rolls if we win is 1 + (26012/27225)/(244/495) = 9858/3355 ≈ 2.93830104321908

The average number of rolls if we lose is 1 + (38668/27225)/(251/495) = 52473/13805 ≈ 3.80101412531691

November 10th, 2011 at 7:59 am

Very interesting results Chris. So the probability of winning is less than losing. This is expected, because what gambling facility would want to give the gambler the odds? That is just counter-profitable. But I know that in some cases you are given the option to either raise your bet after each roll, or stay. So does that mean that after my second (or maybe third) roll, I should consider staying? I suppose that depends on what point I rolled…I guess the closer I am to 7, the better chances I have.

November 10th, 2011 at 12:21 pm

Hi DP. I’ve still not finished my write up. Unfortunately I’ve got to many things to do and keep losing my train of thought.

Supposedly, the record stands at 154 rolls in a single game.

If you can, try the secod sub in my posted code. You can set point = 0 to simulate a normal point phase, or set point to a particular value. If you do, you’ll find that the average number of rolls, win or lose is the same for each particular point. But when you allow all points, then you’re a small difference.

November 11th, 2011 at 11:36 am

I’ve had this on my whiteboard and work and played with it during conference calls.

I’ve gone through this several different ways and haven’t been fully satisfied with anything completely.

On the surface of it, on the come out roll it is twice as likely to win than lose.

7,11 … (6 + 2)/36 = 8/36 chances to win

2,3,12 … (1+2+1)/36 = 4/36 chances to lose

Odds SEEM to be in favor of the player, but winning OR losing on the come out roll is only 12/36 (1/3) of the possible results.

For the other 2/3’s results, the odds flip to favor the house.

For a point of 4 (or 10) the odds of winning are now less than that for winning.

4 … 3/36 chances to win

7 … 6/36 chances to lose

This is why the point 4 or 10 pays 2:1 (6/36 : 3/36)

Likewise, 5 or 9 pays 3:2 (6/36 : 4/36), and 6 or 8 pays 6:5 (6/36 : 5/36)

My last attempt was to look at winning and figure the odds to get there

There’s a 8/36 (roll 7,11) chance to win on the comeout roll.

There’s a 6/36 chance to get to the 4 or 10 POINT.

Once on the 4 or 10 point there is a 3/36 chance to win, but a 27/36 chance to stay on the point

I think this means there is a 6/36 * 3/36 * SUM(n=0 to inf)(27/36)^n.

SUM (27/36)^n = 1 + 27/36 + (27/36)^2) + …

36/27 * SUM (27/36)^n = 36/27 + 1 + 27/36 + …

(36/27 – 1) SUM (27/36)^n = 36/27

SUM (27/36)^n = (36/27)/(9/27) = 36/9

Is this right?

Chance to win from the 4 or 10 point..

= (6/36)(3/36)(36/9)

Likewise for the other points to where the Win is …

W = chance to win on the comeout + chance to win from each point

W = 8/36 + (6/36)(3/36)(36/9) + (8/36)(4/36)(36/10) + (10/36)(5/36)(36/11)

= 976/1980 = 244/495 = 0.492929292

Likewise to Lose we have the following.

L = 4/36 + (6/36)(6/36)(36/9) + (8/36)(6/36)(36/10) + (10/36)(6/36)(36/11)

= 1104/1980 = 276/495 = 0.50707070

So I think I get how to determine the odds.

I wasn’t as clear on how to get the number of rolls.

Ironically, the opposite of the issue I had with the colorful dice.

I did work through a couple of possibilities, but wasn’t satisfied that I properly understood what I was doing.

There may not have been as much traffic on the website for this one, but I sure did spend a fair amount of time on the whiteboard with it.

I am still working to better understand luv2fap’s approach.

November 11th, 2011 at 1:40 pm

Hi cazayoux. This was a pretty tough one. At first I thought that, then I changed my mind, several times.

I have actually used luv2fap’s method, but I had to do something that I hadn’t anticipated.

I still haven’t thought of a really clear way to explain the last move. It goes something like, Pwin2 = Σ(p(x)

^{2}/(p(x)+p(7)) is the unconditional probability of winning in round 2, and then N2w = Σ(p(x)/(p(x)+p(7))^{2}is the contribution to the average number of rolls altogether. So the average number of rolls given that we actually win in the second round is N2win = N2w/Pwin2.Altogether the average number of rolls, given that we win, is:

N = (Pwin1/(Pwin1+Pwin2))*1 + (Pwin2/(Pwin1+Pwin2))*(1+N2win)

= 1+ (Pwin2/(Pwin1+Pwin2))*N2win = 1 + N2w/(Pwin1+Pwin2)

= 1 + N2w/Pwin

The argument is similar for losing.

Go back to http://trickofmind.com/?p=734 I gave some explanations of the method, starting at comment 31.

November 11th, 2011 at 4:45 pm

Hi cazayoux. In the point rounds, for point x, the probability of winning is p(x)/(p(x)+p(7), that’s the probability of rolling x (and so winning) given that we roll x or 7. Any other roll is irrelevant for the probability of winning. If x = 4 (or 10) , then we get (3/36)/((3/36) + (6/36)) = 3/9 = 1/3. Likewise, the probability of losing is 6/9 = 2/3.

Here’s the luv2fap way. Let the chance of winning when on point x be Px, then:

Px = p(x) + (1 – p(x) – p(7)) Px. Read as, we have a prob of p(x) of winning on the first roll. If we don’t roll x or 7, the probability of which is 1 -p(x) -p(7), we’re back to where we started, with a prob Px of winning. Solving =>

Px = p(x)/(p(x) + p(7)), phew! x = 4 => 3/9 = 1/3

Now I’ve done that, I’ll carry on to find the number of rolls.

Nx = 1 + p(x) *0 + (1 – p(x) – p(7))Nx => Nx = 1/(p(x) + p(7)), phew! again. Read as, we do a roll, then with probability p(x) we’re done, and with probability (1-p(x)-p(7)), we’ve still got Nx to go. I hadn’t originally expected that result (for the number of rolls). I had thought it should be 1/p(x), but with probability 1 (:~), instead it’s 1/(p(x) + p(7)) with probability p(x)/(p(x)+p(7)). x = 4 => 1/((3/36) + (6/36)) = 4

Here’s an an infinite sum/product way (using 1 -p(4)- p(7) = 27/36),

Px = (3/36) +(27/36)((3/36) +(27/36)((3/36) +(27/36)((3/36)…, note that the nesting is infinitely deep.

It’s best to take each point separately, otherwise there’s a danger of inadvertently introducing a factor of two – e.g. if you are rolling for a 4, rolling a 10 won’t win. Only note that e.g. 4 and 10 have the same probabilities etc., when it comes to the final calculations.

Although you got there, starting from your SUM(n=0 to inf)(27/36)^n, I’d set that to z, say, then z = 1 + (27/36)z =>

z(1 – 27/26) = 1 => z = 1/(1-(27/36)) = 36/9 = 4.

It’s useful to remember that 1/(1-x) = 1 + x + x

^{2}+ x^{3}+ …, for |x| < 1.Run the code, especially the second sub. It produced results that I hadn’t expected. I really doubt that I’d have solved the problem if it wasn’t for writing code. The problem seems easy to me now, but that’s only because hindsight is 20-20.

I hope that you enjoyed the extreme pain of it. You should have every reason to be pleased with (at least some of) your results, and definitely for all of your perseverance.

November 11th, 2011 at 5:16 pm

If you’d like another challenge, then try, what is the average number of rolls before you win? or, what is the average number of rolls before you 7 out? (That usually corresponds to passing the dice to the next player).