So what is it that would be useful to count?
The obvious is "did the numbers at the top of the transition distribution list ALL match the next draw?", secondary would be if ANY of the numbers matched.
This means there are 2 scopes to check... the per column scope, and the combined column scope (whole draw). Which scope the script is in determines the output timing. Setting per column variables to capture the data that can then be resolved at the top level across all columns seems to be the implied flow.
So at the column level...
1. Did the number at position [0] (most frequent) match the value of next draw for that column? A 1 for yes and a 0 for no. Accumulate on a variable which will then have a value of 0 to 3 on all columns ran. (Pick 3)
2. Which index position (if not [0]) DID match the next draw? 0 being most frequent, 10 being least frequent.
3. Was the next draw value contained within the "last 10 recent followers" list? Boolean... True or False. This will allow testing of the usefulness of that feature.
Then at the whole game level...
1. Did the accumulated variable equal the number of columns in the game (3 for pick 3), which would be a valid [0] [0] [0] hit?
2. Did the combo indicated by the distribution list appear in the next 7 draws? 14 draws? 21 draws? This will test for lag.
This set up will answer a few questions.
A. Over the entire game history, would playing the most frequent indicated transition in all columns have turned a profit? I am always expecting this to fail, but this time I am interested in how much it fails by.
B. If not [0] on each distribution list, what were the most frequent patterns of index positions that matched the next draw? Re run the back test counting the most frequently matching index values.
C. If there is a lag component, how long is the duration?
So not worried about accumulated errors, this is more about the frequency and report index position than the actual numbers. On general frequency data, the distribution approaches the expectancy of 10% per digit. In the case of this Markov Chain, we are focusing on a specific event... numbers that followed the most recent draw.
That would make the first 3 entries in the row a 1 or a 0 for a match of [0] to the next draw (for pick 3). The next 3 rows will display the actual distribution list indices of the next draw. Followed by the cumulative value of the first 3 entries in the row (3 = straight hit on pick 3) and finally an indicator to show where in the next 21 draws a lagged straight hit may have happened. If it was not in that window, value = 0, if there was a hit, then it displays how many draws past the next drawing the straight came out.
I think that is the most comprehensive back test I can think of at the moment. Writing to a csv file for import to Excel will help get an accurate picture of how to read the transition report moving forward.
Keeping in mind I must write this on a universal scale to process any game, from the pick 2 to the match 6/power ball/mega. This will be awhile to put together, but it is always better to start with a plan, an idea of what output you want.
But this is best kept at the script level, as the app just presents the most recent data.
Don't know when I will get to it, designing the logo for the app today, then putting it on the splash screen and a smaller version on the top bar. Also designing the icon image.