The time is now 7:12 am You last visited March 20, 2010, 7:09 am | LottoMining's Blog
August 23, 2008, 3:25 pm8/23/08 is great draw to run the balanced Wheel of 10 in 32 for CA Fantasy 5For California’s Fantasy 5 draw on 8/23/08, it looks like pairs of numbers that have shown up in the last few days are going to repeat again for the 8/23 or 8/24 draw, so it would be an interesting experiment to run a balanced wheel of 32 plays when picking a subset of 10 numbers. It looks like 3 repeat from the same draw could also recur for 8/23 or 8/24. Best o’luck…
The numbers are 2,3,4,14,18,24, 28, 30, 33, 39
February 9, 2008, 11:13 am2/9/08 CA Fantasy 5 is great draw to run the Group WheelThe draw for CA’s Fantasy 5 on 2/9/08 offers excellent opportunities to run the BobP “group wheel” (it specifies a 4/5 if certain conditions are met). About six years ago, I recall the definition of “turnover” (on Saliu’s website), the average number of draws it takes for the various numbers to repeat. I’m looking for all 5 numbers picked on 2/9 (or 2/10 i.e. very soon) to have been last picked somewhere in the last 6 draws. I’ll have to drop a few numbers since there’s 24 unique numbers in the last 6 draws and the BobP group wheel specifies a pool of 20, so I guess I’m introducing bias into the pool but that’s the best for now. On weekends and evenings I’m working on a balanced wheel of 32 records, similar to the 64 result set. It’s slow going, but an interesting experiment. No, I won’t be playing all 64 suggested plays; it’s just a very interesting experiment #2, since #1 did hit a 4/5; here: http://www.lotterypost.com/thread/168276/5 ) 5,6,9,10,12,13,14,15,20,21,23,25,26,29,30,31,34,35,38,39 I might re-run it later on 2/9 mid-day before the actual draw with slightly different #s. Yes, I’ll be putting a few on the prediction board later today… Feel free to pick your index/records below just for kicks
December 22, 2007, 1:53 pmAccess database and VB DB code primer draft 1This is a v1.0 draft of a quick introduction to the tables, queries and VB code section of the Access database used as a lotto data-mining tool. Although I would agree with the sentiment that there are no shortcuts in learning programming (like learning music or Math you see it or you don’t) there are a few automation shortcuts in the Access database, such as the use embedded SQL (Structured Query Language) in the VB editor to enable getting things done quickly. The modern database is built around the relational model, which groups pieces of data into similar entities as a means to reduce redundant data (an oversimplification, therefore the "1st draft" label to this bloogie). Your table(s) will generally model or be defined by what you're trying to track. In this case it will be a Pick 5 game. At the most granular level, you are generally asking questions about certain metrics, when did this # last show up? Or how many times in the last 7 10, 20, … 100 draws? Once you have built one test, you build another…and so on. Perhaps a new unexpected insight leads to yet another (15 is picked 5x in the last 6 draws… what other things happen when that occurs?). I like the following metaphor to describe the most used parts of the Database: the tables are the chassis of the car, the queries are the engine, the forms are the doors and/or windows and the reports are the chrome. This write up will focus on tables and queries and hopefully work its way to moving the queries to code so folks can build, test and win. I’ll call it a draft because if there are questions, I’ll fill in some of the blanks and because this draft is by no means exhaustive to the topics. Table Design The rules of table design can be thought of as a blend of Art and Science, but they “are really just formalized common sense” as famously quoted by Database guru and author C.J. Date. Although the most often books list normalization rules up to “third normal form” we’ll concern ourselves with the first two when modeling/tracking attributes of a pick 5 lotto game. First Normal Form states that data in the tables’ fields must be atomic, that is broken down to the smallest unit (example: store someone’s name as last name and first name separately, so if you have to specify a criteria on a name it is easier to do when one field contains one value only). Second Normal Form has to be with not allowing redundant fields in the relational table structure. One will want to employ the primary key concept, which enforces uniqueness in a column that in turn protects against duplicate data and/or missing values. When you create fields for your DB tables, do not include spaces in field names "FirstName" (NOT "First Name") because when you use the field in code you'll have to bracket it "[First Name]" otherwise you'll trigger an error. Similarly don't start your fields with a digit or those other non Alpha-numeric fields eg. "-" because your code will think it is the subtraction operator which is likely not your intention. Basic Queries Most of requested uses of SQL (Structured Query Language) are straightforward, though there are many esoteric parts that can get tricky. The basic structure is: SELECT fieldname1, fieldname2 FROM YourTableName WHERE fieldname1 = 123 When joining tables in a query, there are different kinds of joins that can be done that mirror some of the different kinds of relationships among tables and other queries that typically exist in a database (one to one, one to many, many to many is not supported directly; it requires an intermediate table for a lookup work-around). When creating a query without specifying a join the engine will create a cartesian product of the all the records in the tables referenced in the query; a useful function for generating all possible combos of 3, 4 or 5 from a pool of x numbers. There are basic SELECT queries and Action queries (INSERT, APPEND, UPDATE, DELETE). You're not required to capitalize the Keywords, it is just good practice for the sake of readability; you are doing yourself a favor down the line when you return to the code and you want to quickly figure out its meaning without draining your brain of horsepower at 3PM or 3AM. There are also Aggregate queries, which allow you to easily get Sums, Averages, Min, Max, Variance, Standard Dev; your basic "Descriptive Statistics" functions built in. You can call your own user defined function, provided that it is already saved in your Module window of your database. When learning how to work with queries, I'd strongly recommend going to the pull down "View" menu and select "SQL" view so you can read what you are doing, it is pretty close to standard English. Once familiar with SQL it can be placed in the VB Editor as embedded SQL, which can be a fast method for automating various routines and functions. Below is an example that can be strung together as part of a larger program to suit your needs. ' a brief example of SQL embedded in the VB editor; an update query is shown Docmd.RunSQL "UPDATE tblData SET D1 = 2 WHERE D1=1;" The UNION query is also a very useful construct. It allows you to append one recordset to another, provided that both recordsets have the same fields, in the same order and are of the same datatype. UNION ALL will include duplicates in the resulting recordset, where UNION will quietly not include duplicate records. You could add a WHERE clause to filter this by Date range, for example. 'save this query as "UNION_ALLDraws_1col" SELECT tblData.D1 FROM tblData UNION ALL SELECT tblData.D2 FROM tblData UNION ALL SELECT tblData.D3 FROM tblData UNION ALL SELECT tblData.D4 FROM tblData UNION ALL SELECT tblData.D5 FROM tblData; ' this returns the frequency count of all 39 numbers , when query above has been named as instructed. SELECT UNION_ALLDraws_1col.D1, Count(UNION_ALLDraws_1col.D1) AS CountOfD1 FROM UNION_ALLDraws_1col GROUP BY UNION_ALLDraws_1col.D1; Variables in your code For this introductory article, I think we’ll keep the variables inside the function (“at the procedure level”) in which they operate to be able to skim over global variables. The time during which a variable retains its value is known as its lifetime. The value of a variable may change over its lifetime, but it retains some value. When a variable loses scope, it no longer has a value.A procedure-level variable declared with the Dim statement retains a value until the procedure is finished running. If the procedure calls other procedures, the variable retains its value while those procedures are running as well. If a procedure-level variable is declared with the Static keyword, the variable retains its value as long as code is running in any module. When all code has finished running, the variable loses its scope and its value. Its lifetime is the same as a module-level variable. Also always have "Option Explicit" at the top of each code or form module. Otherwise you will think that a variable is in scope because the code compiles, whereas what is acually happening is that a new (local) variable has been created on the fly. DAO / ADO ("Data Access Objects", the old object model three generations prior, pre .NET) Although this is the old way of doing things, I believe this syntax is easier to memorize and therefore get up to speed with. Make sure to have a reference in the References dialog box set to Microsoft DAO 3.6 or 3.51 library for the compiler to recognize the code. Below is a very basic loop that can be built upon after having some practice with it. The ADO (ActiveX Data Objects) I wrote about 5 years ago has some sloppiness or bad habits, but it works and at the time I wanted to quickly prototype things and move on to the next. I did put in the time to learn ADO because I was going to jump into the ASP.NET/ADO.NET technology. It is a Rapid Application Development (RAD) technology that builds Web pages that can communicate with a back-end Database (it's optimized for SQL Server 2005). Access wasn't designed for web use or multi-user use; you'll need to upgrade to SQL Server 2005… I think MSFT also has free, scaled down version of SQL available to compete with the “free” stuff out there. I like all the productivity tools with Visual Studio 2005 Professional so it makes the work rather fun and very efficient. 'you could assign D1 in the loop or you could call a user defined function 'this code assumes you have a tblData table or query in your DB or the code will 'trigger a run-time error; error handling may be covered in a later draft Sub BasicRecordsetLoop() Dim db As Database, rs As Recordset Set db = CurrentDb 'use the current DB Set rs = db.OpenRecordset("SELECT D1, D2 FROM tblData;") With rs rs.movefirst do rs.edit ''' you'll get a run time error if there is rs.edit without rs.update rs!D1 = rs!D1 * 1.1 rs.update ' change won't happen if rs.update is omitted rs.movenext loop until rs.eof 'eof = End of File End With Set rs = Nothing ' free up memory End Sub 'Tables tblCtAll6, tblCtAll10, tblCtAll20 must exist in the DB and the fields will be Date, 1, 2, 3… 39 for the loop in subroutine "LoopCounts" going up to 39. Datatype for digits should be Number. This code will get the frequency count of numbers 1, 2, 3 … 39 in the last 6, 10, 20 draws in an efficient manner (i.e. look at the line of code that begins "rs(strFld)=". Sub SubRoutineThatCallsAnotherSub() 'this one passes an argument for code re-useability a design goal as you build things... Call LoopCounts(6) Call LoopCounts(10) Call LoopCounts(20) End Sub Sub LoopCounts(intX As Integer) Dim db As Database, rs As Recordset, strFld As String, i As Integer, strNum As String, strTable As String strTable = "tblCtAll" & CStr(intX) Set db = CurrentDb Set rs = db.OpenRecordset("SELECT *, Date FROM " & strTable & " ORDER BY Date DESC;") ' With rs rs.MoveFirst Do i = 1 Do strFld = CStr(i) rs.Edit rs(strFld) = fxCountXBack(i, intX, CDate(rs!Date)) ' rs.Update i = i + 1 Loop Until i > 39 rs.MoveNext Loop Until rs.EOF End With Set rs = Nothing End Sub 'below is some sloppy ADO (written 5 or 6 years ago) that is called in the sub above 'Please forgive the messiness below Function fxCountXBack(Num As Integer, ItNum As Integer, dtDate As Date) As Integer 'counts how many times each number has been used in last 100 draws Dim cnn1 As ADODB.Connection, StrRS100 As String Dim rs100 As ADODB.Recordset, SumALL As Integer Dim D1 As Long, D2 As Long, D3 As Long, D4 As Long, D5 As Long Set cnn1 = New ADODB.Connection Set cnn1 = CurrentProject.Connection Set rs100 = New ADODB.Recordset StrRS100 = "SELECT tblData.Date, tblData.D1, tblData.D2, tblData.D3, tblData.D4, tblData.D5" & _ " FROM tblData WHERE (((tblData.Date) Between #" & dtDate & "# And #" & dtDate & "# -" & ItNum & ")) " & _ "ORDER BY tblData.Date DESC" rs100.Open StrRS100, cnn1 'Debug.Print StrRS100 rs100.MoveFirst SumALL = 0 Do If Num = rs100("D1") Then SumALL = SumALL + 1 ElseIf Num = rs100("D2") Then SumALL = SumALL + 1 ElseIf Num = rs100("D3") Then SumALL = SumALL + 1 ElseIf Num = rs100("D4") Then SumALL = SumALL + 1 ElseIf Num = rs100("D5") Then SumALL = SumALL + 1 End If rs100.MoveNext Loop Until rs100.EOF fxCountXBack = SumALL End Function November 17, 2007, 12:22 pmMicroISV: guiding a product/skill down road to independenceMicro ISV (Micro-Independent Software Vendor) I finished reading a really awesome book not too long ago, very highly rated (on Amazon / MicroISV: From Vision to Reality). It is a book for those people who may have had the dream of leaving “Cubeland”, that vast corporate expanse, and starting their own business around their computer-related product or service. I finished reading the book and now revisiting certain pages as part of a checklist to get the list of to-do’s and guide future work. The author creates a roadmap for traveling the road to independence away from the world, and mindset, of working for someone else since he did it at some point in his career, somehow jumping out of journalism and starting as an independent contractor building Information systems for various clients; and later selling a time and project management systems to help individuals be more productive. Since he was a programmer while working towards independence, the book has the perspective on what your technology has to do, how it looks and where it is seen. There are a great number of interviews with people who have successfully been down that road and have grown a variety of business entities from the ground up. The links in the book alone, along with context on why you’d need them make the book worth its weight in gold. Another emphatic point is that it is harder than it looks, and he does mention the old adage of why work for someone else for 40 hours a week when you can work for yourself for 80 – 100 hours a week. Among the many helpful tips this book has: the author pointed out the importance of getting your spouse’s buy-in before you take on this new endeavor, otherwise it can cause a lot of grief on the home-front. The author also happens to be the 4th rated blogger (in the top 25) on the topic of improving all facets of a blog, while maintaining a separate blog on all things MicroISV. I think all sorts of tech people here will find it a fascinating and invaluable read. I myself will try to work more closely to the principles he freely writes about, and it will temper my own programming bias since the book points out that you have to wear 47 hats to get that endeavor carried forward. Like the rare movie that you can watch more than once, I have gotten different pieces of info and slightly different perspective when referring back through various pages to work on getting all the building blocks in place. This chap has written a remarkable compilation in that book and the free resource as well. November 10, 2007, 12:33 pmcode project to generate all possible combinations Phase II(this is a continuation of the other Dev log that chronicled the first 14 hours of starting a tricky project in my spare time, after weeks away doing life’s other things and bits and pieces of tech work) 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 (it is up there and FREE). 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. 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, once I figure out the way. October 29, 2007, 9:36 amrun of pairs repeating & low unique count in CA Fantasy 5There were 16 unique numbers in the last six draws for California’s Fantasy 5 on 10/29/07, that is an all time low in the table I’ve built that records its daily count. It has the last 3300 or so observations; one day I’ll get around to back-filling the rest of the dataset though 3300 will do for now. The related fields in the table tend to show that when a low unique count shows up, there’ll be “replacement” or turnover, where numbers that haven’t shown up in a while fall back into favor. The way more interesting metric is that there’s been a huge run of pairs of numbers repeating in the last 13 draws and it could recur yet again on 10/29/07. I’m going to be playing my pesos today by only playing the last 5 or maybe even 4 draws only and that pairs or three numbers from x (1 – 6) draws back will repeat yet again.
In a post from a few months ago, I mentioned that all 5 numbers will have been picked from the last 4 draws, well that occurred on 10/14/07. No I didn’t win on that day, it snuck by since I was playing a slightly different strategy. On the programming side, I did get further along on building code for wheeling or generating all combinations of 5 from a pool of 15 numbers. A simple version is working; I’ve got to expand on it for it to be useful. I just got sidetracked with so many other things. Plus I think I’ll adapt it for pick 3 games first as a way of getting the overall concept working on a faster timetable…. this is just a brief update on the previous blog. I have more building and writing to do on that topic as well. October 6, 2007, 12:47 pmcode project to generate all combos of 5 in pool of 1510/6/07 After reading the post at (LP>Lottery Systems>Wheel Generator 1.5) 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. 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. September 30, 2007, 12:39 pmCA F5 had two triples in 3 daysCalifornia’s Fantasy 5 has had 2 draws of the last 3 draws where 3 numbers repeated from X draws back. In this case, 9/27 had the 6,16,26 repeat from 9/25 and 9/29 had the 3, 16, 36 repeat from 9/22; 7 draws back. I missed it on 9/27 (though I knew we were in “triples territory”) but I hit it on 9/29, picking the 3, 16, 36 three times with the actual tickets and on the LotteryPost prediction board. The draw where 3 repeat from X (X range = 1 – 10) draws back has occurred many times this year in 2007; my count is 39 times. That is over the average and we are not even done with 2007. There was a different variable whose short term average was lower than its long term average and it gave me an early indicator of a flurry of 3 repeating from X draws back between April and May this year. I hit the triple on 5/7 and managed to get the fourth number since I limited the pool of numbers to choose from. After recurring on 9/27 and 9/29 I wonder if it’ll lay low for a couple weeks. Let’s see if it kicks out any early clues again. September 8, 2007, 9:14 pmCA Fantasy 5 3 #'s could repeat on 9/8For California's Fantasy 5, there has been a lot of pairs of numbers recurring lately. A number of years ago I was doing a few internet searches and some site This is not only my two cents worth, it'll be my $12 worth, since that is the filtering More tomorrow. |