Cover Strategy Not too long ago, I decided to undertake a new code project in ASP.NET 2.0 and SQL Server 2005. It is a code project to generate all combinations of 5 from a pool of 15 numbers and to reverse engineer a “wheeling” system, or covering strategy, where the numbers in the result-set are “highly balanced” (i.e. all numbers are paired an equal number of times, and occur as part of a triple, 3 repeat on same draw, an equal number of times) and the output has other properties capable of being filtered. I am now about 19- 23 hours into programming this endeavor and it’s been a lot of fun, and I learned a lot too. Another lotto wheel source listed 50 as the minimum number of plays needed for the guarantee to win 4/5 if 4 of your subset of 15 numbers are drawn. A new, ongoing test will be to try this method on draws when there are strong indicators that all numbers will have been recently picked from within the last 5 or 6 draws.
09/29/07 Since it seemed like a very interesting challenge, I decided to convert the code I had written in an Access database that generates all possible combinations of 5 draws from a pool of 15 numbers (or any N of X). The migration, which started last Saturday, would be to newer technology and a more powerful database engine: SQL Server 2005. VB.NET would fill in as the programming language when it was quicker to prototype objects and functions than a stored procedure (sp is basically a query on steroids) in the database.
09/30/07 is Sunday day two of this undertaking, same development style: hang out with family and work at same time or occasionally. First thing in the morning I’m looking at it with a fresh pair of eyes and a new perspective as I continue building it. Maybe I undid the last thing I did yesterday while trying to keep working when tired. I was rather distracted since I did the work while hanging out with my wife and soon to be 3 year old daughter in the living room on Saturday/Sunday.
10/01/07 6:11 AM California time, I am 1 hour into my third day of development, I’ve almost got pre v1.0 recordset function working in .NET. Everything is in one class (thus far) as properties and reusable functions and a few stored procedures in the DB. I spun my wheels trying the new version of Array object and ArrayList in this latest version of VB.NET. I added a set of “ifs” as a temp workaround for the sake of “quick prototyping”, but also because I could not proceed to any next step without the array and sorting functions. At 2PM, I get another good hour here at home to do some coding, quick debugging, and I’ve got it working!! Or, I have what I think are the tricky parts completed, the remaining pieces should be straightforward. I was so ecstatic that I took a break from this multi-hour fun though occasionally frustrating project.
“Carpe (Dev) Diem” is my mantra du jour, “sieze the Development time at all hours of day” or when possible; that has taken on new importance now that my daughter has lost her interest in taking afternoon naps. I temporarily got in a groove of programming time and progress and my household tasks quickly piled up. Wife complains.
10/6/07 I return to the code that generates all combos of N from a pool of X. Now I’m thinking I also have to code in a number of filters, such as kick out draws where all 5 numbers are odd or even, or exclude the “1,2,3,4,5” types of draws. I have a clustering query that breaks the draws into 5 buckets (1–8, 9-16, 17–24, 25-32, 33-39) and gets an aggregate count of the different types of distributions –that’ll be a starting point for what to filter out. Better yet, I’ll add as much user defined functions as I possibly could.
Switching Gears? Due to the complexity and processing overhead involved with generating all possible combinations of 5 numbers in a pool of 15 numbers, I put it on "hold" temporarily and switched to programming the infrastructure for all combinations of 3 numbers where the range of numbers is between 0 – 9; your standard three draw lotto game. The version one starts with generating all 1000 possible combo's with a separate switch for choosing the number of odd numbers to filter the 1000, as well as a function to specify the SUM range (of all three numbers added). It is again using ASP.NET and a SQL Server 2005 database; one the big technologies for building Web based applications that can communicate with a SQL Server 2005 database online. I was able to change gears (from the 5 draw code) and get the smaller scaled project done and launched ( the v1.0 version) done in about 6 hours. I was able to get a lot done rather quickly since I was able to inter-mix database stored procedures and code in a few classes to extend what a database can normally do. Along the way I added a couple of User Defined Functions in the SQL Server 2005 database; this will open the door to other metrics being efficiently added in the near future. I'm going to be coding as much as I can leading up to the holidays and then see where I'm at. I’m pretty sure I can expand the current project and have something working by end of Thanksgiving weekend. I hope to have the Ilya Bluskov (sp?) combinatorics book incorporated, though later.
Daily 3 For the 3-draw application, there’s a function for returning the Odd count, another for the sum of all 3 draws (75% of the time the sum is between 6 and 19 when adding all three digits for CA Daily 3), a checkbox list is there that filters the criteria for all three numbers, where selecting 0, 1, 2, 3, 4, 5 in the checkbox list will return all combinations of those numbers and nothing greater than 6 in the result set is returned. In the near future I’ll add a Multiple Select List box to return a “Kitchen Sink model” where all criteria can be return in a huge record-set. Tester's for this 3 draw application, as well as new suggested metrics to code are welcome.
Since I have the 3-draw example working, I am now ready to return to coding the 5 draw engine; the rough part is that I’ve got to iron out sticking points and try some new methods along the way. Picture a jeep stuck in the mud, or maybe it’s more like pushing a big rock or two up a hill. It’s a strange, frustrating kind of fun.
More to be written along the way.