Planning the ultimate search for the top replacement values.

Published:

I had started with raw follower data, moved to a sequentially indexed "mirror" system, then moved to followers within that indexed system.

The basic premise, given the digit in the last draw, which one has the highest history of making a match?

With follower data plugged in, so far the zero count (where there is a match) is the highest, but there is yet to be a hit.

The next thing to do would be to check ALL possibilities of replacement values for each digit to find the best one for each column of each game.

For the basic mirror system, the replacement scheme is

0=5

1=6

2=7

3=8

4=9

5=0

6=1

7=2

8=3

9=4

On one side is the index for the last drawn number, on the other, the number to replace it with.

The total possible combinations of replacement values comes out to ten Billion!

So, why not test them all?

For each column, that means recording the number of "hits", and that will result in running through 28 columns for the mid and eve PA pick 2 through pick 5 data, 280 billion iterations of a recursive algorithm in total... 

How do we do that without running out of memory? By only recording the top 5 sets for each column.

How to do it? Lists!

Starting with [0, 0, 0, 0, 0, 0, 0, 0, 0] and ending with [9, 9, 9, 9, 9, 9, 9, 9, 9]

Each iteration will append a zero count, so that one of the top 5 output lists might look like [5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 750] and each of these lists will be stored in a "list of lists" which will be sorted by the appended zero count and compared to the most recent one, if it has a higher zero count it goes into the list and the lowest count gets popped off of the list.

The output will be the sorted list of lists, containing the 5 highest zero counts. 140 total lists. The zero counts will allow sorting into the top 5 without needing to store them all.

The main design challenges...

Writing a list generation loop to generate the lists.

Looping through the history files and counting the "hits", and appending that number to the current list.

Sorting and ranking logic to maintain a running top 5 list of lists.

Perhaps writing output to a csv file in case the program crashes.

Setting up a system to run continuously. (Raspberry Pi version 5 should do the trick)

Fitting the whole system into my current recursive framework.

Will take some time and small tests to get the logic right. But that is the ultimate rabbit hole dive for any replacement system.

Happy Coding!

Entry #272

Comments

Avatar hypersoniq -
#1
We can add to the design considerations with batch processing. Running just one game at a time. Pick 2 mid then eve, then pick 3 mid then pick 3 eve etc...
Once we have a run time on the first pick 2 game, we can extrapolate estimated run times for the rest.

Why run all 10 billion combinations? That way I can say I left no stone unturned in the search.

Each column in each game will run from the second draw, since the first will be needed to base the first pick.

The initial test will run the first 1,000 iterations of the list, just to be sure the logic holds out and the top 5 ranking and retention algorithms work as intended. That will be on the longest history file (pa pick 3 evening with around 17,000 draws)

That is the fun part of software engineering, figuring out what you want the code to do before ever writing a single line.

Planning around a recursive central function means no data other than the top 5 lists are stored, and the program does not have to be set up for each specific game.

Holding the zero counts allows for validation when these numbers are transferred to the spreadsheet.
Avatar hypersoniq -
#2
A Python list is definitely the right data structure for this experiment. Python lists are designed using zero indexing, meaning that a list can be referenced by elements, with the first being list[0], not list[1], when you look at the last draw, replacement is as easy as list[last_drawn], because if a 0 is drawn it will replace with the first element in the list and if a 4 is drawn it will be replaced with the fifth (because it starts with zero), this naturally results in a 9 replaced with the 10th element. The plan is to append the zero count on completion as element number 11.

Before the function returns to process the next iteration, it will call another function that will handle the top 5 zero counts. This will be a list of lists that is ranked by that 11th element, the hit count.

That means 10 billion iterations per column, where it will check the last draw, make a replacement "pick" and test it on the next result.

It is a strange hobby, but I sharpen coding skills with each new idea.

Post a Comment

Please Log In

To use this feature you must be logged into your Lottery Post account.

Not a member yet?

If you don't yet have a Lottery Post account, it's simple and free to create one! Just tap the Register button and after a quick process you'll be part of our lottery community.

Register