Simulation Program/Spreadsheet Prototype

k_c

Well-Known Member
This is posted in voodoo because my sim program simulates very few rounds compared to a traditional sim and I'm sure there will be comments to that effect.

The sim program that generates the data is different in one respect. It records the shoe composition prior to each round and makes an exact calculation of EV using total dependent basic strategy for each round. This makes it possible to get an accurate picture of what to expect in relatively few rounds, albeit for basic strategy.

It also records actual results. Obviously for a small amount of rounds the actual results will not mean much. They only serve as a short term comparison to the calculated expected values, which are as long term as you can get for each round because they are calculated, not simmed.

This is just a demo of what I can do so far. Always, more can be done.

1. Just basic strategy. No indices. I'm working on a program that could compute exact EV based on index play input by user but don't hold your breath waiting for it because I have only limited time. The positive in using basic strategy is that counting systems/spreads can be compared.
2. Just heads up player versus dealer.
3. The spreadsheet has 3 counts: Hi-Lo, unbalanced KO, and true counted KO. User could change these but I could add an interface to do this.

Here's how it would work:
1. Data would be generated. Right now I'm the only person that can do this.
2. I've made a template spreadsheet. For a new sim the template sheet is copied and renamed.
3. The ImportData macro is run in the copied spreadsheet, which creates the spreadsheet data.
4. More data (using same parameters, of course) could be added from subsequent sims.

At this point I'll bet nobody knows what the heck I'm talking about but if you download Template.xls and run the ImportData macro, browsing to simFile.txt...... These 2 files are zipped in attached Files.zip

I did a 100 shoe sim of a single deck, S17, DOA, NDAS, no resplit, full peek, 60% pen. The data is in a file called simFile.txt. If I wanted to sim this game I would want more data but I think the general idea can be seen from 100 shoes.

One note: In the chart for true counted KO there are 0 rounds for a true count that is less than 0 and greater than or equal to -1. This is because in a single deck a running count of 0 results in a true count of 0 and a running count of -1 always results in a true count that is less than -1. Therefore in the true count frequency/EV chart for true counted KO there is a "hole."

Wondering what kind of demand there may be for something along these lines.
 

k_c

Well-Known Member
jack said:
So this is a Simulation program?
By itself it's not a sim program. It's only a means of outputting results from a program like in the attached image. It is nothing more than a demo of a different way a doing a sim.
The spreadsheet can't do anything on its own without access to valid data, so that's why you need to import simFile.txt, which the program in the image generates.

Were you able to successfully do the import? It works on my computer but I see sagefr0g is getting an error.

Instead of spending computer time going through a large number of rounds, computer time is spent calculating exact EVs for each round. The only thing simulated is the shoe composition by playing each random deal according to basic strategy. Before each round the overall EV using basic strategy for the simmed composition is computed and recorded for use.

I only simmed 100 shoes which turned out to be 613 rounds but I think it can be seen that an accurate picture of what to expect starts to emerge after relatively few rounds using this method.
 

Attachments

Canceler

Well-Known Member
Vista strikes again??

k_c said:
Were you able to successfully do the import? It works on my computer but I see sagefr0g is getting an error.
I got the same error sagefr0g did.

(And it really wasn't sporting of you to lock us out of seeing the code! :flame::joker:)
 

k_c

Well-Known Member
Canceler said:
I got the same error sagefr0g did.

(And it really wasn't sporting of you to lock us out of seeing the code! :flame::joker:)
I found the problem. When I recorded the import macro it hardcoded the path to the data file to a location on my computer. Try again with new attachment.
 

Attachments

already710

New Member
That's quite an interesting topic. Thanks for sharing :whip:
(Dead link: http://simulationcredit1.com) _simulation credit_
 

k_c

Well-Known Member
k_c said:
I found the problem. When I recorded the import macro it hardcoded the path to the data file to a location on my computer. Try again with new attachment.
Is there any way for me to delete the attachment in the original post in this thread? The macro in the attached spreadsheet in that post that needs to be run won't work as is evidenced by Canceler and Sagefr0g. The attachment in my reply to Canceler should hopefully work and I would replace the one in the original post but it's too late to do an edit to have access to it.
 

sagefr0g

Well-Known Member
k_c said:
Is there any way for me to delete the attachment in the original post in this thread? The macro in the attached spreadsheet in that post that needs to be run won't work as is evidenced by Canceler and Sagefr0g. The attachment in my reply to Canceler should hopefully work and I would replace the one in the original post but it's too late to do an edit to have access to it.
i think if you pm Sonny he can wack it for you.
the new file worked fine for me.
now i just got to figure it out.:)
 

k_c

Well-Known Member
sagefr0g said:
i think if you pm Sonny he can wack it for you.
To Sonny: If you see this please whack away or change to latest attachment that seems to work.:cool:

sagefr0g said:
the new file worked fine for me.
now i just got to figure it out.:)
There's not that much to figure out. Basically it's simple.

It's a demo of the output from a single deck simulated heads up game for 100 shoes dealt to a pen of 60%.

Composition sheet
Column A is hand number, increased by 1 for each round, reset to 1 after shuffle
Columns B-K contain shoe comp for ranks 2,3,4,5,6,7,8,9,10,A
Column L contains EV prior to the round using basic strategy just as if you input the composition into tdca to get an overall EV.
Column M is 1 if dealer was dealt a blackjack on the round, 0 if not
Column N is 1 if player was dealt a blackjack on the round, 0 if not
Column 0 is the +/- in units (flat betting 1 unit) for the round

Spreads sheet
Contains the amount bet at various counts for each of 3 counts
Contains average pre-deal EV for each count range
Contains number of rounds at each count range
Contains expected +/- for each count range based on what was calculated
Contains actual +/- for what actually happened in the sim
You can change bet spread and run the CorrelateEV macro to incorporate the changes to other parts of the spreadsheet

Counts sheet
Contains data for each count for each round of the sim

RoR sheet
Change bank and goal as desired and run ComputeRoR macro to view changes

Chart
Just a picture of the data

There are a couple of other macros that can be run that just display various and sundry data.

Mainly it's just a demo of how a sim that records calculated EV using basic strategy for each round can use this data to characterize what is eventually expected. One thing on my to do list is to do a macro that would allow a user to change counts/spreads. That can be done because the composition sheet is not count dependent and is an equal opportunity employer of all counts.
 

Sonny

Well-Known Member
Got it

k_c said:
To Sonny: If you see this please whack away or change to latest attachment that seems to work.:cool:
I removed the attachment from the first post.

-Sonny-
 

k_c

Well-Known Member
Clarification

ka3nav said:
(Dead link: http://simulationrachatdecredit.org) _simulation rachat de credit_​
this is itneresting.:joker:
I'm going to hazard a guess that by the use of the :joker: icon, you don't understand what this thread is about. If it turns out otherwise, please don't take it personally.

1. This is just a prototype of a way to simulate xxx number of shoes using exact calculations for overall EV using basic strategy prior to each round as a basis.

2. There is no data in the spreadsheet to start with.

3. I have a program independent of the spreadsheet that does the simulation.

4. I have simulated a small number of single deck shoes (100) and the results are in a file called simFile.txt.

5. The spreadsheet, named template.xls, along with simFile.txt are zipped into an attachment. I am attaching the zip to this post. Unfortunately there was a programming error that prevented the data import, below, from properly executing in the attachment in the original post. The attachment in this post should work.

6. After unzipping the files and opening template.xls, you will find several macros built into the spreadsheet. The macros are accessed by using the Tools/Macro menu item in Excel.

7. Find the macro named ImportData and click it to run it.

8. This will open a dialog box. Use the dialog box to navigate to the location of simFile.txt on your computer.

9. Once it is confirmed that simFile.txt should be imported, the data in simFile.txt is imported and the spreadsheet is built from the data. More data could be added later by simming the same decks/rules/pen and importing the new data file.


This is by no means the end of what could be done, but I feel it shows the basic concept of using computer time to do exact calculations in conjuction with simulation rather than using the time to go through as large a number of rounds as is feasible.

I don't consider myself the world's greatest programmer. I just try to find something that works and is simple enough to use/implement. I someimes don't express myself as well as I would like, but I do the best that I can.
 

Attachments

Top