autonymity
autonymity
  • Threads: 1
  • Posts: 2
Joined: May 13, 2024
May 13th, 2024 at 4:23:21 PM permalink
Can anyone help me with the calculation for variance/standard deviation and N0 in blackjack basic count game? I’m an AP creating a blackjack/card counting simulator for a programing assignment at school and I’m having trouble getting these calculations to be mathematically correct. I know that I can assume that the mean is virtually zero, so my current strategy is to take the gain of each round, square it, add it to a running total, and then divide that by the total number of rounds at the end to get SD. However, this may be mathematically incorrect as I'm not taking into consideration the bets placed at each true count that resulted in this number? Additionally, I want to have functionality for wonging out/entering at specific counts, and I wonder if sitting out rounds is effecting the equation? And finally, I'm not sure how to deal with the result of a round where the player has multiple hands on the table (either from splitting or spreading to two hands) - it seems that the variance calculation might not be as simple as total gain of round^2? How to extrapolate that to N0 and risk is also a mystery to me… Thanks for any help.
Mental
Mental
  • Threads: 14
  • Posts: 1502
Joined: Dec 10, 2018
May 13th, 2024 at 5:24:36 PM permalink
Quote: autonymity

Can anyone help me with the calculation for variance/standard deviation and N0 in blackjack basic count game? I’m an AP creating a blackjack/card counting simulator for a programing assignment at school and I’m having trouble getting these calculations to be mathematically correct. I know that I can assume that the mean is virtually zero, so my current strategy is to take the gain of each round, square it, add it to a running total, and then divide that by the total number of rounds at the end to get SD. However, this may be mathematically incorrect as I'm not taking into consideration the bets placed at each true count that resulted in this number? Additionally, I want to have functionality for wonging out/entering at specific counts, and I wonder if sitting out rounds is effecting the equation? And finally, I'm not sure how to deal with the result of a round where the player has multiple hands on the table (either from splitting or spreading to two hands) - it seems that the variance calculation might not be as simple as total gain of round^2? How to extrapolate that to N0 and risk is also a mystery to me… Thanks for any help.
link to original post


You need to decide what you want to calculate. There is no well-defined 'variance' for a hand of blackjack played with a count and a bet spread. Every single hand in the shoe will might have a different variance because the count and bet size both affect variance. In particular, the variance increases as the bet squared (bet^2). The hands that you sit out contribute zero to the overall variance. If you don't ever sit out, but start each show with a min bet, then these first hands will provide the lowest contribution to overall variance. The hands that you play just before the cut card will contribute the most to overall variance.

You can define a variance per shoe. Just simulate hundreds of shoes and take the net W/L outcomes of each shoe and put them in a variance calculator in a spreadsheet. The spreadsheet will correct for the players's edge (which you are not correcting for in your calculation). This variance per shoe result will depend on the number of decks, the rules, the count system, and the penetration.

If you want to calculate an effective variance per hand, you can just divide by the average number of hands in a shoe. This effective variance per hand doesn't mean much. What the gambler will care about is the variance per shoe. He doesn't really care that the variance ramps up as the shoe plays out.
Gambling is a math contest where the score is tracked in dollars. Try not to get a negative score.
aceside
aceside
  • Threads: 2
  • Posts: 563
Joined: May 14, 2021
May 13th, 2024 at 5:49:01 PM permalink
I agree with what Mental says above. The variance of a blackjack hand is almost a fixed number of 1.3, no matter what the rules are. There is not much stretch to do here. What is the purpose of this study? How does this help the gamblers here?
autonymity
autonymity
  • Threads: 1
  • Posts: 2
Joined: May 13, 2024
May 13th, 2024 at 6:05:11 PM permalink
Thanks for replying. I'm referencing DS's Blackjack Attack Ed3 I would like to run an example by you and see if my sim would be correctly calculating the SD, and then ask just a couple follow up questions:

I would do the following following:
To get the bet squared parameters I would take (total-hand-bet/min-bet)^2
The frequency would be determined by total amount of times count occurred/number of rounds simmed
The variance would be determined Sigma((gain for hand at count)^2)/(number of rounds that count occurred in the sim - 1)
The SD for one hand would be sqrt(sum of products/sum of frequencies) * min-bet

I will fill the following chart in with some dummy numbers to make sure I understand the general procedure
*keep in mind my sim never allows differing bets below TC -3 or above TC 7

Say I am playing a game where I bet nothing at a count below 1, bet 1x$25 at count TC 1, 2x$100 at TC 2, and 2x$200 at TC 3:
Count Bet-squared Hands Frequency Variance Product
-3- 0 0 0 1.3 0
-2 0 0 0 1.3 0
-1 0 0 0 1.3 0
0 0 0 0 1.3 0
1 1 1 .1 1.3 .13
2 16 2 .06 1.8 3.456
3 64 2 .03 1.8 6.912
4 64 2 .02 1.8 4.608
5 64 2 .01 1.8 2.304
6 64 2 .005 1.8 1.152
7+ 64 2 .004 1.8 .9216

one-round SD = sqrt(19.4836/.229) * $25 = $230.60
hourly SD (at 100RPH) = $240.6 * sqrt(num rounds at counts 1-7+ per hour) = $240.6 * sqrt(sum of frequencies of counts 1-7+ * 100) = $1151.37/hour

My follow up questions are
1) Is this calculation of unit size as being my lowest bet correct or should it be the average bet I place?
2) Is my method for figuring out variance at a specific count correct, and how would covariance be calculated? (I'm guessing at 1.3 and 1.8, but would like to generate the exact values)
3) Why don't hands where the player splits have to account for co-variance?
4) Can I use the same strategy for play-all and gambler flat bet approaches?

Thanks so much!
Mental
Mental
  • Threads: 14
  • Posts: 1502
Joined: Dec 10, 2018
May 13th, 2024 at 6:54:21 PM permalink
Quote: autonymity

Thanks for replying. I'm referencing DS's Blackjack Attack Ed3 I would like to run an example by you and see if my sim would be correctly calculating the SD, and then ask just a couple follow up questions:

I would do the following following:
To get the bet squared parameters I would take (total-hand-bet/min-bet)^2
The frequency would be determined by total amount of times count occurred/number of rounds simmed
The variance would be determined Sigma((gain for hand at count)^2)/(number of rounds that count occurred in the sim - 1)
The SD for one hand would be sqrt(sum of products/sum of frequencies) * min-bet

I will fill the following chart in with some dummy numbers to make sure I understand the general procedure
*keep in mind my sim never allows differing bets below TC -3 or above TC 7

Say I am playing a game where I bet nothing at a count below 1, bet 1x$25 at count TC 1, 2x$100 at TC 2, and 2x$200 at TC 3:
Count Bet-squared Hands Frequency Variance Product
-3- 0 0 0 1.3 0
-2 0 0 0 1.3 0
-1 0 0 0 1.3 0
0 0 0 0 1.3 0
1 1 1 .1 1.3 .13
2 16 2 .06 1.8 3.456
3 64 2 .03 1.8 6.912
4 64 2 .02 1.8 4.608
5 64 2 .01 1.8 2.304
6 64 2 .005 1.8 1.152
7+ 64 2 .004 1.8 .9216

one-round SD = sqrt(19.4836/.229) * $25 = $230.60
hourly SD (at 100RPH) = $240.6 * sqrt(num rounds at counts 1-7+ per hour) = $240.6 * sqrt(sum of frequencies of counts 1-7+ * 100) = $1151.37/hour

My follow up questions are
1) Is this calculation of unit size as being my lowest bet correct or should it be the average bet I place?
2) Is my method for figuring out variance at a specific count correct, and how would covariance be calculated? (I'm guessing at 1.3 and 1.8, but would like to generate the exact values)
3) Why don't hands where the player splits have to account for co-variance?
4) Can I use the same strategy for play-all and gambler flat bet approaches?

Thanks so much!
link to original post

Your product seems to include the number of hands. That is not right. Playing two hands with an increased variance of 1.8 already accounts for the two hands.

For example, (6): 64 * .005 * 1.8 = 0.567

If you are doing sims, why not just track the total W/L per shoe and just calculate the variance of that? Even if you want to calculate the variance analytically, this will provide a quick sanity check that your variance is in the right ballpark.

If it is your own sim, you should be able to get this W/L output to send to a spreadsheet (or calculate variance internally). If it is not your sim code, this may be harder to do.

Also: one-round SD = sqrt(19.4836/.229) * $25 = $230.60 seems wrong.
Maybe one-round SD = sqrt(19.4836) * $25 = $110?
You are just adding variance contributions. There is no need to normalize the variance.
Gambling is a math contest where the score is tracked in dollars. Try not to get a negative score.
ChumpChange
ChumpChange 
  • Threads: 122
  • Posts: 5009
Joined: Jun 15, 2018
Thanked by
aceside
May 13th, 2024 at 7:12:05 PM permalink
How many hands are you going to sit out if you only play positive counts of +1 or better? You can't really walk out of 75% of the hands. I think people Wong-out at -1 or -2 counts because they are there to play and the clock is ticking with the pit. On my home game I usually win much more money on negative counts anyway and positive counts are the big losers but I don't bet like the card counters trying to eek the 0.5% or 1.5% advantage with their play. But you've gotta wait for the cut card if you want the variance to catch up with you, of course a bad shoe could cause you to leave the table mid-shoe anyway. I may not have the option to go to another table because of table minimums being too high elsewhere or the tables being too crowded or I've got a hundred chips I don't want to color up and move to another table. The national casino crackdown on card counters is severe, it doesn't seem like an occupation that can last more than a couple years.
aceside
aceside
  • Threads: 2
  • Posts: 563
Joined: May 14, 2021
May 14th, 2024 at 6:57:28 AM permalink
You are saying there is a national crackdown on card counters. Really? First time I am hearing about this.
ChumpChange
ChumpChange 
  • Threads: 122
  • Posts: 5009
Joined: Jun 15, 2018
May 14th, 2024 at 10:06:58 AM permalink
You get banned from Caesar's, there's no telling how many casinos across the country that means. The casinos also flyer each other about players overnight so when you show up the next day at another casino you're already banned when you walk in the door. I'd stick to Spanish 21, nobody seems to get banned for that game. Blackjack seems to be the easiest excuse casinos have to ban anybody for no reason, and they will give you no reason, it's a trap. Also have to brush up on other games if they say you can play any game besides blackjack, so there's baccarat and craps.
Mental
Mental
  • Threads: 14
  • Posts: 1502
Joined: Dec 10, 2018
May 14th, 2024 at 10:16:32 AM permalink
Quote: ChumpChange

You get banned from Caesar's, there's no telling how many casinos across the country that means. The casinos also flyer each other about players overnight so when you show up the next day at another casino you're already banned when you walk in the door. I'd stick to Spanish 21, nobody seems to get banned for that game. Blackjack seems to be the easiest excuse casinos have to ban anybody for no reason, and they will give you no reason, it's a trap. Also have to brush up on other games if they say you can play any game besides blackjack, so there's baccarat and craps.
link to original post

Have you been banned for playing BJ at any property?
Gambling is a math contest where the score is tracked in dollars. Try not to get a negative score.
ChumpChange
ChumpChange 
  • Threads: 122
  • Posts: 5009
Joined: Jun 15, 2018
May 14th, 2024 at 10:19:07 AM permalink
No, I just watch numerous YouTube videos of people getting banned for playing blackjack. Being a master of disguise doesn't really work when you have to show ID to cash out at the cage.
aceside
aceside
  • Threads: 2
  • Posts: 563
Joined: May 14, 2021
May 14th, 2024 at 10:30:26 AM permalink
I actually believe your are right! There are not many fair Blackjack games out there in this country. Casinos are still mafias today.
Mental
Mental
  • Threads: 14
  • Posts: 1502
Joined: Dec 10, 2018
May 14th, 2024 at 2:18:30 PM permalink
Quote: aceside

I actually believe your are right! There are not many fair Blackjack games out there in this country. Casinos are still mafias today.
link to original post

The mafia never subjected itself to heavy regulatory oversight of every aspect of its operations. I assume all of the US regulated casinos that I play at are dealing table games fairly and are providing RTP values that are correct (or understate the optimum RTP). Every online BJ hand is logged. If they are cheating me, they are providing me all the evidence that I would need to prove it in court.

I do have major losing streaks from time to time. It is still gambling after all. I lost $250K at one casino over a short period of time. I expect to have losing streaks of a few std dev from time to time. I never attribute my losing streaks to cheating. But my online lifetime RTP has been somewhat better than I had any right to expect. I am on an enormous heater this year. If the casinos would want to cheat anyone, they should be cheating me.

If you don't play a big +EV opportunity because you are worried about getting cheated or banned, you are only hurting yourself.
Gambling is a math contest where the score is tracked in dollars. Try not to get a negative score.
  • Jump to: