lol jk
The real question is how do I simulate games the way wizard does. I have decent programming background. Does he use a special program?
I'm not talking about CVBJ, that's for blackjack only.
Wizard seems to be able to simulate literally just about any game with just about any set of rules. And I want to be able to do the same. For the games he hasn't simulated, I would like to do so myself.
Anyone able to help?
[Edit: C coding is best for game simulation. If you want to put a graphical interface up front there are dozens of tools available for that part of the work with different styles and suited to particular environments. ]
Quote: IWannaBeAPHow do I become as cool as the wizard.
lol jk
The real question is how do I simulate games the way wizard does. I have decent programming background. Does he use a special program?
I'm not talking about CVBJ, that's for blackjack only.
Wizard seems to be able to simulate literally just about any game with just about any set of rules. And I want to be able to do the same. For the games he hasn't simulated, I would like to do so myself.
Anyone able to help?
link to original post
I would say start by writing a game, Write yourself a simple blackjack or roulette game. Once you can do that you probably have enough skills to write a simulation.
When I was learning to program and wanted to learn a new programming language I would write a game to learn it. I have developed more Asteroids, Pacman, and video poker than I can count.
He codes the sims himself, from scratch. That's one reason he's been able to analyze games that few to no others have analyzed.Quote: IWannaBeAPThe real question is how do I simulate games the way wizard does.... Does he use a special program?
link to original post
I wrote my blackjack sim years ago in Java because the interpreted languages like Javascript and LiveCode weren't fast enough, but I bet these days they're fast enough on modern computers for most purposes, and development time is much faster in interpreted languages. With Java, I spent more time debugging than coding.
So Wizard writes everything from scratch from C for each game? No special program?
Quote: ThatDonGuyI do my share of simulations, and I use Visual C#, which is part of Microsoft Visual Studio, which you can download for free.
link to original post
can you share an example of a simulation you did?
Excel is all I have. Not a programmer
That is literally what I just said, except I didn't identify what language he uses. I presume he still uses C, but I don't know for sure.Quote: IWannaBeAPSo Wizard writes everything from scratch from C for each game? No special program?
link to original post
Okay, I posted the link to the code for the Java-based blackjack sim at the bottom of the Blackjack page on Easy Vegas. I wrote it 12 years ago, haven't used it since, just tested it and it still runs. I will provide exactly zero support for the code, you're on your own.Quote: IWannaBeAPcan you share an example of a simulation you did?
Running it from the terminal, here's some sample output:
M rounds EV Bankroll InitialBets
5M -0.3143% -31434.0 9,999,998
10M -0.2793% -55857.0 19,999,998
15M -0.2547% -76423.0 29,999,998
I'm skeptical that blackjack could be worked up in Excel to do millions of trials, but I'm not an Excel expert. Are you able to provide an example? Even better would be Google Sheets, though I know it's not as powerful as Excel.Quote: Ace2You can do almost everything in excel. Very easy to use the random function and generate millions of trials.
It gets closer to that every year, but I think there’s still a huge difference. A comparison of execution time between Java, Python, and C is given here. In general, based on the study, what takes 10 hours to run for C will take 17 hours for Java and 56 hours for Python. If, like me, it takes you several iterations to get something right then the execution speed becomes more important than the ease of design. (btw, Excel’s speed comparison would wind up being something like that of a chihuahua’s in a greyhound race, imho.)Quote: MichaelBluejay… I bet these days [interpreted languages are] fast enough on modern computers for most purposes, and development time is much faster in interpreted languages. …
link to original post
In summary, The Wizard chose his programming tool wisely based on the need to crank out millions of simulation runs.
[Edit: grammar correction]
You have a 43% chance of winning each hand with a payoff of 1.31 to 1.
Edge of 67 bps, SD of 1.14. Plenty accurate for my calculations, which are usually figuring how much bankroll I need for a certain level/length of play
True, but my point was, six times slower could still be fast enough. Based on how fast my Java sim ran on my old computer and my new computer, and how fast my LiveCode sim ran on my old computer, I estimate that LiveCode could sim 1.5 million rounds per minute. That would be plenty for lots of applications. I suspect Javascript and Python would be even faster.Quote: BleedingChipsSlowlyIn general, based on the study, what takes 10 hours to run for C will take 17 hours for Java and 56 hours for Python.
link to original post
That's more like an estimation than a simulation. A true simulation lets you change parameters to test things. For example, my blackjack sim can be modified to do things like find the penalty for strategy deviations, or the efficacy of card-counting systems.Quote: Ace2Another very easy way to simulate blackjack:
You have a 43% chance of winning each hand with a payoff of 1.31 to 1.
Edge of 67 bps, SD of 1.14
link to original post
Quote: Ace2Another very easy way to simulate blackjack:
You have a 43% chance of winning each hand with a payoff of 1.31 to 1.
Edge of 67 bps, SD of 1.14. Plenty accurate for my calculations, which are usually figuring how much bankroll I need for a certain level/length of play
link to original post
I’ve read this a few times but still don’t understand what you are talking about.
What is this 1.31 to 1 payoff? It looks like you are talking about an expected win amount of 1.31 for each 1-unit-bet winning hand, but this number doesn’t sound right.
A simulation of play would provide the information used in this calculation. As MichaelBluejay pointed out, the calculation is an application of the simulation information in the context of this thread.
Quote: BleedingChipsSlowlyThe expected win is 1.31 per 1 wagered for 43% of hands played. So (1.31 + 1) * 0.43 = 0.9933 expected value (EV) for a wager if one, a house edge of 0.67%.
link to original post
I am confused here, but we need both the win rate and the loss rate to calculate the house edge. The win rate is 43%, the loss rate is 50%, and the tie rate is 7%. Let us set the expected win amount of each winning hand as x, then we have
50%*1 - 43%*x = 0.67%.
This gives x=1.15.
He loops through every possible combination of cards (once), accumulating statistical outcome information.
Absent a specific mention of pushes, I went with the theory that pushes are classified as a win. The resulting 0.67% house edge is in line with 6:5 red chip tables and stadium games. I could be wrong. Perhaps Ace2 will clarify.Quote: acesideQuote: BleedingChipsSlowlyThe expected win is 1.31 per 1 wagered for 43% of hands played. So (1.31 + 1) * 0.43 = 0.9933 expected value (EV) for a wager if one, a house edge of 0.67%.
link to original post
I am confused here, but we need both the win rate and the loss rate to calculate the house edge. The win rate is 43%, the loss rate is 50%, and the tie rate is 7%. Let us set the expected win amount of each winning hand as x, then we have
50%*1 - 43%*x = 0.67%.
This gives x=1.15.
link to original post
Such a bet is statistically congruent to blackjack. It will give you essentially the same results, variance and RoR as blackjack as long as your sample size is above about 100 hands. But it’s much easier to do calculations for this simple bet since there is no splitting, doubling, pushes, blackjacks or surrendering.
It’s pretty easy to manually calculate the effect of many strategy deviations and then modify the 0.43 and 1.31 as needed. But that combination, giving and edge/SD of 0.67% / 1.14, is pretty accurate for most 3:2 games.
For strategy deviations, I always assume infinite deck which makes the calculations much easier. I’ve found that as long as more than two decks are being used, the infinite deck answer is within a couple basis points of the exact answer
Yep, just like craps. All you gotta do is turn off bets right before a 7 is rolledQuote: ChumpChangeSo you just have to bet on the 43% of hands that actually win something. The other 57% can be skipped through mnemonic intrigue.
link to original post
Simulations are useful to verify combinatorial results, aka running a cycle, but sometimes they are the only option. For example, in collusion computations, I mostly use simulations.
A complete combinatorial analysis means that I look at every possible situation that can occur in the game and account for it. This is absolutely the preferred method, and I use it for most games, even for advantage play methods like hole-carding and edge sorting. For card counting, I use simulation. Certain promotions have closed formulas that approximate the result, but it's also useful to simulate them, especially promotions like loss rebates.
For lame ideas like betting progressions, stop loss, and those who claim they can beat negative edges by some type of voodoo, I just tell the person the Earth is not flat and please go away.
Mike is pretty much the same, I doubt anything I've said above contradicts his own methodologies.
If you want the absolute fastest though you would use FORTRAN. It is still what the nuclear industry uses for Monte Carlo simulations and is afaik still the gold standard. Problem is the last time I messed with FORTRAN code was 11 years ago and i would basically have to re-learn it. I have some worry that it may be harder to code, but if it is the most efficient to run random events in a nuclear reactor model, it should be the most efficient in running random generators for gambling.
The most complicated thing i have done so far is craps, but if you are able to convert all the rules into code I don't see why it shouldn't be easy to sim anything you want in excel or any normal programming language.
Excel for Easy, FORTRAN for Fast.
Why would you need to program/simulate anything for craps? Those calculations are so easy you can do them in your headQuote: Talldude90
The most complicated thing i have done so far is craps, but if you are able to convert all the rules into code I don't see why it shouldn't be easy to sim anything you want in excel or any normal programming language.
Betting systems. I’ll get my coat…Quote: Ace2Why would you need to program/simulate anything for craps? Those calculations are so easy you can do them in your head
link to original post
Disclaimer, I totally believe no betting system can lower the HE. Doesn't mean I don't wanna play with sims ;) .
Edit (thanks aceside): The above disclaimer is only in relation to bets that don't have exploitable information (for example removal of cards to a discard pile or variable state games).
Quote: Talldude90Disclaimer, I totally believe no betting system can lower the HE. Doesn't mean I don't wanna play with sims ;) .
link to original post
This is over stretched. In blackjack shoe games, you definitely need a betting system to beat this game.
The random number generator that comes with Excel (and is used in VBA) has a cycle of length 2^24 = 16,777,216, (as I recall), which makes VBA and Excel unusable for any large simulation of pretty much anything without programing your own RNG. Fortunately, strong long cycle RNGs are fairly easy to code.Quote: Talldude90In the small amount I have done so far I have used Excel. You can get about 1 million results in about 3 seconds (including the paste value of the results into a table which then causes the sheet to re-calculate for another 1M results). If you have a gaming mouse or a more elegant solution you can have the paste values portion automated and the "program" continue to run on it's on at the cost of not being able to use that computer for ANYTHING else till you get the number of sims you want.
If you want the absolute fastest though you would use FORTRAN. It is still what the nuclear industry uses for Monte Carlo simulations and is afaik still the gold standard. Problem is the last time I messed with FORTRAN code was 11 years ago and i would basically have to re-learn it. I have some worry that it may be harder to code, but if it is the most efficient to run random events in a nuclear reactor model, it should be the most efficient in running random generators for gambling.
The most complicated thing i have done so far is craps, but if you are able to convert all the rules into code I don't see why it shouldn't be easy to sim anything you want in excel or any normal programming language.
Excel for Easy, FORTRAN for Fast.
link to original post
Good on you for programming in Fortran, I used that up until about 1984 on punch cards. Sometime later I upleveled from punch cards to an ADM-5. That 300 BAUD modem was lightning fast.
(1) Not all of us can do the calcs in our head, or even on paper. Some of us can code but aren't skilled in math.Quote: Ace2Why would you need to program/simulate anything for craps? Those calculations are so easy you can do them in your head
link to original post
(2) Disproving betting systems. Sure, the math-literate know the EV is total bets x the house edge of the bet, but that's not convincing to someone who thinks that varying bets can affect the EV. For them, a sim is required to actually *play* the game to show that the system fails. (Sure, some betting system believers won't accept even the results of a sim, because they think that computer-simmed results aren't the same as real-world results, but there's only so much you can do.) Here's one such sim I made to disprove a betting system suggested by a forum member here.
(3) For a given betting strategy (e.g. various bet sizes on various bets), you might want to find out things like the 10th, 25th, 50th, 75th, and 90th percentile results. Maybe that could be calculated, but it seems easier to code a sim.
Quote: teliot
Good on you for programming in Fortran, I used that up until about 1984 on punch cards. Sometime later I upleveled from punch cards to an ADM-5. That 300 BAUD modem was lightning fast.
I learned to program in FORTRAN using punch cards on an old IBM 360 in the early 1980's. I also used it for a year or two doing medical image analysis on CAT scans and PET scans.
That sounds like a very bad combination for coding probability simulationsQuote: MichaelBluejaySome of us can code but aren't skilled in math.
As to programing back in the days of yore, FORTRAN was the 1st language I learned and used (1969 thru 1970) but then I switched to ALGOL (1971 to ~ 1976), then Assembler for various architectures, followed by C starting in 1982. There's probably about another dozen or so I've used since then but I take great satisfaction in never having learned COBOL.
Quote: Ace2Why would you need to program/simulate anything for craps? Those calculations are so easy you can do them in your headQuote: Talldude90
The most complicated thing i have done so far is craps, but if you are able to convert all the rules into code I don't see why it shouldn't be easy to sim anything you want in excel or any normal programming language.
link to original post
I wrote one to use in training an AI. I wanted to evaluate some ML optimization techniques and craps seemed like a good test case.
Quote: TumblingBones
As to programing back in the days of yore, FORTRAN was the 1st language I learned and used (1969 thru 1970) but then I switched to ALGOL (1971 to ~ 1976), then Assembler for various architectures, followed by C starting in 1982. There's probably about another dozen or so I've used since then but I take great satisfaction in never having learned COBOL.
I was sure you were going to say you programmed in 'B'. 1982 is much earlier than I started using 'C'. Probably 1987 for me. Yes, COBOL was my second language.
Quote: teliotThe random number generator that comes with Excel (and is used in VBA) has a cycle of length 2^24 = 16,777,216, (as I recall), which makes VBA and Excel unusable for any large simulation of pretty much anything without programing your own RNG. Fortunately, strong long cycle RNGs are fairly easy to code.
Good on you for programming in Fortran, I used that up until about 1984 on punch cards. Sometime later I upleveled from punch cards to an ADM-5. That 300 BAUD modem was lightning fast.
link to original post
So, does this mean that it repeats itself after 1.68E7 uses? The methodology I was using had randbetween(x,x) in column A for 100k rows. I took the end results and paste-valued them which caused a re-calc each time I pasted the final result. On a couple of the sheets I did 1E6 at a time, but I preferred doing 100k at the time so I didn't have to wait on the calculating. One weird thing, the bottom of the screen said it was using 12 cores, and I couldn't do anything in Excel till it finished (a few seconds) but task manager only showed the % going up on CPU utilization to about 50%.
Quote: Talldude90Quote: teliotThe random number generator that comes with Excel (and is used in VBA) has a cycle of length 2^24 = 16,777,216, (as I recall), which makes VBA and Excel unusable for any large simulation of pretty much anything without programing your own RNG. Fortunately, strong long cycle RNGs are fairly easy to code.
Good on you for programming in Fortran, I used that up until about 1984 on punch cards. Sometime later I upleveled from punch cards to an ADM-5. That 300 BAUD modem was lightning fast.
link to original post
So, does this mean that it repeats itself after 1.68E7 uses? The methodology I was using had randbetween(x,x) in column A for 100k rows. I took the end results and paste-valued them which caused a re-calc each time I pasted the final result. On a couple of the sheets I did 1E6 at a time, but I preferred doing 100k at the time so I didn't have to wait on the calculating. One weird thing, the bottom of the screen said it was using 12 cores, and I couldn't do anything in Excel till it finished (a few seconds) but task manager only showed the % going up on CPU utilization to about 50%.
link to original post
Did Microsoft improve their Excel rand() function in 2010?
See https://support.microsoft.com/en-us/office/rand-function-4cbfa695-8869-4788-8d90-021ea9f5be73
It looks like my information is old, I used Excel 2007 until about 2015. Now Excel uses the Mersenne Twister for its RNG which is as good as you'll ever need. That said, if you are simulating any betting systems or progressions, please just stop and use your considerable intelligence in a more worthwhile fashion.Quote: Talldude90So, does this mean that it repeats itself after 1.68E7 uses? The methodology I was using had randbetween(x,x) in column A for 100k rows. I took the end results and paste-valued them which caused a re-calc each time I pasted the final result. On a couple of the sheets I did 1E6 at a time, but I preferred doing 100k at the time so I didn't have to wait on the calculating. One weird thing, the bottom of the screen said it was using 12 cores, and I couldn't do anything in Excel till it finished (a few seconds) but task manager only showed the % going up on CPU utilization to about 50%.
https://support.microsoft.com/en-us/office/rand-function-4cbfa695-8869-4788-8d90-021ea9f5be73
Quote: camaplAm I the only one who learned PASCAL?
link to original post
I wrote some PASCAL today.
Dr. O'Neill, who developed the PCG algorithm, says that Mersenne Twister fails some statistical tests for quality (as does Wikipedia, but I didn't dig into the references). Unfortunately Dr. O'Neil's page where she compares various PRNG algos is a bit dated and doesn't include newer algos like Xorshiro128+, which I think is what most Javascript implementations use these days.Quote: teliotNow Excel uses the Mersenne Twister for its RNG which is as good as you'll ever need.
link to original post
Ahem. I just wrote a sim to show one of my readers that his conclusion about one of my articles was wrong. And as I said in an earlier post, I wrote a sim to show a member of this forum how his betting system didn't dent the house edge. Maybe you think we should ignore people with such delusions, and that's a valid argument, but sometimes I try to explain to people who seem like they have a capacity to learn. After all, a long time ago I used to believe the Gambler's Fallacy.Quote: teliotThat said, if you are simulating any betting systems or progressions, please just stop and use your considerable intelligence in a more worthwhile fashion.
Also, as I mentioned in another post, it could be useful to find the various Xth percentile results for various betting systems (especially comparing them to flat betting). And then there's evaluating card-counting systems. (You helped me with mine, twelve years ago.) There are various useful reasons to write betting-system sims.
On my page about me betting system challenge, I encourage would-be challengers in the strongest possible terms to have their idea SIM'd before doing the challenge and risking their money. I did get an inquiry a while back by someone who claimed that he *did* have his system coded and it beat the house, so I told him to send the code to me, but he said his partner coded it, and the partner died, and he no longer had access to it.
System believers have so many characteristics in common I made a post about them, Characteristics of a Betting System Believer. The relevant ones for this discussion are:
(25) Hasn't run a computer simulation.
(26) Can't run a computer simulation, because he doesn't know how.
(27) Unwilling to learn how to code a simulation (and unwilling to hire someone to do so).
Quote: MichaelBluejayThat reminds me of the very first sim I coded, probably 1984. In high school I read or heard something about how after flipping two heads in a row, tails was no more likely. My junior high school and high school didn't teach probability so I didn't have a starting point. On the one hand it seemed like any flip should be 50/50, but on the other, without any education, it also seemed plausible that tails had to be more likely for things to "even out". So I wrote a sim in BASIC to flip coins and I discovered, of course, that the coin has no memory, it doesn't matter what was flipped before. That convinced me about that particular case, but I continued to have misunderstandings about the gambler's fallacy in other cases for a couple more decades.
On my page about me betting system challenge, I encourage would-be challengers in the strongest possible terms to have their idea SIM'd before doing the challenge and risking their money. Once I posted that advice I mostly stopped getting inquiries—so maybe people are actually getting their ideas coded, learning that they don't work, and then not writing to me. I did get an inquiry a while back by someone who claimed that he *did* have his system coded and it beat the house, so I told him to send the code to me, but he said his partner coded it, and the partner died, and he no longer had access to it.
System believers have so many characteristics in common I made a post about them, Characteristics of a Betting System Believer. The relevant ones for this discussion are:
(25) Hasn't run a computer simulation.
(26) Can't run a computer simulation, because he doesn't know how.
(27) Unwilling to learn how to code a simulation (and unwilling to hire someone to do so).
link to original post
You accept SD/DD blackjack for your betting system challenge? If so I might take you on after some research.
No, and since you failed the reading comprehension test, now I'm blocking you.Quote: VladPutinYou accept SD/DD blackjack for your betting system challenge?
link to original post
Quote: MichaelBluejayNo, and since you failed the reading comprehension test, now I'm blocking you.Quote: VladPutinYou accept SD/DD blackjack for your betting system challenge?
link to original post
link to original post
Sounds like you reject blackjack because you're afraid of real math. You're specifically picking games with high HE to make it impossible for betting systems to beat the house edge.
And then you claim betting systems are "completely useless".
You, sir, have just committed a "bait and switch".
The fact that betting systems can not overcome your high HE games is not equivalent to "completely useless" and "makes no difference", iirc those are your own words. The bait and switch here is you're trying to claim they "makes no difference" because they can't over come your high HE games. But that's not what "makes no difference" actually means. It means it does not change the EV.
And that is where you're wrong.
That's why you only take high HE games in your challenge, because you're scared of real math.
If the HE is thin enough, a dent from the betting system can actually turn the EV positive.
According to CBJN, MGM has a 0.19% HE double deck, Paris 0.26% 6D, Aria 0.19% DD, Bellagio 0.20% DD, Caesars 0.26 6D etc etc.
All with thin edges that can be beaten without card counting, merely on the results of previous hands.
Because you reject challenges from these low HE games, you go on and claim systems don't make a difference in the EV because they can't flip the EV to positive. When in reality, to disprove you, one need to show the EV can be nudged by betting systems, rather than turn it into a positive EV game.
System sellers being scammy scums doesn't automatically make you the good guy when you claim the opposite. That's called fallacy of the inverse, look it up, also known as denial of the antecedent. So while I can use a system to gain a razor thin edge at 0.19% HE blackjack in vegas, there's no point doing it when I can just count cards for +3% EV. That doesn't make the system "useless", just because card counting is superior.
TLDR you're a coward hiding behind high house edge games with your challenge while using the fact nobody took your challenge to claim a logical fallacy.
Are you referring to a system by which you bet more after you’ve lost several hands? The assumption being that the remaining deck is probably more favorable to the player if it has been unfavorable up to nowQuote: VladPutin[
If the HE is thin enough, a dent from the betting system can actually turn the EV positive.
According to CBJN, MGM has a 0.19% HE double deck, Paris 0.26% 6D, Aria 0.19% DD, Bellagio 0.20% DD, Caesars 0.26 6D etc etc.
All with thin edges that can be beaten without card counting, merely on the results of previous hands.
Quote: Ace2Are you referring to a system by which you bet more after you’ve lost several hands? The assumption being that the remaining deck is probably more favorable to the player if it has been unfavorable up to nowQuote: VladPutin[
link to original post
Yeah that's definitely true for blackjack even without card counting, and that's part of what I had in mind.
Bac card counting has always been "dismissed" per se, but it actually makes a sizable difference, just not even close to breaking the HE. I did hear some bac side bets are countable and +EV towards the end of the shoe but that's beyond the point here regarding betting systems.
Something similar to what you said about BJ also happens in bac, just in a different way and a much smaller scale. If banker wins a lot the shoe will deplete faster because banker draws more. It's kinda similar to how a cut card in blackjack helps the casino vs continuous shuffler by shortening good shoes and prolonging bad shoes. I don't have the numbers on how card depletion affects bac EV, but I'm sure 1:It's tiny, 2: It's non zero, and 3: It won't overcome the house edge alone.
Small but non zero, is still enough to disprove Bluejay's point of betting systems making "absolutely no difference"
Quote: gordonm888Many of the Wizard's calculations use a looping code, not a random-number- generator-based simulator.
He loops through every possible combination of cards (once), accumulating statistical outcome information.
link to original post
That does sound more accurate than RNG. But some games can go on forever right? You can want to go to the bathroom, get hungry, get sleepy, pee your pants on the casino floor, fall asleep on the craps pit, die from starvation, and the shooter still won't roll a 7. That's a joke of course. But my point is some games can be infinite