hypersoniq's Blog

Continuing with a Python QP generator

The code is simple enough. The goal is to make a guess on the neutral sets without introducing bias on my part. I am no further along on interpreting the output, so, since it is a guess anyway, why not let Python do it?

As I have seen in the past, when treating a non replacement jackpot game as isolated columns, it will look at what is available for each column, and the final pick may be out of sorted order, which is an easy fix for play... That was any system applied to the Match 6.

I will make it a stand alone script that I will need to input the neutrals from. One for each game. (Recycling the P3 and P5 versions for day and night). The interesting one will be the Cash 4 Life.

Overall it will be less of a definite pick based on the frequency statistics and more of an "educated" guess... at least until I can find a better way to interpret the results.

Entry #456

Development: a random enough lottery picking script

I wonder how that would look in Python and what functions would need to be written..

For the white balls in a jackpot game like Mega Millions, it is as easy as 

population = range(1, 71)

k = 5

unique_random_numbers = random.sample(population, k)

print("unique_random_numbers")

Where population is the range of possible numbers and k is the number of balls you want to pick. 

But this would be a bit different for a pick 3 game, and for a pick 5 game...

It might be better to create a function and call it 3  or 5 different times (emulating a mechanical draw)

Then there is the question of how random is random enough? 

Built in PRNG of Python?

Using the entropy stack from the local Operating System? Caveat is if the stack gets depleted, it defaults back to PRNG...

Remote API call(s) to an external source such as random.org?

So the plan is to create this script, but replace the population "range" with a list of numbers that were classified as neutral from my last script. In this way I can try adding some randomness to the phase 2 selection process.

For example, cutting the hots and colds from the last script, this leaves 5 to 7 neutrals in each position. So it would basically generate a home brew quick pick using the subset of all possible balls that classified as neutral in the previous step.

I don't think this will take too long to write, but it is the details that are important. My current pick 3 selections (769 mid day and 045 eve) have their last draws on Thursday. I should be able to try a custom QP for the next week.

The entire Cash 4 Life test is 100% funded with house money, as will be the next 2 weeks of the pick 3. It was nice to get a shot at playing for free. Hope it happens again sometime soon.

Entry #455

An idea, add some randomness to the selection process...

So, my phase 1 classifies the chosen amount of draw history into Hot, Neutral and Cold. The resultant neutral numbers still make too big of a set of combos to cover... so what about making a draw simulator that only loads the balls picked as neutral in phase one?

That would give a break to the confusing second step of trying to decipher all of the output... still picking just one combo from the neutral set, which still contains hundreds, tens of thousands or even millions of combos depending on the game analyzed...

Something to think about...

Entry #454

After 3 days of 0 white balls on the Cash 4 Life...

Got one number... because all 4 cash balls were played, that is $2... putting the 10 draw test so far at -$78

It was the only prize without 3 other prizes, but a win is a win right?

Since the test is for 26 draws the overall value is -$206

BUT

It was house money, so technically even the $2 win is profit. 6 draws to go on this ticket, 22 to go on the test.

Entry #453

Cycle adjustment for the Cash 4 Life

Now that I know advanced draws are limited to 10, I may just shorten the window to 20 draws rather than 26. I will play the full 26 this round, but there are still one or more NNNNN draws when shortening to 20. Also lowers the cost to $160 on any combo rather than the $208 it is now.

Also, rather than go on about how many drawings in a row it is possible to get 0 white balls (2 so far) I will limit to mentioning any wins... for this and the dailies.

I have 24 more draws to think about how the selection process might change, but only 3 draws to test something new on the pick 3. Pick 5 is going to be out again until another pick 3 hits. Same with the C4L after this run.

Sticking to the budget as per usual...

Entry #452

Cash 4 Life tickets bought... not as expected...

You can tell I never did anything previously with this game. Power Ball, Mega Millions and PA Match 6 all allow 26 advanced plays... Cash 4 Life only allows 10.

No change to the plan, just have to play the same combo 2 more times... again for 10 draws and finishing up with 6 draws. I will obviously resist looking at the data until after 26 draws have passed.

10 plays on a $2 ticket is $20, so to cover all cash balls (1-4) cost $80. The next 10 will be $80 more, with the last 6 being $48. The same $208 that 26 advanced draws cost, just broken into 3 plays.

An upside is that any smaller wins can fund subsequent rounds.

Will also have to harvest wins that approach $100 to minimize claim forms if a 4 ball match happens (one claim form for $2,500, plus 3 @ $500... claim form triggered @ $600 and above.).

There is no prize just for having the cash ball, but the prizes would be based on having all cash balls played.

1+1 = $2, max one per draw

2+1 = $10 + 3x $4 = $22

3+1 = $100 + 3x $25 = $175

4+1 = $2,500 + 3x $500 = $4,000

5+1 = $7 Million + 3x $1 Million

 

Then there is the 9pm un-televised drawing...

Everything on my side is done, now the rest is up to the Lottery... again...

Entry #451

Cash 4 Life was one difficult combo selection.

I had not planned on a ticket for 26 draws since when I tried it with the PA Match 6 (many missed, but won just enough to cover the cost of the ticket).

The plan I mentioned earlier about using a simple grid to gray out numbers after selecting one was surprisingly useful.

I worked from the extreme low pick and extreme high pick and worked towards the middle. I let the neutral data be the guide, but kept in mind the average gaps of the 5/60 being slightly above 10.

I typed the method used for post draw analysis and refinement, just like the current pick 3 and pick 5 tests.

Got the pick and the funds, just need to go play tomorrow.

Entry #450

Coin flip for a fill week ends up catching a hit!

Since I had not made a selection as I am still rewriting and testing code, but I was in the middle of a test, I will sometimes just pick a number to play. The routine (which is rarely used) is to take a quarter and flip it... heads = play 777 for a week and tails = play 666 for a week. Years ago it brought in one hit on 666.

So I played from last Saturday through yesterday. It was heads, so 777 was played and on Thursday night it hit! Since there is no box play on triples, went for the $1 straight and took $500!

Months of preparation and 3 weeks of a no win test only to win on a dumb luck coin flip...

What it boils down to... the first 3 weeks of the test were basically refunded... this week I have picks for pick 3 and pick 5 and the kicker... once I make a pick, I will have a shot at the Cash 4 Life... one 5 digit combo played across 26 draws using all 4 "cash balls"... a $208 cost... all on the state! Not to mention the rest of the win  is straight up profit.

First draw on the pick3 and pick5 test was yesterday (almost a box on the day pick 3 and 2 of 5 in position on the night pick 5), still figuring out how to interpret the data for the Cash 4 Life, so that won't probably start until next week.

It is stupid dumb luck like that which keeps motivation up. Each week methods are revised on the test. So the system has yet to create a win, but the secondary goal of having the state pay for the tests has been met. 6 draws remain on the 4 games (3 mid and eve, 5 mid and eve) AND I am free and clear to take a shot at the Cash4Life. 

It does make one wonder about why go through all the effort outside of keeping up with coding skills when it is ultimately dumb luck or coincidence that brings in the rare hits, yet I am quite motivated to continue research on house money!

Entry #449

Ran the start day tests with past data instead

Pulling the plug on the start day test. Data was mostly the same stepping through 7 draws.

Still live testing the pick 3, just not shuffling start days.

There is the added change each week in interpreting the results, so rather than go for constant play, I will be instead running if I have identified an area of interest to focus upon and pursue an attempt. This will ultimately lead to less frequent attempts and more time at the phase 2 drawing board... which is generally how I like things.

I do realize that my observations can be prone to bias, and therefore care is being taken at each step to avoid it. It feels like I am onto something, but again I am not the best judge. Time needed to study the results is also a factor in discontinuing play on any type of schedule. While I seek a clearer interpretation, the live game waits... when I am ready to play, it is back in with the same budget restrictions and overall goals.

I am asking a great deal of the coincidence machine, as the initial goal is a hit both day and night, and I know it will fail to deliver at a much higher rate than it might work... but that is the fun... the challenge.

While exploring my most recent ideas, I stumbled upon what I will be trying sometime before the weekend, which is to run the script as usual, then inject another run with a different model size. So, 150 as usual, then 143... why? The future will show which ones are to be drawn and which ones will not... BUT we know which ones will drop off between the week window! 1/3 of the future state of the distributions can be known ahead of time... using the 2 lists to find out which numbers will still be likely to hold neutral status throughout the window can hopefully be the indicator of which number to pick in a tie. There still remains 2/3 of the final state unknown... but before this observation it was fully unknown... I will take the 1/3 and run with it.

Still stumbling through code for the visualization, but this gives me something to work with now. Standard deviations will change, quartiles will shift, the data comes alive again!

Entry #448

Pick 5 test was a flop, pick 3 test continues to be a flop

As per usual, the tests so far have been a flop.

5 weeks remain of the test, but days may be skipped between.

Having viewed the 7 step results, there is an idea brewing...

Next pick, I will run the standard script, then change one parameter and run it again. The final distribution list of each will help narrow down what to play, but unsure as to how much help it will be...

I don't know which numbers will be picked, I don't know which numbers will not be picked... but I DO know which numbers will drop off of the list in a week...

With the pick 5 test I am $63 in, $70 to go.

$133 total expense

$0 in winnings

One p3 straight or 4 $40 box hits will make it a successful test. Total of 28 draws mid and 28 draws eve to go...

Entry #447

Visualization: Deciding what to graph.

With the upcoming 7 day step modification, it might be a good time to get a visual look at the data.

The hard part is knowing what to look for...

Over 7 days of steps, each step brings in 1 new combo into the model, and loses the first combo. This means the numbers have 3 possible actions...

Increase by 1, stay the same, or decrease by 1.

So for a first attempt, I will be looking at using frequency to populate the Y axis, putting a line across the graph at the expectancy, a blue line below by 1 standard deviation and a red line above the expectancy by 1 standard deviation. This will define the neutral range.

For the X axis, it will be the steps.

What we will have is each number being plotted by frequency at each step.

Now, that could get to be a busy graph with 10 different plots on it, so I want to incorporate a list of check boxes, default UNchecked, for each digit 0 through 9.

I am hoping to see what happens with regard to frequency at the draw level, rather than the entire week to week.

I may have to re arrange the output so that the standard deviation and the quartiles appear alongside one column's worth of distribution data.  Such that it looks like 

SD, Q1,Q2,Q3,0 freq, 0 percent, ... 9 freq, 9 percent. Then this data will need to be parsed to either skip rows to ensure column 1 data lines up or create a separate output file for each column so only column A data appears with column A, etc.

So we run, then read column A data, then read column B data and finally read column C data. Once loaded, the graph and check boxes can be generated.

Because the program screen output will be unchanged, I can use the graph to study numbers of interest, see how several numbers compare (deciding between ties in frequency) or even see the whole cluster of a graph with all 10 digits present.

Since frequency is being used, ranging is easy for Y, it is 0 to 30, with 15 being the center (and the expectancy). X is simply 1 to 7 for the steps.

Getting the correct data written should be as easy as properly formatting one writerow() command per column pass.

Visualization will be a clean sheet separate script, so I can cross reference data in the format I have gotten used to reading with the new graphing function. I will keep in mind the flexibility of the original concept by writing the visualizer to accept a variable number of input files so the same program that can process the pick 3 can also process the pick 5.

In retrospect I should have done this BEFORE trying a live test, but ideas evolve... the live test might be over before this idea is functional.

Time will tell...

Entry #446

A simple loop will show the 7 day step...

I knew a day or 2 would help with figuring out the next part.

Reconfiguring the program to show the results for each of 7 days is going to be simple.

1. Set the window to 0.

I am not looking to classify the next draws, just look at the resultant statistics from the model.

2. Set the offset to 7, then put the function in a loop with offset decrementing by 1 with each pass.

3. Call the function with the new offset.

This should show the distribution over 7 draws, step by step. This will help show how the statistics move in the middle of that 7 day window, how the distribution changes. Hopefully highlight exactly what I would be looking for in the stats to help with the next pick.

The work schedule has me on a 5 day stretch starting tomorrow, so it could be a few extra days until the opportunity presents itself to make a pick anyway, so may as well study the mechanics a bit closer.

This will be a branch of the original script, therefore it will get a new name and version number (V1), and will be used in conjunction with the other script to help pick a combo.

Entry #445

Brainstorming a GUI for the current script

While it is nice to just run the script and study the resultant data, I think it would be a better experience if I were to create a full Python application.

For readability, the current script stores information in lists so that I can get a 3 column display output at the end. If I instead use a grid based system, they can populate directly after each column processes, allowing for the following...

1. I can sort the distributions descending!

2. I can change the background color of the cells in the distribution, red for Hot, Blue for cold, leaving the neutral with a white background.

3. I can use the same per column approach, where the grid layout would be dependent upon the number of columns of data in the input file, providing a 3x3 grid for output with pick 3 data, or a 5x3 grid for pick 5 data.

4. User controls can appear below the grid

5. The introduction of visualization!

This will make the data easier to read, and allow the development of another feature... step sequencing... taking the results from the 150 draws and stepping one draw at a time to watch the changes. Processing in 7 draw steps makes a big difference in the output, maybe a single step through each draw will be less volatile. Possibly shedding some light on exactly where in the neutral numbers the changes are taking place.

So the plan is to create a version of the script that will index by 1 instead of 7, for the last 7 draws to prove out the concept, which may end up as the refinement for next week's picks, then start looking at the creation of a gui.

Since I am in some need of learning gui coding, it will be a win regardless of what numbers are drawn. After the next 6 weeks go by, if there is no win, it will be back to the sidelines while the above gets completed.

Always good to have a plan

Entry #444

Winless first day of week 3

Day pick 3 was a flop, same with day pick 5

Evening pick 3 had 1 number in position, evening pick 5 had 3 numbers in position...

It seemed like a good time to go for the pick 5, as the previous 2 weeks contained no all neutral draws. The evening pick 5 pattern was HCNNN. Since I am essentially playing consecutive games of 1 in 10, I got 3 right. Was that the best shot for the week? Time will tell.

Perhaps an interesting area of study would be the transitioning numbers, the ones with frequencies at the edge of crossing over to the expectancy or crossing from N to H.

With drawing updates, the selection process took less than an hour. The results will take a week to come in. From a time investment standpoint, it is already better than any previous system... and like the others, no hit yet.

This is the only test of the pick 5, but the pick 3 portion has 5 more play attempts... 5 more pick revisions to try. I like the concept of one pick for each game for a week... I should have considered that sooner.

Now I need that hit, calculated or coincidental, to keep interest level high.

Come on Pennsylvania... I have done my part, your turn!

Entry #443