Thread Rating:

codemann8
codemann8
  • Threads: 1
  • Posts: 2
Joined: Feb 25, 2018
February 25th, 2018 at 3:56:12 AM permalink
I'm a software engineer and it's been a lifelong hobby of mine to play BJ. Over the years, I've incorporated a hi/lo counting strategy and I've become quite successful at profiting from it.

As a means to further refine my strategy, I've been developing my own home-brew side-project BJ simulator program and having it be versatile enough to handle different variations and table options like number of decks, if doubling after splitting is allowed, etc. And I also allow for multiple Betting and Playing strategies and the combination of the both strategy types can certainly be strategies of their own, however I have separated the two. Eventually I will incorporate other random factors such as other players joining and leaving the table at will, dealer and deck changes (spontaneous reshuffles), and an error tolerance on the exact location that the dealer is putting the cut card...just to simulate as close to the real thing as I can. I also have a chart at the bottom that will show the player's chip balance over the number of rounds that have completed, something to display the performance of a certain strategy.

As I'm building this program, I started with a simple Bet Strategy fixed $100 bet (bet is always $100 no matter what) and for the Play Strategy I plugged in the logic rules for a strategy chart card that I had received from a casino long ago (I assume it's for a 6 deck shoe). Upon running the simulator several times, I was somewhat pleased with the results. Of course, since this is a casino game that we're talking about, the trend is always a downward trend, especially if I'm keeping the bet the same and I haven't even worked in any card counting yet.

My first example I tried a simple SD H17 game, BJ pays 3:2, the game I most often play in real life. At first, I was starting myself out with $5000 bankroll and $100 fixed bet. Running this a couple times resulted in lasting about 4k rounds (rounds; I try not to say hands because technically a split results in another hand within the same round) on average, my longest run lasted a whopping 35k rounds. Then, I found this site, and I decided to look up the strategy chart specially for this SD H17 scenario and I plugged all the logic in. Upon running this simulation, the same $5000 starting bankroll was consistently only lasting around 500-800 rounds (significantly less than the 4k average I was getting on the strategy on the card I already had (for an unknown scenario of game).

In an attempt to better compare the two strategies, I then increased the starting bankroll to $100k, to get a better consistent trend line in my chart. I ran the simulator a number of times using WOO's (WOO=WizardOfOdds) strategy and it was consistently lasting anywhere from 10k-11k rounds and the trend line is a pretty straight line. I'm in the process of re-running the old strategy from the card at a $100k balance and it's currently at around 60k rounds and a balance of $60k and still rolling, this trend line has a bit more volatility to it, although it's not too wild. Unfortunately, it would seem that my simulator is no quick process and I haven't used any other simulator programs either so I'm not sure how mine compares to others (mine's about 5 minutes for each 20k rounds) so I'm a little limited to smaller sample sizes.

Phew. After all that, my real question is: Why the huge difference between the strategies? And why wouldn't the strategy on WOO that's tailored for this specific game not perform better, much less significantly worse than the presumed 6-deck strategy I originally plugged in? How are these strategy charts calculated? What am I missing? Is it possible that the strategy on WOO only works for the first round/deal out of the deck, and subsequent rounds should take a different strategy?
mustangsally
mustangsally
  • Threads: 25
  • Posts: 2463
Joined: Mar 29, 2011
February 25th, 2018 at 7:59:33 PM permalink
Quote: codemann8

My first example I tried a simple SD H17 game, BJ pays 3:2, the game I most often play in real life.
At first, I was starting myself out with $5000 bankroll and $100 fixed bet.

ok. 5000/100=50 units.
Quote: codemann8

Running this a couple times resulted in lasting about 4k rounds (rounds; I try not to say hands because technically a split results in another hand within the same round) on average,
my longest run lasted a whopping 35k rounds.

I have many BJ payout distributions I just placed into code and set up using the free program R.
and it worked!
Of course, I made 3 different mistakes (like i-1 should be i+1)
and had to find them, and did.
I first set up Excel with my Markov chains so I know something was off.
data below

> startBr #index number. 50 units used
[1] 99
> bankroll_target
[1] 400
>
> ##### raise to a power and sum goal, ruin, play
> A=P%^%4000 #change power here
> states
[1] 816
>
> ARuin <- A[startBr, c(states,states - 1)]
> print(sum(ARuin))
[1] 0.611908
> #ARuin
>
> targetEnd <- states - 2 # end target cell
> AGoal <- A[startBr, c(target:targetEnd)]
> print(sum(AGoal))
[1] 3.320994e-07
> #AGoal
>
> APlay <- 1 - (sum(ARuin) + sum(AGoal))
> APlay
[1] 0.3880917
>
*****
> startBr #index number. 50 units used
[1] 99
> bankroll_target
[1] 400
>
> ##### raise to a power and sum goal, ruin, play
> A=P%^%10000 #change power here
> states
[1] 816
>
> ARuin <- A[startBr, c(states,states - 1)]
> print(sum(ARuin))
[1] 0.807468
> #ARuin
>
> targetEnd <- states - 2 # end target cell
> AGoal <- A[startBr, c(target:targetEnd)]
> print(sum(AGoal))
[1] 0.0004184655
> #AGoal
>
> APlay <- 1 - (sum(ARuin) + sum(AGoal))
> APlay
[1] 0.1921136
>
*****
> startBr #index number. 50 units used
[1] 99
> bankroll_target
[1] 400
>
> ##### raise to a power and sum goal, ruin, play
> A=P%^%20000 #change power here
> states
[1] 816
>
> ARuin <- A[startBr, c(states,states - 1)]
> print(sum(ARuin))
[1] 0.9036767
> #ARuin
>
> targetEnd <- states - 2 # end target cell
> AGoal <- A[startBr, c(target:targetEnd)]
> print(sum(AGoal))
[1] 0.004217431
> #AGoal
>
> APlay <- 1 - (sum(ARuin) + sum(AGoal))
> APlay
[1] 0.09210591
>
*****
> startBr #index number. 50 units used
[1] 99
> bankroll_target
[1] 400
>
> ##### raise to a power and sum goal, ruin, play
> A=P%^%35000 #change power here
> states
[1] 816
>
> ARuin <- A[startBr, c(states,states - 1)]
> print(sum(ARuin))
[1] 0.952458
> #ARuin
>
> targetEnd <- states - 2 # end target cell
> AGoal <- A[startBr, c(target:targetEnd)]
> print(sum(AGoal))
[1] 0.009809972
> #AGoal
>
> APlay <- 1 - (sum(ARuin) + sum(AGoal))
> APlay
[1] 0.03773199
>
>

summary:
for 4,000 rounds of play (calculated)
[1] 0.611908 <<<this is close to the average # of rounds (I would guess about 63%)
> #ARuin
for 10,000 rounds of play (calculated)
[1] 0.807468
> #ARuin
for 20,000 rounds of play (calculated)
[1] 0.9036767
> #ARuin
for 35,000 rounds of play (calculated)
[1] 0.952458
> #ARuin

summary:
I think your 1st sim runs was done correctly as it looks like my results may be close to yours.
Quote: codemann8

Then,<snip>

I hope you found the problem(s). sometimes looking at a big difference
a few times makes it easier to see why.

I just had to finish my R code
(will not show now as it is still messy)
now I got somethings done, in a good way.

Sally
I Heart Vi Hart
codemann8
codemann8
  • Threads: 1
  • Posts: 2
Joined: Feb 25, 2018
February 25th, 2018 at 9:02:25 PM permalink
My question is why the WOO strategy drastically performs worse than the original presumed 6-deck strategy? I'm trying to get an understanding of how these strategy charts are calculated and how they should be implemented (if not to simply apply it in ALL hands on a single deck, which is what I'm currently doing).

Also, I cannot edit my OP, that simulation finished. $100k with $100 bet on the old strategy lasted 286k rounds. It was lasting 10k-11k rounds consistently under WOO strategy.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6743
Joined: Jun 22, 2011
February 26th, 2018 at 6:58:10 AM permalink
Quote: codemann8

My question is why the WOO strategy drastically performs worse than the original presumed 6-deck strategy? I'm trying to get an understanding of how these strategy charts are calculated and how they should be implemented (if not to simply apply it in ALL hands on a single deck, which is what I'm currently doing).


Could be any number of things, including:
1. You entered one of the two strategies wrong;
2. Your simulator is not as accurate as you think;
3. The WoO strategy you are using does not correspond to your conditions.

Pardon me for asking but (a) what is the "presumed" 6-deck strategy, and (b) what WoO strategy are you using?

You can put them in a spoiler tag so that they do not take up too much space for the people who don't want to see them, like this:

[spoiler=Click Here for the Spoiler]Hidden Text Goes Here[/spoiler]

Hidden Text Goes Here
gordonm888
Administrator
gordonm888
  • Threads: 61
  • Posts: 5375
Joined: Feb 18, 2015
February 26th, 2018 at 11:06:57 AM permalink
The anomalous results you are getting are absolutely not being caused by errors in the posted WOO strategies. Believe me, there are an enormous number of analysts that have independently modeled blackjack and who have independently verified the major BJ strategies posted on WOO.

A non-WOO calculator that calculates the EV of any player action for any combination of player/dealer cards plus any combination of cards remaining in the deck and for most possible variations in rules is Here . (Note: this calculator has previously been recommended by J.B, an administrator on this site, so I assume its okay to post this link.) This BJ Hand calculator also provides the dealer's hand probabilities for any situation you specify. Play around with it and evaluate any strategy decision you want.

Deficiencies in WOO Strategies The Blackjack strategies on the WOO site are generally 100% correct for a fresh shoe. They do ignore the fact that, for less than 1% of all decisions, the strategy does change with shoe penetration. But you can get a feel for that by comparing 8 deck strategy with similar strategies for 2 decks and 1 deck. Also, some (but not all) posted strategies ignore precise hand composition (example: a multi-card 16vT may sometimes have a different strategy than a (T-6) vT depending upon the cards left in the shoe.) Also, in some weird situations, strategies for decisions on splitting pairs can change after you have re-split pairs many times, and that is often not captured in the WOO strategies. These are all very minor issues.
***********
Finally, I would recommend that you collect information on average player EV during your simulation runs, and maybe on some outcomes such as number of cards dealt per hand. These kinds of "results" can often illuminate where your problem is.

Also, 5 minutes for 20K hands sounds a bit slow. Many people simulate 1M or more BJ hands in reasonably short time periods.
So many better men, a few of them friends, are dead. And a thousand thousand slimy things live on, and so do I.
mustangsally
mustangsally
  • Threads: 25
  • Posts: 2463
Joined: Mar 29, 2011
February 26th, 2018 at 1:31:18 PM permalink
Quote: ThatDonGuy

Could be any number of things, including:
1. You entered one of the two strategies wrong;
2. Your simulator is not as accurate as you think;
3. The WoO strategy you are using does not correspond to your conditions.

yes, I have to agree also with your above thoughts.

errors do have a funny way of creeping into code when one least expects it.

I ran 4 different sims
with 2 different programs
and 2 different 6 deck basic strategy charts (one from the WoO)
and all returned the same very close ruin values for 4000 rounds of play
that I calculated in R.

[1] 0.611908
> #ARuin

ruin in photo is at 61.2%


there was an online sim for BJ but I notice it is now pay to use and has been changed.
so can not use that one for now

If OP finds the error(s) in own code. Then
Yahoo!
Else
UK (Kentucky) wins the NCAAB Big Dance in March
End If

good luck!
Sally
I Heart Vi Hart
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 3017
Joined: Jun 17, 2011
February 28th, 2018 at 3:00:27 PM permalink
When I built my own BJ simulator one of the problems is proving the random bits (creating random numbers and shuffling the deck). You have to be inventive and check these before using the process to deal BJ. One way is to use the process to run things like Craps or estimating Pi. Once I even used higher or lower and found a bug when comparing (1st with 2nd, 3rd with 4th) and (1st with 3rd, 2nd with 4th). Another way is to get the same EV for games such as Punto Banco.

Checking whether the strategy is correct can be done by adding trace entries and/or zapping the deck.
  • Jump to: