hypersoniq's Blog

The plan for incorporating follower data into the current system.

There are many steps, so may as well make myself a checklist...

1. Update ALL of the draw files, from pick 2 mid to pick 5 eve

2. Rewrite the main section of a copy of the python program (cheapest revision control ever) to input the "last draw" as all zeroes, through all 9's. This is the way to see all follower data all at once. With a proper loop, this can be done in one big run. Output reduced to distribution list, with the top being the most frequent. This will require updating CSV files for all games, as well as adding the pick 2. Long step!

3. Modify the spreadsheets where I track the zero counts of each possible lookup table. Currently there are 10 that can be applied to day or night. This mod would add 1 follower table for day and one follower table for night.

4. Re run the zero count tests incorporating the follower data. If a follower group outperforms the other groups on a particular column in a particular game, then it becomes the new lookup for that column. Zero count is the goal, so if they are not the highest, they get rejected and the work was for nothing but coding practice.

To date there have been exactly zero wins, but I have stuck with it so far. Starting for this week tonight.

Yesterday was the last for the most recent match 6 ticket, so playing a new one tonight also (for 26 draws).

Any big jackpot games will be a la carte, as they will be infrequent in terms of the year.

The current system maps the digits 0 through 9 based on the last draw. I am currently cycling through 10 combinations to dial in the zero count, with 2 more planned. For that map, there are actually 10 Billion combos! What I should do is write code that can capture the data I am catching manually and run a full fledged zero count on all 10 billion possible values for that side of the lookup table... not sure how to approach that one YET, but it is definitely on the back burner!

How do I get 10 billion? Just like the odds for the pick 3... 3 numbers that can be from 0 to 9 (10 digits). So the possible combos equal the odds. 10x10x10 =1,000 (10 to the third power)

For 10 positions each having 10 possible values, that becomes 10 to the 10th power = 10,000,000,000.

Granted some will be impractical, like 0 0 0 0 0 0 0 0 0 0 or similar ones that eliminate too many numbers, but that would reflect in the zero count.

I am thinking that a loop which increments each position in a list, performs a substitution and counts the zeros, placing the list with the current high zero count into a variable.

The running output of the program could be the number of the loop iterator, using a "overwrite to the same line" trick in Python to get an accurate running count without running into screen buffer overflow issues would do the trick, with a final output of the list(s) that scored highest. After that, take the top 10 and plug them into the existing system and run the manual tests as before.

No idea is ever done, there are always tweaks, improvements, and what-ifs to keep one occupied. My concepts of modular coding and even with the spreadsheets being flexible enough to model basic machine learning algorithms will keep me busy for some time... until the next "big idea". Except for wins, I got what I wanted in a lottery system

1. Easy estimation function

2. Implementation of an error function

3. Use of the data in the error function to alter the estimation function with a goal to column zeroes instead of past wins.

4. Super easy to play on the go. No need to pull out the laptop before every draw (a limiting factor in the original follower script).

For years I have tried and scrapped many system ideas, some were just bad and some failed to be fully realized because I did not really know how to write programs (or decent macros). No more! The modular (reusable) code base grows with each new experiment. By the time I finish my last three classes, I should be able to do rapid prototyping of new ideas because I will get TIME back.

20 years later and still searching...

Happy Coding!

Entry #267

What would success look like?

Systems and strategies come and go, I have worked on several over the years.

With any system, what does success look like?

On a new add to my system, the simple pick 2 is a 1 in 100 chance of being right. Once could be merely coincidence. How many hits would be needed in what time frame to consider the system a success?

It is different for jackpot games as that only needs to work once.

This is where I fall back to profitability.

I am currently playing all PA daily games both mid and eve draws, roughly 4 days a week. Since I can use that to calculate total possible loss, I can also use that to calculate success scenarios.

Breaking it down to individual games, the success scenario would be as follows...

Pick 2

To cover it's own cost would need 11 wins this calendar year.

To "carry" the whole system it would need 77

Pick 3

To cover it's own cost would need 2 wins this calendar year.

To carry the whole system would require 8

The pick 4 would require but 1 to carry the whole system, as would the pick 5.

The match 6 would require 4 [5 of 6] hits to carry the whole system, though that game also has the n of 18 3 line count, which could pay up to $2,500. A jackpot win on that would be life changing of course, but also cover the system.

The first week brought zero wins, so to date the system has not been effective, but it is only the beginning of February.

So I think I would define success to be any combination of wins across all games that cover the expense of playing to be good, and any combination that also generates a profit to be great.

Seems overly simplistic, considering the odds of all games are as posted for 1 pick per game.

Pick 2 is 1:100

Pick 3 is 1:1,000

Pick 4 is 1:10,000

Pick 5 is 1: 100,000

Match 6 jackpot is 1:4,661,272 (according to the PA lottery website) but is actually 1:13,983,816. They doctor the odds due to giving 2 quick pick lines for the one you play. Making those odds a more realistic 3:13,983,816

Each of the above odds are present in each game no matter how many times I play the system.

So, got a way to pick, got a betting strategy and budget, got an idea of how it might be measured as successful, all that is left to do is win...

Now if only PA would stop picking the wrong numbers!

Entry #266

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