ssho88 Joined: Oct 16, 2011
• Threads: 32
• Posts: 282
May 17th, 2019 at 10:32:19 PM permalink
Here is an interesting question about getting 4 continuous OF "BANKER" in Baccarat games.

You are dealing baccarat game from a new 8 deck shoe(cut card place at 14 cards from the bottom of the shoe) and record the results of each hand, you stop once you get 4 continuous OF "BANKER". If you can't get 4 continuous BANKER when reach the cut card, then you should shuffle the cards and continue to dealt card from the new shoe, until you get 4 continuous OF "BANKER".

The results of H1, H2, H3 . . . .Hn is B,P,P . . . P,B,T,P,B,B,B,B

H1= hand 1
Hn = hand n

P= PLAYER
B=BANKER
T=TIE

What is the average value of n ?

OR

What the average hands you have to dealt before you get a 4 continuous OF "BANKER" ?

My simulation results(1 million shoe) shown that the average n = 39.98, n(min) = 4 and n(max) = 514.

Anyone can help to verify my results with calculations ? Is there any formula to calculate it ?
ChesterDog Joined: Jul 26, 2010
• Threads: 6
• Posts: 750
May 18th, 2019 at 8:25:25 AM permalink
Quote: ssho88

...My simulation results(1 million shoe) shown that the average n = 39.98, n(min) = 4 and n(max) = 514.

Anyone can help to verify my results with calculations ? Is there any formula to calculate it ?

I'm new to working with "transition matrices," but I just now tried them on your problem.

But instead of playing through a shoe of eight decks, my calculations shuffle after the first hand of every shoe. The Wizard gives the probability of Banker for eight decks on this page: https://wizardofodds.com/games/baccarat/basics/#toc-EightDecks.

If I use the Wizard's probability of Banker of 0.458597, which is rounded to six places, I get an average of 39.9124 for n. (I guess I did the transition matrices right because my n is close to your n.)
ssho88 Joined: Oct 16, 2011
• Threads: 32
• Posts: 282
May 18th, 2019 at 9:00:56 AM permalink
Quote: ChesterDog

I'm new to working with "transition matrices," but I just now tried them on your problem.

But instead of playing through a shoe of eight decks, my calculations shuffle after the first hand of every shoe. The Wizard gives the probability of Banker for eight decks on this page: https://wizardofodds.com/games/baccarat/basics/#toc-EightDecks.

If I use the Wizard's probability of Banker of 0.458597, which is rounded to six places, I get an average of 39.9124 for n. (I guess I did the transition matrices right because my n is close to your n.)

Could you please show me your calculations ? I would like to learn something from you. Tq
ThatDonGuy Joined: Jun 22, 2011
• Threads: 86
• Posts: 3696
May 18th, 2019 at 9:11:18 AM permalink
I get 39.9124 as well - here's how:

Let EN be the expected number of hands needed to reach 4 in a row when you have N in a row,
p = the probability of a banker win, which I assume is 0.458597,
and q = 1 - p = the probability of anything besides a banker win

With each hand, you are one closer to 4 with probability p, and back to zero with probability q:
EN = 1 + p EN+1 + q E0

E4 = 0
E3 = 1 + q E0 + p E4 = 1 + q E0
E2 = 1 + q E0 + p (1 + q E0) = (1 + p)(1 + q E0)
E1 = 1 + q E0 + p (1 + p)(1 + q E0) = (1 + p + p2)(1 + q E0)
E0 = 1 + q E0 + p (1 + p + p2)(1 + q E0) = (1 + p + p2 + p3)(1 + q E0)
E0 (1 - q (1 + p + p2 + p3)) = 1 + p + p2 + p3
E0 (1 - (1 - p)(1 + p + p2 + p3)) = 1 + p + p2 + p3
E0 p4 = 1 + p + p2 + p3
E0 = (p4 - 1) / (p4 (p - 1))
= (1 - p4) / (p4 - p5)
= 39.91237153

ChesterDog Joined: Jul 26, 2010
• Threads: 6
• Posts: 750
May 18th, 2019 at 9:24:20 AM permalink
Quote: ThatDonGuy

I get 39.9124 as well - here's how:

Let EN be the expected number of hands needed to reach 4 in a row when you have N in a row,
p = the probability of a banker win, which I assume is 0.458597,
and q = 1 - p = the probability of anything besides a banker win

With each hand, you are one closer to 4 with probability p, and back to zero with probability q:
EN = 1 + p EN+1 + q E0

E4 = 0
E3 = 1 + q E0 + p E4 = 1 + q E0
E2 = 1 + q E0 + p (1 + q E0) = (1 + p)(1 + q E0)
E1 = 1 + q E0 + p (1 + p)(1 + q E0) = (1 + p + p2)(1 + q E0)
E0 = 1 + q E0 + p (1 + p + p2)(1 + q E0) = (1 + p + p2 + p3)(1 + q E0)
E0 (1 - q (1 + p + p2 + p3)) = 1 + p + p2 + p3
E0 (1 - (1 - p)(1 + p + p2 + p3)) = 1 + p + p2 + p3
E0 p4 = 1 + p + p2 + p3
E0 = (p4 - 1) / (p4 (p - 1))
= (1 - p4) / (p4 - p5)
= 39.91237153

Nice! Thanks for that explanation.
7craps Joined: Jan 23, 2010
• Threads: 18
• Posts: 1792
May 18th, 2019 at 9:36:58 AM permalink
Quote: ssho88

The results of H1, H2, H3 . . . .Hn is B,P,P . . . P,B,T,P,B,B,B,B

H1= hand 1
Hn = hand n

P= PLAYER
B=BANKER
T=TIE

What is the average value of n ?

interesting you count Ties
Banker win = 0.458597423
this was done online with some code I made in R
https://sites.google.com/view/krapstuff/streaks
section 2r.

> runs.mean3(4,0.458597423)#Banker 4 Baccarat
the transition matrix
`          0         1         2         3         40 0.5414026 0.4585974 0.0000000 0.0000000 0.00000001 0.5414026 0.0000000 0.4585974 0.0000000 0.00000002 0.5414026 0.0000000 0.0000000 0.4585974 0.00000003 0.5414026 0.0000000 0.0000000 0.0000000 0.45859744 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000`

result:  39.91225

in reality, a Tie does not break a streak in Baccarat for Banker or Player
winsome johnny (not Win some johnny)
ssho88 Joined: Oct 16, 2011
• Threads: 32
• Posts: 282
May 18th, 2019 at 10:10:49 AM permalink
I still can't get it, do you mind to explain it further ?
7craps Joined: Jan 23, 2010
• Threads: 18
• Posts: 1792
May 18th, 2019 at 10:29:27 AM permalink
Quote: ssho88

I still can't get it, do you mind to explain it further ?

I learned this stuff starting here
http://www.zweigmedia.com/RealWorld/Summary6b.html

the matrix algebra tool is here: http://www.zweigmedia.com/RealWorld/fancymatrixalg.html

A is only for the distribution probabilities after N trials (not needed for any calculations right now)
A=[0.5414026, 0.4585974, 0.0000000, 0.0000000, 0.0000000
0.5414026, 0.0000000, 0.4585974, 0.0000000, 0.0000000
0.5414026, 0.0000000, 0.0000000, 0.4585974, 0.0000000
0.5414026, 0.0000000, 0.0000000, 0.0000000, 0.4585974
0.0000000, 0.0000000, 0.0000000, 0.0000000, 1.0000000]

S is from A
S=[0.5414026, 0.4585974, 0.0000000, 0.0000000
0.5414026, 0.0000000, 0.4585974, 0.0000000
0.5414026, 0.0000000, 0.0000000, 0.4585974
0.5414026, 0.0000000, 0.0000000, 0.0000000]

(I-S)^-1
result:
`(I-S)^-1 = 22.6086 	10.3682 	4.75485 	2.18056 	20.428  	10.3682 	4.75485 	2.18056 	17.8537 	8.18768 	4.75485 	2.18056 	12.2404 	5.61339 	2.57429 	2.18056 `

sum the top row (all columns)
22.6086+10.3682+4.75485+2.18056

mean (average): 39.91221

I found learning how to do Markov chains (and the data they can give you) slow and frustrating.
Once I got, I got it.
some learn this stuff real fast, others, never learn it.
winsome johnny (not Win some johnny)
ssho88 Joined: Oct 16, 2011
• Threads: 32
• Posts: 282
May 18th, 2019 at 11:18:45 AM permalink
Quote: ThatDonGuy

I get 39.9124 as well - here's how:

Let EN be the expected number of hands needed to reach 4 in a row when you have N in a row,
p = the probability of a banker win, which I assume is 0.458597,
and q = 1 - p = the probability of anything besides a banker win

With each hand, you are one closer to 4 with probability p, and back to zero with probability q:
EN = 1 + p EN+1 + q E0

E4 = 0
E3 = 1 + q E0 + p E4 = 1 + q E0
E2 = 1 + q E0 + p (1 + q E0) = (1 + p)(1 + q E0)
E1 = 1 + q E0 + p (1 + p)(1 + q E0) = (1 + p + p2)(1 + q E0)
E0 = 1 + q E0 + p (1 + p + p2)(1 + q E0) = (1 + p + p2 + p3)(1 + q E0)
E0 (1 - q (1 + p + p2 + p3)) = 1 + p + p2 + p3
E0 (1 - (1 - p)(1 + p + p2 + p3)) = 1 + p + p2 + p3
E0 p4 = 1 + p + p2 + p3
E0 = (p4 - 1) / (p4 (p - 1))
= (1 - p4) / (p4 - p5)
= 39.91237153

Please explain further this : With each hand, you are one closer to 4 with probability p, and back to zero with probability q:
EN = 1 + p EN+1 + q E0

Could you please explain with a sketch or graphically ? I eagerly to understand/learn this. Tq
7craps Joined: Jan 23, 2010
• Threads: 18
• Posts: 1792
May 18th, 2019 at 11:22:07 AM permalink
Quote: ssho88

The results of H1, H2, H3 . . . .Hn is B,P,P . . . P,B,T,P,B,B,B,B

H1= hand 1
Hn = hand n

P= PLAYER
B=BANKER
T=TIE

What is the average value of n ?

say you wanted to know about this: P,P,B,B,B,T,B,P
still 4 Bankers in a row with the Tie in there.
the average would be less (of course)
and it requires a slightly different transition matrix
https://sites.google.com/view/krapstuff/streaks
section 2r. still works
`> runs.mean3(4,0.458597423,0.095155968)#Banker 4 Baccarat Tie          0          1          2          3         40 0.5414026 0.45859742 0.00000000 0.00000000 0.00000001 0.4462466 0.09515597 0.45859742 0.00000000 0.00000002 0.4462466 0.00000000 0.09515597 0.45859742 0.00000003 0.4462466 0.00000000 0.00000000 0.09515597 0.45859744 0.0000000 0.00000000 0.00000000 0.00000000 1.0000000 31.72111`
winsome johnny (not Win some johnny)

• Jump to: