gigolo2002ph
• Posts: 1
Joined: Jan 22, 2014
January 22nd, 2014 at 6:56:21 AM permalink
Hi Wizard,

I have a question with regards to the probability of winning for a Banker, Player and Tie.
Below are the combinations in each market. May I know how did you compute the no. of combinations in each event?
Is there any method or did you used a simulation software or a program to calculate all the possible combinations?

Combinations Markets
2,292,252,566,437,888 - Banker
2,230,518,282,592,256 - Player
475,627,426,473,216 - Tie
AceTwo
• Posts: 359
Joined: Mar 13, 2012
January 28th, 2014 at 12:45:46 PM permalink
The total number of 'combinations' if you add the above is 4.998.398.275.503.360
This is calulated as Permut(416,6) in excel.
These are permutations (order matters) of chosing 6 cards out of 416 for 8 deck game.
Even though in Bacarat some hands go to 4 cards, some to 5 cards and some to 6 cards to do the calculation you take into account the 6 cards and if in a particular hand that would stop at 4 cards all permutations that include the 5th and 6th card count for that.
The individual number of permutations that result in Banker, Plaayer and Tie are calculated using a combinatorial software that goes through every single particular permutation and chekcs whether it is banker player or tie.
And actually the software does not have to go through 5 Quadrillion permutations but a much smaller number since when a hand finishes at 4 cards all resulting 6 card permutations from that are counted. And there are also otehr tricks in the programming that can reduce the number of iterations to a relatively smaller number and the calculation can be done in a split second.
charliepatrick
• Posts: 2976
Joined: Jun 17, 2011
January 28th, 2014 at 3:19:25 PM permalink
If you consider the cards as number 1 to 9 and 10 (which counts as 0) then there are 55 possibilities for the first two cards in the player's hand. Similarly in the banker's hand. This gives 3025 possible starting positions. From there you work out which ones need more cards (obviously some don't) and then either given the player's third card or stands whether the dealer stands ad work through those. Thus some starting hands will have 100 possible outcomes and others much less. Having decided which cards were used and the number of decks, you can calculate the number of permutations. Sadly excel won't run to that many significant digits, but I got similar answers.

This is the type of thought process needed when working out these things - how can I make the number of calculations fewer.
teliot
• Posts: 2871
Joined: Oct 19, 2009
January 28th, 2014 at 3:39:24 PM permalink
Quote: gigolo2002ph

Hi Wizard,

I have a question with regards to the probability of winning for a Banker, Player and Tie.
Below are the combinations in each market. May I know how did you compute the no. of combinations in each event?
Is there any method or did you used a simulation software or a program to calculate all the possible combinations?

Combinations Markets
2,292,252,566,437,888 - Banker
2,230,518,282,592,256 - Player
475,627,426,473,216 - Tie

I iterate through all possible six-card sequences with six nested for loops, each from 0 to 9, and consider all six-tuples (a,b,c,d,e,f). I evaluate the result of each of those (Player/Banker/Tie), and then compute the number of ways that six-tuple can occur. I keep track of the totals with three long long int variables. I have a function long long int getNumber(a,b,c,d,e,f), and another function int getResult(a,b,c,d,e,f) (returns 0, 1, 2). It's fairly trivial programming, less than 200 lines of code. My results match Mike's. I modify this code for side-bet analysis.

It takes about 3 milliseconds to run. This is the way Mike does it as well, I am almost certain.

For those side-bets or game variants where individual cards matter (rank and suit), I modify the program to iterate through every card. Then I have six loops from 0 to 51, so the size of the iteration is 52^6, which is considerably slower. On my computer running 1 thread, it takes about 2 hours.
Climate Casino: https://climatecasino.net/climate-casino/
Tanko
• Posts: 1206
Joined: Apr 22, 2013
January 30th, 2014 at 4:25:14 AM permalink
While playing Baccarat against the Interblock machines at Resorts World, I noticed many of the winning hands were naturals, so I wrote down the results of the next twenty shoes that I played.

I found that for each individual shoe in this small sample, a consistent 44% of the winning hands were naturals.

In one shoe, eleven of the first fifteen hands were naturals.

Ten 9's and one 8.

Fifty percent of the winning hands in that shoe were naturals.

Many of these winning hands in my sample were natural eights losing to natural nines.

Does anyone know what the expected percentage of hands won by naturals is?
gr8player
• Posts: 606
Joined: Mar 2, 2013
January 30th, 2014 at 6:53:50 AM permalink
Hello, Tanko, I trust all is well with you.

The naturals appear to me as just one of many "anomalies" pertaining to those Interblock machines at Resorts World in NYC.

I live but 20 minutes drive from there, as opposed to 2 1/2 hrs from AC, but I just can't bet any real dollars into those Baccarat "machines". I just have no trust in their results.

As such, I'm relegated to play only live-dealer games. Too often I've felt like a fool playing those machines, where Goodness only knows how they arrive at each hand's results...and that's a feeling that I just won't allow, especially while gambling.

Stay well.
charliepatrick
• Posts: 2976
Joined: Jun 17, 2011
January 30th, 2014 at 3:54:52 PM permalink
Quote: teliot

...It's fairly trivial programming, less than 200 lines of code....takes about 3 milliseconds to run.

Please forgive me for asking the obvious (also I haven't read the obvious book if there is one), but what programming language would you recommend (I'm guessing it's c or similar) and how does one run it on a PC. Personally I use scripting under HTML, so could write the code but haven't yet found the best engine to run such code quickly. Many thanks.
teliot
• Posts: 2871
Joined: Oct 19, 2009
January 30th, 2014 at 4:06:50 PM permalink
Quote: charliepatrick

Please forgive me for asking the obvious (also I haven't read the obvious book if there is one), but what programming language would you recommend (I'm guessing it's c or similar) and how does one run it on a PC. Personally I use scripting under HTML, so could write the code but haven't yet found the best engine to run such code quickly. Many thanks.

Hi, usually I write code mainly in C or C++. Sometimes in Java. I have a dedicated x86 (Alienware) running Ubuntu Linux where I run these programs. For C/C++, I use the gcc or g++ compilers, and compile with -Ofast (not that I fully understand optimization).

Scripting is possible, but will be painfully slow. You might as well learn a real language if you are going to be doing combinatorial analysis. The programming doesn't use any advanced concepts. Because you know scripting, you can easily learn enough if you self-study for a few weeks.

Cheers,

Eliot
Climate Casino: https://climatecasino.net/climate-casino/
charliepatrick
• Posts: 2976
Joined: Jun 17, 2011
January 30th, 2014 at 4:28:28 PM permalink
Thanks - I used to code in mainframe, so hopefully it should be fairly easy to pick-up the basics. Also thanks for the other things to look into.
teliot
• Posts: 2871
Joined: Oct 19, 2009
January 30th, 2014 at 4:48:20 PM permalink
Quote: charliepatrick

Thanks

My pleasure. The world could use a lot more people who know how to analyze casino games.
Climate Casino: https://climatecasino.net/climate-casino/
98Clubs
• Posts: 1728
Joined: Jun 3, 2010
January 30th, 2014 at 9:01:28 PM permalink
About 40 is very high. The average number of total naturals dealt in a standard game of Baccarat is 30.7. Three of these will be a "double natural" that will either tie or win/lose. Considering 81 rounds per shoe average thats about a 38% occurance (call it 3/8).
Some people need to reimagine their thinking.
Tanko
• Posts: 1206
Joined: Apr 22, 2013
January 31st, 2014 at 5:34:15 AM permalink
Quote: 98Clubs

About 40 is very high. The average number of total naturals dealt in a standard game of Baccarat is 30.7. Three of these will be a "double natural" that will either tie or win/lose. Considering 81 rounds per shoe average thats about a 38% occurance (call it 3/8).

If the expected average of total naturals is 38%, then I can accept the 44% that I observed in my small twenty shoe sample.

I believed the average should be slightly less than 19%.

AxiomOfChoice
• Posts: 5761
Joined: Sep 12, 2012
January 31st, 2014 at 11:18:07 AM permalink
There are 2 hands per deal
charliepatrick
• Posts: 2976
Joined: Jun 17, 2011
January 31st, 2014 at 11:53:33 AM permalink
I worked out the values, based on 8 decks, as follows (for each deal):-
Both are naturals = 3.582 023%
One is a natural = 30.722 887%
Neither is a natural = 65.695 090%
So chances of any given hand being natural is 18.943% (2 * "Both"+1 * "One")/2

Now looking at (simple) infinite deck and the chances of one hand of two cards being 8 or 9.
Total initial perms = 169 (AKQJT...2)x(AKQJT...2)
Perms forming 9 = A8,X9,9X,8A,72,63,54,45,36,27 = 16
Perms forming 8 = A7,X8,99,8X,7A,62,53,44,35,26 = 16
So chances of one hand being 8 or 9 is 32/169 = 18.935%

btw I wonder whether there's a bet paying (Evens for 1, 9/1 for two @ 97.27%) although it's fairly countable.
Tanko
• Posts: 1206
Joined: Apr 22, 2013
January 31st, 2014 at 4:24:13 PM permalink
Quote: charliepatrick

I worked out the values, based on 8 decks, as follows (for each deal):-
Both are naturals = 3.582 023%
One is a natural = 30.722 887%
Neither is a natural = 65.695 090%
So chances of any given hand being natural is 18.943% (2 * "Both"+1 * "One")/2

btw I wonder whether there's a bet paying (Evens for 1, 9/1 for two @ 97.27%) although it's fairly countable.

Thanks everyone. I see it clearly.

As for the described countable side bet, anything like that would have been eliminated after this:

Thorp
PhraterPhil
• Posts: 4
Joined: Feb 20, 2014
February 20th, 2014 at 3:54:42 AM permalink
Hi Teliot

I am interested in mathematics generally, and lately have been looking at baccarat. I wanted to see if I could work out, on my own, the probabilities shown by Mike and confirmed by yourself. Rather than go all-in and work out everything at once, I decided to start small to see if my code was correct before expanding it further. What I have worked out thus far is the odds of each result given that both player and banker have a score of zero after four cards (of an eight-deck shoe) have been drawn.

I have a total of 169,332 possible combinations (412 x 411) for the fifth and sixth cards drawn. There are 416 cards in total - 4 have been drawn already.

Of these combinations, I have determined 72576 wins for the player, the same amount for the banker and 24180 ties.

This gives me percentages of 42.86018 for the player and banker and 14.27964 for ties. They are close to what Mike has but they do not match. I have thought about this for a while and tried a few things to find numbers to get the same percentages as Mike with no success. Since you have written code already I was hoping you would be able to suggest why my numbers might be different.

As I said, this is purely for my own mathematical curiosity.

And now I notice this thread is over four years old, but I think it is worth taking a shot at asking.

Kind regards
Phrater Phil
teliot
• Posts: 2871
Joined: Oct 19, 2009
February 20th, 2014 at 7:15:39 AM permalink
Quote: PhraterPhil

Hi Teliot

I am interested in mathematics generally, and lately have been looking at baccarat. I wanted to see if I could work out, on my own, the probabilities shown by Mike and confirmed by yourself. Rather than go all-in and work out everything at once, I decided to start small to see if my code was correct before expanding it further. What I have worked out thus far is the odds of each result given that both player and banker have a score of zero after four cards (of an eight-deck shoe) have been drawn.

I have a total of 169,332 possible combinations (412 x 411) for the fifth and sixth cards drawn. There are 416 cards in total - 4 have been drawn already.

Of these combinations, I have determined 72576 wins for the player, the same amount for the banker and 24180 ties.

This gives me percentages of 42.86018 for the player and banker and 14.27964 for ties. They are close to what Mike has but they do not match. I have thought about this for a while and tried a few things to find numbers to get the same percentages as Mike with no success. Since you have written code already I was hoping you would be able to suggest why my numbers might be different.

As I said, this is purely for my own mathematical curiosity.

And now I notice this thread is over four years old, but I think it is worth taking a shot at asking.

Kind regards
Phrater Phil

I would never work these out by hand. I cannot imagine it. See my post above where I describe how I do it. I am not sure what to add. If there is some part of this you don't understand, let me know your question. If you want to consider a 0-0 tie, you have to look at all six-tuples (a,b,c,d,e,f) that yield this tie.

In case you didn't read it:

I iterate through all possible six-card sequences with six nested for loops, each from 0 to 9, and consider all six-tuples (a,b,c,d,e,f). I evaluate the result of each of those (Player/Banker/Tie), and then compute the number of ways that six-tuple can occur. I keep track of the totals with three long long int variables. I have a function long long int getNumber(a,b,c,d,e,f), and another function int getResult(a,b,c,d,e,f) (returns 0, 1, 2). It's fairly trivial programming, less than 200 lines of code. My results match Mike's. I modify this code for side-bet analysis.

It takes about 3 milliseconds to run. This is the way Mike does it as well, I am almost certain.

For those side-bets or game variants where individual cards matter (rank and suit), I modify the program to iterate through every card. Then I have six loops from 0 to 51, so the size of the iteration is 52^6, which is considerably slower. On my computer running 1 thread, it takes about 2 hours.
Climate Casino: https://climatecasino.net/climate-casino/
PhraterPhil
• Posts: 4
Joined: Feb 20, 2014
February 21st, 2014 at 4:36:36 AM permalink
Hi Teliot

Thank-you for replying. I really appreciate it.

I did read the entire thread. I have a programming background so I understand the code you are describing. What I have done effectively is what you have suggested. I work out the results for each six-tuple where the first four values are 0.

Perhaps you can get extra information from your program so we can compare results. To start with, I can tell you that I have worked out for the player drawing 0,0 and the banker drawing 0,0 there are 256,032,000 ways this can happen with a starting shoe of eight decks and no burn cards. Both player and banker are forced to draw a third card. So all up there are 43,354,410,624,000 six-tuples. I have approached this problem in two ways: one in a spreadsheet and one in a program.

If you can, please let me know what numbers you get for the six-tuples (0,0,0,0,X,X). I expect it is a matter of iterating the four outer loops from 0 to 0 instead of 0 to 9. This is what I have done in code.

Thanks again Teliot.

Kind regards,
Phrater Phil
98Clubs
• Posts: 1728
Joined: Jun 3, 2010
February 22nd, 2014 at 5:34:11 AM permalink
Quote: Tanko

If the expected average of total naturals is 38%, then I can accept the 44% that I observed in my small twenty shoe sample.

I believed the average should be slightly less than 19%.

Sorry for the delay, 44% works out to about 35 2/3 Naturals per average shoe. I noted during your trials that you thought the number was consistent. A few morre of those samples might indicate some small bias, but as it stands as a one-off observation that is not extreme. It is very high, and if consistant through hundreds of shoes, I would have some concern. However there is no apparant wager upon Naturals dealt (in total would be fair), so such an observation is near moot. But if you suspect that the game "decides" a winner by dealing a Natural, then there would be concern. Class II (Lottery-style) gaming might employ such a trick. Class III (standard randomzed/fair gaming) should never do this.
Some people need to reimagine their thinking.
teliot
• Posts: 2871
Joined: Oct 19, 2009
February 22nd, 2014 at 11:35:25 AM permalink
Quote: PhraterPhil

Hworked out for the player drawing 0,0 and the banker drawing 0,0 there are 256,032,000 ways this can happen with a starting shoe of eight decks and no burn cards.

Number of 0-0 ties: 28,979,901,420,544. There are 3100 unique ways to get a 0-0 tie.
Quote:

Both player and banker are forced to draw a third card. So all up there are 43,354,410,624,000 six-tuples.

There are 4,998,398,275,503,360 total hands in the CA. Don't worry if all six cards are used or not, you still cycle over all six-tuples for the CA, not just those where the six cards are needed. Never iterate over just the four outer loops. That is not how to analyze baccarat.

`  for (a = 1; a <= 10; a++) {    for (b = 1; b <= 10; b++) {       for (c = 1; c <= 10; c++) {         for (d = 1; d <= 10; d++) {           for (e = 1; e <= 10; e++) {             for (f = 1; f <= 10; f++) {              x = getPlayer(a,b,c,d,e,f);              y = getBanker(a,b,c,d,e,f);              gN = getNumber(a,b,c,d,e,f);              totalHands += gN;              if (x > y)                 player += gN;              else              if (y > x)                 banker += gN;              else              if (y == x)                 tie += gN;              else                exit(1);              if (x == 0 && y == 0)                 total_0_0 += gN;    } } } } } }`
Here is the function getNumber:
`long long int getNumber(int a1, int b1, int c1, int d1, int e1, int f1) {  long long int number = 1;  int freq[11] = {0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 128};     number *= freq[a1]--;            number *= freq[b1]--;    number *= freq[c1]--;    number *= freq[d1]--;    number *= freq[e1]--;                             number *= freq[f1];    return number;}`

Climate Casino: https://climatecasino.net/climate-casino/
PhraterPhil
• Posts: 4
Joined: Feb 20, 2014
February 25th, 2014 at 4:01:43 AM permalink
I don't know quite what it was that you wrote but the penny dropped. My calculations are now matching yours and Mikes. What I was doing wrong was counting only the 10 (or zero) point cards in the "Player 0 Banker 0 after four cards" scenario. I was ignoring the fact that 1+9, 2+8 etc also make a total of zero (as far as Baccarat is concerned). Adding in those combinations in gave me the correct figures.

Teliot, thank you so much for your time and patience. I really appreciate your help.

Kind regards
Phrater Phil
teliot
• Posts: 2871
Joined: Oct 19, 2009
February 25th, 2014 at 5:36:36 AM permalink
Cool,Phil, but I am not at all certain what you are doing or why you are doing it.

Cheers.
Climate Casino: https://climatecasino.net/climate-casino/
PhraterPhil
• Posts: 4
Joined: Feb 20, 2014
February 26th, 2014 at 4:18:35 AM permalink
I love mathematics and a friend of mine has been teaching me about baccarat, so I became curious about the probabilities of different outcomes. Very little searching yielded the Wizard of Odds site. There is a lot of very good information there. Among the information there are tables with various percentages. I wanted to know if I could calculate those percentages myself. For me, the most interest was in developing the algorithm and trying to understand how these figures were calculated.

And now I do :)

Cheers
Phrater Phil
teliot
• Posts: 2871
Joined: Oct 19, 2009
May 16th, 2014 at 9:38:38 AM permalink
I just posted a spreadsheet that explains it all and allows you to do just about any other baccarat computation (that doesn't involve suits). No computers necessary. However, you will need to learn the Excel function "sumifs".

http://apheat.net/2014/05/16/baccarat-combinatorial-analysis-the-easy-way/
Climate Casino: https://climatecasino.net/climate-casino/
charliepatrick
• Posts: 2976
Joined: Jun 17, 2011
May 16th, 2014 at 1:55:47 PM permalink
^ Thanks - I've never heard of sumifs but like the way it saves adding lots of additional columns and doing it manually. I assume you've worked out the combinations of cards and their perms by dragging and dropping the actual values from another master spreadsheet into this one, saving any recalculations when you add another sidebet. I must try that method when looking into ideas for new games, as once you've worked out (say) it needs five player cards, the combinations and perms stay the same.
teliot
• Posts: 2871
Joined: Oct 19, 2009
May 16th, 2014 at 3:51:25 PM permalink
Quote: charliepatrick

I assume you've worked out the combinations of cards and their perms by dragging and dropping the actual values from another master spreadsheet into this one

No way, I just wrote a C++ program that output the data for this sheet as a CSV file.
Climate Casino: https://climatecasino.net/climate-casino/
tomchina123
• Posts: 305
Joined: Aug 26, 2015
September 23rd, 2018 at 3:09:33 AM permalink
Quote: teliot

I just posted a spreadsheet that explains it all and allows you to do just about any other baccarat computation (that doesn't involve suits). No computers necessary. However, you will need to learn the Excel function "sumifs".

http://apheat.net/2014/05/16/baccarat-combinatorial-analysis-the-easy-way/

this is an old post, but bac is the same.

i got the excel, tried to figure out how it works,,, it is great of Eliot.

and now in Macau, MGM and wynn are all forune 6 bac table( winning banker of 6 of 2 cards 1:12, 3 cards, 1:20), i tried to use Eliot's excel and find the EOR like this:

standard house edge
CARD -0.16683572 EOR
A -0.167159715 -0.00032399
2 -0.167119596 -0.00028388
3 -0.167772142 -0.00093642
4 -0.167085144 -0.00024942
5 -0.166982297 -0.00014658
6 -0.171987132 -0.00515141
7 -0.163138636 0.00369708
8 -0.163597636 0.00323808
9 -0.164252134 0.00258359
10 -0.167442484 -0.00060676
these EORS is as effective as dragon 7, but then house edge is high, then start at true count +7.
in macau, 1 deck is cut, then no one wants to count it, i guess.

can anybody help me to check if it is right? (by the say, i used it to do a lot of eors for some other asia bac side bets.)