hypersoniq's Blog

The purpose of each game in the wagering system

The lottery "plan" for 2024 is covering a total of 9 games...

PA Pick 2 mid and eve ($50 on $1 straight) - the purpose is to increase exposure to playing on their money. No box plays.

PA Pick 3 mid and eve ($500 on $1 straight) - while also a great opportunity to play on house money longer, it will also trigger a "hot week", where the wagers go from $1 straight to $5 straight across the pick n games. No box plays

PA Pick 4 mid and eve ($5,000 on $1 straight) - just 1 hit covers the entire cost of the system for the entire year AND leaves a decent profit. Allowing for $1 box play if and only if the pick is 2 pair. $800 ($400 on each 50 cent ticket)

PA Pick 5 mid and eve ($50,000 on $1 straight) - the ultimate goal! Allowing for box play if and only if the pick is 5 unique digits ($425 on a $1 box)

PA Match 6 (minimum $500,000 jackpot if 1 winner) - a daily chance at life changing money. This one is played in a 26 day rotation, as that is as far as PA lets you play this one in advance. The ticket cost is $2, so that is $52 per ticket a little over 14 times per year. Most of the time the small winners either defray the cost of the next ticket or cover it entirely.

Part of the plan, including box tickets under strict conditions, is in place because the amount is high enough to trigger a hot week, but under the $600 "claim form" requirement.

With a plan in place, a total budget can be made.

The Match 6 will cost $730 in this leap year. $14 per week.

The daily games estimate is based on a worst case scenario of all picks triggering box plays for a total daily cost of $12, which on a worst case scenario 5 days of play per week instead of the usual 4 places the potential cost at $60 per week.

Therefore the high end of the potential budget will be $3,850 for the year.

This can be eliminated by just 1 straight hit on the pick 4 or pick 5 games, one jackpot hit on the match 6 (or four 5 out of 6 matches), or 8 hits on the pick 3.

If I were to eliminate all but the goal of the pick 5, that cost would drop significantly to $520 for the year at 5 days a week, but what fun is that?

Since I already know the total potential cost, I only need to track wins this time and not expenses as with past systems. Also, without a clear plan, I never stuck with any of the older systems more than a few weeks.

This is my comprehensive plan for 2024. A new picking system (error corrected mirrors) and a new wagering system with a play strategy and a known potential loss. Keeping in mind I usually only play 4 days a week and most pick 4 and pick 5 selections do not meet the box criteria, I know I will not reach that maximum -$3,850 loss potential even with zero wins. (which, unfortunately is the expected scenario in a one pick straight shooter system where a rare hit is coincidental at best)

Luck will still be the most elusive independent variable. 

Happy Coding, and best of luck in your picks!

Entry #265

Thinking about budgets when it comes to the lottery

The only constant I had last year was playing the Match 6. I spent $728 on tickets last year and won about $1200, with $1000 coming with 5 out of 6 hit. I will pay ~$250 in tax for that win so that means the net profit was $222.

This year, the same strategy for the match 6 will cost $730 (leap year). The cost of the system I have developed, extended to a high scenario of 5 days a week would project to an additional $2,912 for a total planned budget of $3,642 (high end). That would require a pick 4 straight hit or 8 pick 3 straights to cover.

Looking at annual expenditures is an eye opener for sure. But I think that amount is not that bad to have a daily chance at at least $500,000 on the match 6 and at least 4 chances a week at $55,550. I don't know how to make it cheaper.

What does your budget look like?

Does that seem excessive or am I in the ball park with most other players?

Entry #264

3 and a half days in, still waiting for that first hit.

The system is the easiest I have devised to date, yet positive results remain elusive. The first full "week" (5 days instead of 4) will conclude with PA's Saturday mid day drawings.

I will be updating the draw histories and working on the follower add in this weekend, but the next class started so there will not be as much time to devote for the next 9 weeks.

Computer graphics using webGL and the JavaScript Three.js library will be the coursework. Should be exciting to learn the terms and algorithms surrounding 3D graphics, but it is the next 2 classes that I am most awaiting (Machine Learning and Artificial Intelligence). After those 3 classes school is done! BSCS! Then the hard work of developing a portfolio and projects for it begins.

Happy Coding!

Entry #263

Adding a use case for follower data in the current "mirror" system

I thought of a way to not entirely abandon the work I put into the follower system. Since the part where I optimize the zero count has 10 possibilities to cycle through, what if I modified the follower program to print out the followers most frequent for every game in every position and create an 11th and 12th (one for day, one for night) lookup table? This could just be another test injected into the workflow, and the original script can be modified to get the results in one big pass. When tested with the others, if it makes more matches, it's in, otherwise it sits out with the others.

By focusing the output if the script to just the follower number and the distribution list, run time would be about 20 seconds. There is no need to pause the other system while working out the details. It either works better than what is there or it doesn't, that is the charm of considering it as an add on.

I did not measure the time it took to perform the update process, as the games went online asynchronously, but if the overall process can be held to an hour or 2, then weekly updates might make sense. The nice thing about actually recording the zero counts with each possible lookup table set is that you get a feel for how close the top performer is to the runner ups, and can determine an update schedule for each game, that would be a time saver for sure.

I am hoping that when I have my class in machine learning, I will pick up new skills to refine techniques, particularly in automating processes. The work put in so far will definitely be helpful.

Because of my overnight work hours, I play night and the next day. After 2 days of the system there have been no wins yet, but on the PA mid day pick 2, missed by one both days (up and down so not a trend... yet) 2 of 4 in the pick 4 and 3 of 5 (in position) on the pick 5. Both pick 3 games have had 1 or 2 matches in position each play. From remembering how off the followers were, it is a marked improvement... but again no wins yet. Still running the test through March 1st, still hoping for that elusive Pick5 straight.

By keeping photos of the lookup tables for each game, picks can be generated on the fly in less than 5 minutes, so that is a huge improvement in ease of use over the old follower system, but incorporating that data will be an easy add, and it would have to produce more zero counts (hits per column) to be implemented. Outside of the script modifications and running a count test, the ease of pick generation stays the same.

Onward and hopefully upward.

Happy Coding!

Entry #262

And so the experiment begins

Now that the entire system is finished, it's time to give it a legit shot from now until March 1st.

So there is a system to generate 1 and only 1 pick per game that is based on error corrected mirrors, that is inclusive of the PA pick 2, Pick 3, pick 4 and pick 5. The wagering strategy is the same as for the old follower system, $1 straight bets across the board on the days I play (usually 4 to 5 days a week) so the max expected cost would be $40 per week.

The jackpot games are slightly different, as I do not see a clear path to error correct so they are just straight up mirrors, the key to keeping it cheap is picking the minimum jackpot amounts to trigger a play.

For PA cash 5, minimum 1M jackpot

For PA Match Six, minimum 2M jackpot

And for the Mega Millions and PowerBall, minimum 200M cash option

With these restrictions in place, the jackpot game chase will be much cheaper. I may adjust them higher to stay on budget.

The pick 2 was added for a better opportunity to play on their money, and because the process was easy once established.

Next up is an update strategy, which looks like a weekly draw update with a bi-weekly run through of the error correction process. This error correction update is the part of the process most suitable to explore Python automation. I have already established a working routine of steps to max the zeroes, now all I need to do is figure out how to do that in code. But unlike the follower "algorithm" I am not stuck waiting to get picks and play, as the manual process on the spreadsheets is not difficult.

Will it work? Probably not, but again the learning experience was worth it as now I had a chance to hone the spreadsheet formula skills.

I do have a problem of getting bored and/or frustrated with the lack of positive results after only a few days. Running a test for the entire month of February will be a good exercise in staying the course.

And so it begins, my nth attempt at a one pick straight shooter system...

Entry #261

Go for the full card? Contemplating PA Pick2 sheet to have all games in rotation.

On one hand it is another 2 histories to scrape from the PA website (about 30 minutes), creating the history files (10 minutes) and running the "process" to optimize for zero ( about 30 minutes per sheet). Add $2 to the cost, bringing it up to the original $8 of the follower system.

On the other hand, it is another chance to have a hit and get funding on the state. Then all 4 dailies are playable...

Decisions...

Entry #260

Adding the PA pick 4 when time permits.

May as well extend to the Pick 4 mid and eve. Brings total cost per day to $6, but still under the $8 of the now retired follower system.

Should be able to find the sheet creation time this weekend, plus have to update the P4 data files as they are mid November 2023 stale. I am figuring on 2 hours of work to get it added.

I will need to get a consistent draw history update schedule going since daily updates are no longer required. Still struggling with a python program to scan the PA RSS feed, but still working on it. The URL returns data using the Python requests library, now I need to solve parsing the data and extracting only the games of interest. If it were a JSON data format like lotteries with an actual API I would have it working already...

Entry #259

Some thoughts on the new mirror spreadsheets

The mirror system went from concept to playable picks in about a week, in contrast the follower system took months to get to the same place.

Of the PA P3 and P5 (mid and eve), only the P3 mid back tested to be profitable, as it would have hit $9k over 7,600+ draws @ $1 straight. By NOT searching for max past wins, over fitting was avoided.

The process follows basic machine learning operation...

1. The estimation function began as a simple mirroring of the last draw.

2. The error function captured the signed difference of pick vs. Result, which means zero was the most common error at each phase because the other numbers are split by being signed (+ or -)

3. The "gradient descent" part where calculus is employed to adjust the estimation function was replaced by cycling through all lookup possibilities that remained sequential and recording the resulting zero count, then adjusting the lookup tables to reflect the change. The result is the same, estimation function reached the global minimal error.

It is important to note that the best low error scenario is only slightly above 10% of the draws in each column, which was the expected ratio with a near uniform distribution.

In the end, I have a playable system with a few benefits over the old complex system...

1. Laptop not required to make picks. I took pictures of the column lookup tables and can calculate picks anywhere. No daily program to run, only periodic updates to the draw history files required.

2. Result is only 1 pick instead of 2, which cuts the cost of playing in half. Finally developed a one pick straight shot generator system! Starting this system at $4 per day played.

3. I cannot shoehorn jackpot game history into the program to generate a pick, forcing me to rethink that problem on it's own.

As a kicker, I saved $40 from my last lottery win so the first 10 tries are "on the house".

I have undoubtedly gained programming experience with the follower system, so those months were worth the effort, but I still think this basic simpler system represents my "best guess", adheres to my belief that these daily games are sequential games of one in ten (which is why it scales from pick 3 to pick 5 easily), and because it uses the result of the previous draw, it employs their own randomness in the pick selection process (just like the follower system).

This system seems like a keeper for simple operation, but I have 3 classes to go, the last two being machine learning and AI, so there will be MUCH more to come this year.

The goal remains the same, hunting that elusive pick 5 straight win as cheaply as possible.

Entry #258

Working in a spreadsheet using mirror numbers as a start point

The next system after the complex python follower system is 100% spreadsheet, no macros.

Using VLOOKUP to mirror the last draw as an estimation function, then using signed error counting (so they pick 3 you pick 2, you were 1 too low, error is a 1, but they pick 2, you pick 3 your error is -1, or what direction and number to get your pick to match the draw.)

From this signed error function, we can count zero, as that means a correct pick.

The last part of our pseudo machine learning process would be the part where you make adjustments to the estimation function to maximize the zeroes in each column. This is the part that mimics machine learning, as we are NOT trying to maximize past hits, that would lead to over fitting. We are maximizing the zeroes in each column by indexing the mirror lookup table!

With a mirror set to 0=5, that is a true mirror. The other extreme is playing the last drawn digit directly. There are 8 other possible values that are sequential that do not eliminate any possible numbers, and VLOOKUP means no lottery math at the edge cases.

Finished the pick 3, hopefully pick 5 ready to go by Feb.

Entry #257

Follower system loses momentum in the spreadsheet

Back tests have value, even if it is to identify the shortcomings of an overly complicated system.

The spreadsheet creation was also a fun dive into formulas and applying error correction masks. The knowledge gained from clean sheet python scripts to getting back to a spreadsheet with more focus than previous attempts was surely worth the time invested, and the money saved by NOT playing the system!

I must go back to the drawing board for a new estimation function, but while I await inspiration, I will continue to hone the spreadsheets on simple guesses, like mirroring the last draw, and testing that out through history files.

The follower second pass data had a most common error of 0 across all 3 digits... problem is they don't line up for wins.

This next spreadsheet only attempt will be based on replacing the follower guesses with the mirror numbers of the last draw, counting the hits, applying the error correction step and counting those hits. Other simple one line workouts could be applied as well and tested in the same manner.

By designing the sheet with VLOOKUP for the mirror replacement scheme, changes and tweaks (and hit counts) can be explored. Live play tests can be shorter and cheaper, and the goal of a pick 5 straight hit can still be attempted... cheaply.

 

Back to the drawing board. 

 

Happy Coding!

Entry #256

Spreadsheet ideas for error identification.

After evaluating several formula ideas for capturing the difference of the drawn number and my pick, I ultimately decided to go with a vertical lookup table (VLOOKUP) that has 100 rows of every possible drawn digit and every possible prediction. This keeps the results signed (+/-) so I can then count each observed error with the countif and use max to find the most frequent signed error for the data in each position.

Got a busy work week, so I might not get to finish the sheet, or even update the draws until the weekend, which is the perfect tine to test the indexing function of my python back testing script to just process resent results by changing the offset variable.

So, since the systems are not profitable in raw form, looks like I will be waiting to start playing for awhile longer. But, by taking the time to think through each step, I am ending up with home brew tools and a work flow that can be used with any single pick system.

I had a feeling that the follower system was not profitable, I have no gut feeling on the result of error correction applied to it, but the trend will most likely be that it increases the number of hits, but not by enough to have been historically profitable.

When my old laptop bit the dust, I lost over a decade of excel files. Never again! Everything I am now working on is backed up to an internal storage drive AND an external drive.

The biggest problem I may be facing is that outside of followers, I am out of ideas...

Entry #255

Prepping the spreadsheet while the programs run

I have officially begun the next phase, so while the estimated program run times for the pick 3 mid /pick 3 eve/ pick 5 mid and pick 5 eve are a cumulative 5 hours... prep can be done.

Step 1 is to update the draw history sheets... done

Step 2 is to make a fresh copy, so the originals can remain for running the short forecast code later... done

Step 3 is to wait until the programs are done running... in process...

The questions will be answered one at a time, first being how many hits? So the test for that will be a one cell formula using the following format...

IF(AND(condition 1;condition 2;condition 3), 1 if true, 0 if false)

The benefit of this setup is counting hits is a simple sum. Filtering for 1 will show the dates of the hits, enabling calculating gaps.

The difference (or error) will be drawn-guess

As for how to interpret that info, that will have to wait until I get that far... but work is in process!

Entry #254

Python development complete! Time to move the data to Excel.

Though it is still running 37 minutes after I started it, in less than 20 additional lines of code I was able to get back test data. It runs the follower code for the first 1,000 draws, adds the next draw and repeats the process. Using the mid day PA pick 3 data for the test run, so the eve file will take twice as long... but when run will provide a list of picks to compare to draw results.

Now I will be able to see results.

The spreadsheet design part of this is based on the questions I want to answer.

1. Would this system ever have won? If it did, were there enough hits to be profitable? What were the gaps between wins?

2. How far off were the system picks from the draw results? That is the difference between the drawn number and the guess.

3. Is there one difference that happens more than others? If applied as a mask, can it produce more hits than the raw guess?

4. Is it better to use some form of absolute subtraction to obtain the difference or would it be better to use an Xlookup table?

Some daunting work ahead, but for most of my time playing the lottery, excel was my wheelhouse. This part will also take time to get right.

The code changes were tested at each step to get them right, the same care will be taken with the spreadsheet.

This was a HUGE step, and it only took 2 days. I am hooked on Pandas data frames in Python, that was the secret to cracking the execution of the back test scenario with such a complex estimation function (follower data).

The end goal is to obtain an error correction "mask" that can be applied to the original follower system picks for a better guess. The notes I left myself in this blog helped maintain focus. Even without much interaction, this is a very useful Lottery Post feature!

Entry #253

Free time is around the corner!

I have to take a final exam in Mobile Application Development later this morning. After that I am planning on starting to build an error correction back test version of my follower program.

There are 5 areas that need to be implemented, and I have solved 3, I will begin making and testing those changes. Obtaining the error correction masks is the primary task at hand as I have suspended play until that is complete.

I have "off" of school until Feb. 1st, so I plan on wrapping this phase up before then. Once I can generate the error data (how far was the pick off from the forecast) then begins the trial and error phase of learning how to work that data into a mask that can be applied to future draws.

3 more classes to go to wrap up a part time 8 year journey to a Bachelor's Degree in Computer Science. In that time I need to create a strong coding portfolio (not using lottery code) and hammer out a respectable resume as the ultimate goal is a fully remote software developer job. 2024 going to be busy from start to finish!

Entry #252

Last play of the year

Going with a last play for this year with pick3 and pick5 day and night. Also a match 6 since it managed to hit over 3M! Gonna pick up a PB as well so I do not have to do anything tomorrow but celebrate the new year with the family. 

16 days left of this class, then I implement error correction into the follower system, then the play strategy is most likely 4 days a week, and the goal is pick 5, so that goes into full rotation.

Have a wonderful new year!

Entry #251