Yang Michael
unread,Sep 2, 2013, 11:51:41 PM9/2/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello Colin Fairbrother, Michael, and all the other coverage experts.
I currently develop my own software program to keep track of my lottery hobby. My newest task is to include lottery systems, in particular wheeling systems. From the scratch, i first calculated all coverages for a given set of draws by the Brute-force method. For the 3if3, 4if4, 5if5 and 6if6, the task is easy and fast (no brute-force required). However, as it was clear to me from the very beginning, the 3if4, 3if5, ...coverages take a long time using the brute-force approach due to the many-fold comparisons. Therefore i started to think about more efficient methods to calculate the 3if4,3if5,... coverages.
Having a look at the available wheeling softwares in the internet, I very soon found the "Covermaster" program. The enourmous speed of the coverage calculations showed me that there must be a MUCH more elegant way to calculate the coverages. Driven by this fact, i checked the internet again with the hope to find some hints about the calculation mechanism in Covermaster. The search directed me to this lottery news group, where i read some posts of Colin, Michael, and others written in 2009. Reading all the comments in the posts i figured out that the author of Covermaster, Honest John, makes a pretty big secret about the algorithm. Since he surely invested a lot of time to make all the optimizations i can understand this very well. Nevertheless, i saw the first attempts of Colin and Michael to implement a good coverage function. Actually, the initial part with limiting of the amount of neccessary comparisons for the test of a single draw was pretty similar to what i also considered before. But i realized pretty soon that it cannot work by only considering the entire draws with 6 numbers each. The problematic is that a given set of N draws contains a certain amount of subsets. These subsets intersect with each other and all subsets of the complete wheel together often do not represent the full coverage. The not well-defined (or maybe not fore-seeable) intersections make it difficult to determine the amount of combinations of one subset which are already covered by another subset.
In my opinion a fast method for coverage determination, such as perfectly achieved in Covermaster, cannot work if the operations are exclusively made on the sets of the complete 6-element-containing draws. In addition, I don't see the possibility to extract the coverages 3if4, 3if5, etc. only by operations on the lines in a wheel (A comment of Honest John would be nice :)). For fast and accurate processing, we probably have to go the opposite way. I suggest as a first step, to create an Array which holds all possible, unique 3-element subsets of all 6-element draws in the wheel. Or lets say, we better make a two-dimensional Array where the dimension i (the width) is equal to the amount of numbers in the number pool, and where the dimension j (the height) contains lines with information about the 3-element subsets.For example:
| 1 | 2 | 3 | 4 | 5 | <- dimension i, Pool = {1,2,3,4,5}
=====================
[ 2 , 0 , 0 , 2 , 2 ] <- subset [1,4,5] , Number 2 marks the element
[ 0 , 2 , 0 , 2 , 2 ] <- subset [2,4,5]
...
and all other unique 3-element subsets in the wheel
Based on this basic Matrix of 3-element subsets (i call it the 3-Matrix), I think it is a good idea to determine the number of all possible supersets. I already found an algorithm based on line comparison operations, which allows me to transform the 3-matrix into a 4-matrix (same dimensions as 3-Matrix, i.e., the size does not expand. Just the content changes). The resulting 4-Matrix is all what we need to get the 3if4 coverage as it directly gives the number of covered 4-element subsets. It also allows to quickly create a list with all covered 4-element subsets.
Implementing via this approach for a 6-pick 49-Pool wheel with 75 lines, shortend the calculation time for the 3if4 coverage from ca. 2000ms (Brute-Force) to ca. 20ms (Matrix-method). I should mention that the executable runs in the slower Delphi debug mode and the Windows 7 + Delphi platform both run within an Oracle Virtual Box :). If a new line is added to the wheel, the 3-Matrix can be just extended by the addition of the new subsets. The subsequent transformation to the 4-Matrix (or better modification of the existing 4-Matrix) has only to be carried out for the new subsets, i.e., the second and further coverage calculations for a growing wheel are significantly faster than the initial calculation.
I am currently thinking how to modify the 4-Matrix to the 5-Matrix, and the 5-Matrix to the 6-Matrix, in order to get the two coverages 3if5 and 3if6. After some first brainstorm yesterday, i am quite confident that this is also possible. It however, requires deeper thinking about the developing intersections.
I guess Covermaster takes a quite similar way. Especially because it works so fluently even with constantly increasing wheel size. This behavior and the very good speed indicate me that the current state of the wheel is probably saved in a kind of object which only needs to be updated if a new line is added to the wheel (similar to the way how my matrices would work).
Anyway, i would be very happy if the coverage experts here could give me some reply or comment :). And Colin, if this sounds wrong to you, please don't give me an award. I am definitely no dubious numerologist :P.
Many greets
Michael Yang