hypersoniq's Blog

Might not be "THE" system, but it establishes a framework..

The only thing that won yesterday was $2 on the match 6, and that was with the help of the 2 QP lines.

I am 6 classes (one class every 2 months, 1 year and 7 weeks away) from an online Bachelor's Degree in Computer Science. My last 2 classes will be Data Mining/Machine Learning, then Artificial Intelligence.

Right now this project is producing mostly dismal results where I thought it might do better, but the work is not wasted. Instead this project is more of a framework for what may come. 

1. It is modular, the current follower modules can be swapped for eventual machine learning algorithms using the same overall script.

2. Picks are atomic, meaning the first position of pick 3 is processed independently of the other positions. 

3. The framework can read and process the .csv history files as function call parameters, which will serve any future Machine Learning initiatives well, do not have to re invent the wheel.

All of the current initiatives will serve future development as well. This is the list of what I am slowly assembling...

1. A back test system to make recursive picks and feed forward the draw history.

2. The RSS feed parser for updating draw history files with one click.

3. Visualization with the matplotlib and seaborn libraries.

4. Rolling ALL of it into a desktop application, and eventually an Android app so I don't have to fire up a PC or Laptop to update and get picks.

If I can accomplish these goals by next October 27th, I will be ready to leverage AI into a system on my own terms... not really a fan of any AI lottery offerings.

There are no guarantees on lotteries but I can guarantee that I will get better at python coding along the path AND not get left behind with the obvious impact AI is having on computing in general. 

It's good to have goals, right?

Entry #231

Moving along with playing the system.

After a disappointing weekend of paper testing the pick 3, time for some actual play. Shooting for pick3, pick5, Match6 and Powerball today.

Tweaked the ratio of recent draws to full history. 28% for pick3/4/5 and 21% for jackpot games. (Up from 21% and 14% respectively) the old percentages did not provide enough data and the weighted picks just ended up mirroring the full pick. Too much and they will mirror the recents, I think I have found balance at these settings, even threw out a few unique numbers!

After the full run today, I will use the system the way it was intended, to produce single picks, and rotate between pick3/4/5. For the jackpot games, will stick with the match 6 and the big games only when the lump sum value is >= 100 million. I intentionally left PA cash 5 from the list in protest of the doubled ticket price, and treasure hunt does not seem worth the time to generate a history file. Not interested in the cash 4 life either.

I did the work, still need to do a pick 3 back test, all the coding, all of the research, and all of the implementation details, maintaining history files daily... now it's time to roll it out live and hope for the best.

Also testing a theory and skipping the next few MADDOG jackpot game challenges to see if the picks do better.

We do not code systems assuming that the lottery draws are truly 100% random, we look for their flaws in the history...

My belief is that you do not need to be better at math than the lottery organizations, just better at statistics!

Entry #230

Reflecting on old Excel systems

For many years the pattern was...

1. Dream up a new system

2. Create the spreadsheet

3. Play until bored

4. Give up for a few years

Some of these systems got 1 hit, like the chain idea where it is like followers, but with the following difference. If a 6 was drawn what followed (easy), BUT, if a 5 was drawn before the 6, then what followed 5 6? That chain system hit once on the pick 4 straight.

The next was an exercise in error correction, where a number was picked and combined with the last draw via absolute subtraction to give a pick. Such as drawn 123 - "mask" 625 [abs(123-625)] =502. That system peaked with a box hit on the pick 5 with 2 pairs ($1,700)

I had sheets for v-tracks, mirrors, +111, even/odd etc. Most were lost when the old laptop crashed 8 years ago. They never produced a notable hit and cost too much to play. It was at that point the goal always became a single "best guess".

I think with this follower system, it is at the point where play will start but boredom may set in. I enjoy the development part way more than the day to day play (excepting a win, of course) so I hope something promising comes along soon

Entry #229

Just figured out how to add weight to the follower data!

So, we have a list that captures ALL follower data for the last drawn number in each position from 7 different vantage points. Then I added the most recent followers that auto range based on their last number drawn. So here is how the weighting will work...

1. Keep the full combined list of follower data

2. ADD to it the combined recent data lists, this adding weight to the recent followers.

Step 2 acts like a theta weight in linear algebra, as it makes recent followers a "feature", and then the theta is what gets changed to fine tune the overall data.

Maybe it works, maybe it does not. It is adding 36 lines of code to a 2,200+ line script and editing another 36 lines of code, so not that bad of a project. The bottom line is getting back to just one pick per game for the games it supports.

I have no idea how many recent picks are the right amount to add weight, perhaps a percentage of the follower count or the draw history length? 

It must be narrowed down to just one before back testing can be coded, so hopefully there is a glimmer of hope in this new modification.

Entry #228

Coding is complete, now the big decision... which version?

The code that takes a pick from the entire 7 sets of follower history is complete.

Which leaves me with a choice...

1. Keep the short term lists with the most recent data or

2. Keep the long term lists with all of the data.

The biggest positive to using the full data set is that there is zero seasonality to lottery histories.

The biggest drawback is that the MOST of something actually rarely happens.

The biggest positive to the short term recent system is that it runs faster.

The biggest negative... it keeps failing tests.

Since this was originally coded for the dailies like pick 3, that may yield the best testing ground... play both for a week n pick 3 and see what gets closest.

Test starts tomorrow...

Entry #227

Why followers? And an idea for the next script change

When I look at the many ways in the forums to pick lottery numbers, I try to keep in mind what we have available to us. With the draw history, we have the follower data at hand (except for the next draw, of course). The basic premise... (using pick 3 as an example) if they drew a 6 in position 1 last night, I can look to see what followed a 6 in position 1 all through the history. There results a distribution that is about as uniform as raw draw data, but there is one number that has followed the MOST.

So what we are gathering is the MOST FREQUENT follower of the last number drawn.

Doing this manually takes too much time. Doing this with Excel is a clunky process as well, usually involving filtering and conditional formatting. Using a python script to read from a comma separated value file (csv) can perform the same task in about 1 second.

My other hypothesis is that using different follower scenarios together might add weight to the overall pick. So I use direct followers, aka skip1. Also skip2, skip3, skip7, skip14, skip21 and skip28. Why? Imagine a camera at a stop sign where there was an incident. One camera angle can tell a part of the story, but 7 cameras all at different angles paint a more accurate picture of what happened.

My initial code looks at only the most recent followers in each category, but that is where I probably went wrong... I am reading the last chapter of a long book... 

The next iteration of the script will gather ALL follower data from each skip scenario, roll them into a huge list, and make it's pick by using the statistical MODE (as it does now with partial lists) on ALL of the data, ALL at once!

I realize that all numbers have the possibility of following, and that the MOST of something only appears SOME of the time, but I am at a loss for other ideas at the moment.

Although I enjoy writing scripts in Python, I know I am still a novice coder, so a change of that magnitude will take some time to get right. Time I am willing to invest. This behemoth of a script is already 2,200 lines long, and that is with following software engineering best practices like modularity.

It may not be a breakthrough in cranking out straight hits, but it will be the cheapest "system" to play as it only draws one pick, and I feel that based on my limited knowledge of both lottery systems and coding, and my biases about lottery data (the pick 3 is 3 sequential games of 1 in 10, position A has no influence on positions B or C)  this does represent my Best guess.

After this update, I will start making improvements on the visuals, maybe a GUI interface, and I am already working on parsing the PA lottery RSS feed (since they don't provide an api) to make updating the draw history files easier and faster. I can update ALL draw files and generate picks in about 10 minutes. I might consider adding PACash5, Treasure Hunt, Pick2 and PACash4Life, but only if the RSS feed parser script works out.

Anyone else experimenting with Python or another programming language for the purpose of lottery picks?

Entry #226

Test # 2, The Jackpot Games (PB & MM)

The next round of testing will begin Monday (9/11) with the Power ball and end on Saturday(9/16), also with the power ball.

There are actually 3 games involved, the Mega Millions, The Power ball, and PA's Power Ball Double Play (a separate game with a separate draw history, also a different prize payout... no multiplier and top prize always $10M)

Since you MUST enter a draw into the main PB game, there will be 2 picks for each powerball draw. Adding the multiplier and double draw entry fee, that means both picks are eligible for prizes in both games. For the purpose of this test, results will be separated, so the first line only counts for the main game, and the second only counts for the double draw. Any coincidental payouts won't count.

2 tickets loaded with options for the power ball is a cost of $8

The Mega Millions with the megaplier is a cost of $3

Total System Test Cost = $30 across 3 PB and 2 MM draws. Test duration = 6 days. Pick Method = My Super Seven Python follower script described in detail in earlier blog posts.

The Goal = A hit or combination of hits that exceed the test cost of $30. 

The expectation... it is all coincidental anyway, the realistic expectation is that I donate $30 to "Older Pennsylvanians"

Unlike the last test, this only has to work once!

Entry #225

Follower category weights

The script I wrote generates 2 distinct categories of data.

1.full count of follower data over the entire game history. Presented as a ranked count, most occurrences to least.

2. The most recent lists, which vary based on the last draw (if a 5 came up in that position last, then the next list length will be 5.)

I am wondering if maybe there is a way to weight the recent list numbers with the full list count results.

The data for the short lists is combined to get the pick. I could also print the individual scenario picks (skip 1, skip 2, skip 3, skip 7, skip 14, skip 21 and skip 28), but to what end?

I have also thought about adding 2 new perspectives... skip 182 and skip 364. Not sure if they will help.

It all comes down to the pick, I am sure I could do more, but what?

Entry #224

Half way through the 4 day test.

The first 2 days of testing on the PA pick 3/4/5 (mid and eve) and the Match 6 are done.

Cost to date: $20

Wins to date: $2 on Match 6 on the first day.

Net result: -$18

Observations:

1. The picks have numbers in position and out of position (so the box has been close a few times, a worthwhile add)

2.  Even with manual updates to all 7 history files, the picks can be obtained in about 15 minutes, which makes this one of the fastest workflows of any system I have developed.

3. The pick 3 is the most wildly variant, sometimes the pick has no matches.

4. The pick 5 has consistently had 2 or 3 numbers match, though not all in position.

 

So, midway through it is still, like all other systems, coincidental. Post test, cycling the p3 p4 and p5 would be even cheaper to run.

Because it is coincidental, there is no need to go through the hassle of rushing the back test script, the value there is in just making it work. Still going to create it, I just feel the results will not be as important as I thought it might.

Onward to day 3...

Entry #223

Why does Mr. "One line" play 2 lines on PowerBall?

The main focus of every system that I have developed (and subsequently abandoned) was always one single bet.

For pick 3/4/5 just one play each

For Mega Millions and Match 6, just one line

Power ball in PA presents a unique case. My pick for the PB is based only on the dataset of results for the current matrix. PA also offers Double Play. I pick that line based solely on the double draw results dataset. BUT... you can't just enter the double draw, you need to enter the main draw and pay an extra $1 to get in the double draw.

Therefore power ball is my only exception to the "one line per game" goal I have set. Though technically it is one line per game, the requirement is to play for both games.

Entry #222

The next steps for my Python follower system script...

Since the core logic is tested and functioning,time to consider the next steps...

1. Create a desktop application around the script. This will be valuable practice for user interface/ user experience (UI/UX). Using the PA lottery ball images instead of text output would be both easier to read (totally a thing for us older folks) and visually appealing.

2. Add an update the draws option. While it would be nice for the PA lottery to have an API, they sadly do not... but they DO have an RSS feed! I will practice parsing this feed, converting the data to a usable form (text to integer for results and text date to date for draw date.) And then having it build an update sequence to append to all of the results history .csv files. Would have allow for updating multiple draws if I miss a day or two.

3. Work in a back test screen.

4. Work in a statistics screen to display the verbose info for each draw, though the main output would be just the picks.

5. Work in a historical function that can show the results of system pick vs actual draw and derive statistics from that info. Maybe an adjustable time frame, such as last week/month/year/custom date range... would basically just let you query the data from the back test.

6. Figure out how to wrap it into an android solution so the entire package can be 100% mobile.

So while waiting for a win, there is still so much to do... free software engineering lab!

Entry #221

Trying this new configuration for PA pick 3 9/2/2023

Here is the output... (5-8-3 mid day and 8-5-0 evening). note how the list lengths equal the last draw result... Auto ranging! Now let's see if it might work...

===================================================================================
Pick 3 Mid Day Followers
===================================================================================

The number of followers in the RECENT lists: 5, total followers evaluated: 35
Mode of most recent followers sets combined (The pick!) is >>> 5.0 <<<

-------------------------------------------------------------


The number of followers in the RECENT lists: 2, total followers evaluated: 14
Mode of most recent followers sets combined (The pick!) is >>> 8.0 <<<

-------------------------------------------------------------


The number of followers in the RECENT lists: 3, total followers evaluated: 21
Mode of most recent followers sets combined (The pick!) is >>> 3.0 <<<

-------------------------------------------------------------

===================================================================================
Pick 3 Evening Followers
===================================================================================

The number of followers in the RECENT lists: 8, total followers evaluated: 56
Mode of most recent followers sets combined (The pick!) is >>> 8.0 <<<

-------------------------------------------------------------


The number of followers in the RECENT lists: 9, total followers evaluated: 63
Mode of most recent followers sets combined (The pick!) is >>> 5.0 <<<

-------------------------------------------------------------


The number of followers in the RECENT lists: 4, total followers evaluated: 28
Mode of most recent followers sets combined (The pick!) is >>> 0.0 <<<

-------------------------------------------------------------

====================================================================

Entry #220

What did I overlook?

The current follower system has a setting for list length that can be unique to each game, but the same across positions. That is what I overlooked. The ability to set the list length for each position... I will remedy that!

Each position in pick 3 (and beyond) has it's own history, and might give better results if it had it's own list length. I will set up the unique variables to pass these in during the function call as parameters. I will determine in the short term here which lengths to use by solving tonight's draw BEFORE updating the csv draw files. Though it has the potential for over fitting, the limits will be to choose the lowest list length that contains the winning number... even if it was not the one picked. May take longer than one night to implement, but I think it is the next logical step.

I have already started the script that will perform the back test, begun by suppressing the verbose output and limiting it to list length (which will also be suppressed later) and the pick.

Going to try starting at between 2 and 3 years of seed data, for example pick 3 from the start to dec. 31st 1979 and begin that back test from January 1st, 1980, as the past draws are far back enough to allow follower data, and that information would have been a priori.

A statistics based system might not be glamorous or as fun as picking 100 numbers for all states, but if it works at an interval to hit enough to be profitable, then it will be worth the time, and for the jackpot games implementation, that only needs to work once.

Entry #219

Trying to fit the jackpot games (MM and PB) into the new program.

While calibrating the dailies (pick 3, 4 & 5) on paper, I ran the mega millions data for 7 different settings. It picked several mega balls, but the most consistent one was 25, the one drawn last night,  white balls could only manage one. This might not be the tool for the white balls, but it does seem useful in narrowing down a good Mega Ball pick. Testing tonight on the power ball.

I played 7 lines of MM last night (total cost $21, with megaplier) and brought in $42.

Letting that $42 roll with similar test on the power ball tonight. The difference being the cost of the test... as I keep separate data for the power ball double play that they pick in PA. The $42 will require an additional $14. Nothing ventured, nothing gained. The results from last night let me pick a setting for MM and for all of the un-played draw games. The one annoying anomaly... again the mid day winner (straight) was among the evening picks... twice in 2 weeks.

After this test to dial in the power ball, I will have all the list lengths set and go back to 1 pick per draw, no guarantee, but I will honestly be able to say it is my best guess.

Working out the most affordable play strategy, then a proper live test can be conducted (with LP predictions to record progress)

Made a copy of the script to start modifying output for the back test. Not going to be easy, but will be worth the knowledge gained in manipulating 2 CSV files in the same script at the same time.

Entry #218

Time to refocus, tweaking the settings...

The ultimate goal is one pick for one game. There are really 3 parameters I can adjust...

1. The number of recent followers in each list

2. The number of lists

3. The skip length of each list

The day for night thing was an observation when the pick for day came out straight for night, but that adds cost and defeats the original purpose of the system.

The list length is the easiest to adjust. Perhaps the next move should be to try several list lengths at once to see which one got closest to the last draw before updating the databases today. That sounds like the plan. I expect that each game may have it's own list length setting.

Also making a copy of the script, suppressing all output but the picks and getting the new script ready to process the back test.

Entry #217