Calculating Covered Combinations in an Abbreviated Wheel

PAB

Member
Hi Everyone,

If we were to Use a 6 Numbers Drawn from 24 Numbers Lotto for Example, the FULL Wheel would Consist of 134,596 Combinations ( Using COMBIN(24,6) in Excel ).
Now Obviously there is NO Way that is Affordable. We can However, Use Considerably LESS Combinations ( Abbreviated Wheel ) while Still having a Minimum Matched Guarantee.
For Example, if I was to Use the Following Abbreviated Wheel ( 15 Combinations ), it Guarantees that if I have 4 of the 6 Numbers Drawn Within my 24 Selected Numbers, I will have a Minimum Match of 2 Numbers in at Least 1 Combination.

01 03 07 12 15 16
01 04 05 17 20 21
01 08 09 10 19 22
01 13 14 18 23 24
02 03 06 09 21 23
02 10 12 14 16 20
02 11 15 19 20 24
03 04 07 10 18 24
03 05 07 14 17 19
04 06 08 14 15 22
04 09 11 13 16 19
05 10 13 15 17 23
05 11 12 18 21 22
06 08 12 16 17 24
07 08 13 20 22 23

How can I Produce the Total Combinations "Covered" ( Either Using Formulas Or VB ) by the Abbreviated Wheel for Each of the Categories Below, Against that of the FULL Wheel Please. The Abbreviated Wheel is in Cells "G13:L27" ( One Number Per Cell ).
The Total Combinations "Tested" ( 6 Numbers from 24 Numbers in this Case ) will go in Cells "H5:H18" and the Total Combinations "Covered" ( Abbreviated Wheel Combinations ) will go in Cells "I5:I18".
So the Results would Look Something like this:-

Matched Tested Covered
2 if 2 276 209
2 if 3 2,024 2,008
2 if 4 10,626 10,626
2 if 5 42,504 42,504
2 if 6 134,596 134,596
3 if 3 2,024 300
3 if 4 10,626 5,289
3 if 5 42,504 35,720
3 if 6 134,596 131,922
4 if 4 10,626 225
4 if 5 42,504 4,140
4 if 6 134,596 35,304
5 if 5 42,504 90
5 if 6 134,596 1,635

The Formulas for "Tested" are …

Matched Tested Formula
2 if 2 COMBIN(24,2) = 276
2 if 6 COMBIN(24,3) = 2,024
2 if 4 COMBIN(24,4) = 10,626
2 if 5 COMBIN(24,5) = 42,504
2 if 6 COMBIN(24,6) = 134,596
3 if 3 COMBIN(24,3) = 2,024
3 if 4 COMBIN(24,4) = 10,626
3 if 5 COMBIN(24,5) = 42,504
3 if 6 COMBIN(24,6) = 134,596
4 if 4 COMBIN(24,4) = 10,626
4 if 5 COMBIN(24,5) = 42,504
4 if 6 COMBIN(24,6) = 134,596
5 if 5 COMBIN(24,5) = 42,504
5 if 6 COMBIN(24,6) = 134,596

… if that Helps.
Obviously the Number of Abbreviated Wheel Combinations can be Less Or More ( for Other Wheels ) than they are in this Wheel ( 15 Combinations in Cells "G13:L27" ). The Code will Need to Recognise when it is the Last Combination to Check.
I have Played Around with this But Cannot Seem to get Anything to Work.
I Hope I have Explained this Clearly Enough.

Any Help will be Greatly Appreciated.
Many Thanks in Advance.
All the Best.
PAB
:wavey:
 
Last edited:
Well PAB,

the maths are straightforward to this. We have a wheel C(n,k,t,m)=b where

*n=the total balls we want to wheel
*k=the ticket size (e.g. a 6 ball game has k=6)
*t=the prize division we want to guarantee a win
*m=the condition that has to be met, in order to guarantee the t prize division win; m defines the least number of balls from our n set that must be correct.
*b=the total tickets required to play.

Now, if you are interested to find the coverage achieved in a certain category e.g. x if y, then the total combinations that need to be covered are nCk(n,y)=A. Thus, you have to test A combinations, each one containing y numbers against the tickets of your wheel (each ticket contains k numbers).

A combination of those A is covered if there is at least one ticket in your wheel, that contains at least x numbers in common. All you have to do is to go through all A combinations and test each of them if it contains at least x numbers in common with at least one ticket of your wheel. If it does, then it is covered. Now, you have to convert this in code.

regards
lottoarchitect
 

PAB

Member
Thanks for the Reply and Detailed Description lottoarchitect,

I am Still at a Loss on How to Achieve the Required Results.
Am I Right in Saying, that when the "x" if "y" is Calculated for the "Covered" Combinations of the Abbreviated Wheel, it Takes ALL 15 Combinations ( 90 Numbers ) as a Whole for the Calculation as Opposed to the 15 Individual Combinations.
I Assume that the Total "x" if "y" Combinations that are "Covered" is Not Achievable Using Excel Formulas.
Is there Any VB Code that you Know of that can Calculate these Figures Please.

Many Thanks in Advance.
All the Best.
PAB
:wavey:
 
I do not use VB PAB so I can't really provide any code. You produce all combinations (not numbers) for the x if y category and test each such combination (contains y numbers) if it is covered by at least one combination in your wheel (k numbers). You don't test against all numbers in the wheel. A combination of "x if y" is covered if there is at least one ticket in your wheel that has in common t numbers.

e.g. for a simple wheel C(5,4,3,3)=4
1) 1 2 3 4
2) 1 2 3 5
3) 1 2 4 5
4) 1 3 4 5

we want to test the 2 if 3 (to be covered), nCk(5,3)=10 combinations
1 2 3
1 2 4
1 2 5
1 3 4
1 3 5
1 4 5
2 3 4
2 3 5
2 4 5
3 4 5

We go through all 10 combinations to find the coverage. E.g. we test 1 2 3 with our wheel. We can see that 1) & 2) & 3) & 4) tickets cover this combination as they contain at least t=2 numbers in common, thus 1 2 3 is covered. We need only one ticket in the wheel to cover our combination. If you test the above 10 combinations, all of them are covered, thus the C(5,4,3,3)=4 has 2if3=100% coverage. I can't help more on this.

regards
lottoarchitect
 

PAB

Member
lottoarchitect

Thanks again for the Reply and Detailed Explanation.

In the Thread …
http://www.lotto649.ws/showthread.php?s=&threadid=5261&highlight=covermaster
… you Posted the Following ( Snipped ) in Regard to CoverMasters Detailed Report :-


lottoarchitect said:
Because I have coded what it requires to produce that report. The theory behind this report is absolutely correct, thus the report owes to produce correct results as it does.
Out of Interest, what Language did you Use to Code your Version of CoverMasters Detailed Report Please?. You Also Say that you have your Own Tools that you Use, are these Developed by Yourself?.

ExpertLotto

In the same Thread …
http://www.lotto649.ws/showthread.php?s=&threadid=5261&highlight=covermaster
… you Posted the Following ( Snipped ) …


ExpertLotto said:
i don't claim to be a wheel expert but i do develop lottery software and recently i've added the same wheel coverage report as covermaster has.
(i find it very odd that three independent developers would have exactly the same bug in their source code. Besides, the logic to calculate such a report is very simple and straightforward.)
… and …


ExpertLotto said:
expert lotto and lotto architect use different code but with the same results.
everybody can produce the same report with just a couple of lines of vb script code. take any wheel, generate all combinations for the numbers in the wheel and compare each combination with the lines in the wheel. collate all results and you'll see that they're the same as in covermaster
Would it be Possible for you to Supply the Code for the Detailed Report Please. I could then Copy it into a Module in my Excel File for Checking Abbreviated Wheels in my SpreadSheet.
Obviously I would like my Own Wheel Checker Rather than Downloading Other Software.

Thank you Both in Advance for your Help, it is Most Appreciated.
All the Best.
PAB
:wavey:
 
Hi PAB,

yes I use my own code and develop my own tools mostly in Delphi and C++. However I do not provide/post code in public or people not related to my work. I have described the core logic needed to evaluate the coverage issue; all you have to do is to convert it to code. Analyze what I have described and you'll be able to write the necessary VB code.

regards
lottoarchitect
 

ExpertLotto

Member
hello pab,

expert lotto is a java application and although i could give you some source code examples as this report is avaiable in the free version of expert lotto i doubt it would be useful for you. there are dependencies on other application functions and libraries.
i don't use visual basic but if you're interested i could describe the algorithm in plain english (create array, iterate this cycle, if-else etc) for you. then you should be able to write your own vb code.
 

PAB

Member
lottoarchitect

Thanks for ALL your Help, Replies and Detailed Explanations.

ExpertLotto


ExpertLotto said:
I don't use visual basic but if you're interested i could describe the algorithm in plain english (create array, iterate this cycle, if-else etc) for you. then you should be able to write your own vb code.
Yes Please, that would be Brilliant.

Many Thanks in Advance.
All the Best.
PAB
:wavey:
 

ExpertLotto

Member
here it is, i hope it makes sense a bit at least. :dizzy:

Code:
declare partial_results as structure of
    min = array of numbers[ 4 ]; //min[0] is match in six numbers, min[1] is match in five numbers, etc
    max = array of numbers[ 4 ];
    comboCount as number;
end declare

function main
    declare final_results as list;
     
    for each c=1,2,3,4,5,6 to 44,45,46,47,48,49 do
        results = new partial_results;
        for each d=(tickets being tested) do
             match = how_many_numbers_match( c, d );
             increment( results, match );
        end for
        similar = find_similar_results( final_results, results );
        if similar is NULL then
            add results to final_results;
        else
            add( results, similar );
        end if
    end for
    
    //now the final_results list contains all data for the coverage report
    //the following applies to each item in this list:
    //"comboCount tested combinations produce min[0] to max[0] of jackpot hits,
    //and min[1] to max[1] of 'match 5' hits and min[2] to max[2] of 'match 4' hits
    //and min[3] to max[3] of 'match 3' hits
end function

function increment( res as partial_results, match as number )
    index_to_increment = 4 - (match-2); //reverse the match index to have highest match at index '0'
    min[ index_to_increment ] = min[ index_to_increment ] + 1;
    max[ index_to_increment ] = max[ index_to_increment ] + 1;
    comboCount = comboCount+1;
end function

function add( res1 as partial_results, res2 as partial_results ) 
    res2.comboCount = res2.comboCount + res1.comboCount;
    for i=0 to 3 do
        if res1.min[ i ] < res2.min[ i ] then
            res2.min[ i ] = res1.min[ i ];
        end if
        if res1.max[ i ] > res2.max[ i ] then
            res2.max[ i ] = res1.max[ i ];
        end if
    end for 
end function

function find_similar_results( list, results ) 
    for each r=partial_results from the list do
        for i=0 to 3 do 
            if results.max[ i ] > 0 then
                if results.max[i] = r.max[ i ] then
                    return r;
                else
                    break;
                end if
            else if r.max[ i ] > 0 then
                break;
            end if
        end for
    end for
    return NULL;
end function

btw, why bother writing own code in visual basic when you can use covermaster or expert lotto to calculate this for you?
 

PAB

Member
Thanks Ever So Much ExpertLotto,

With the Information given by lottoarchitect, and the Code given by Yourself, I will TRY and Incorporate Both into a Workable VB Program.


ExpertLotto said:
btw, why bother writing own code in visual basic when you can use covermaster or expert lotto to calculate this for you?
I Don't Really want Any Extra Software on my Computer at this Time.
I have Heard a Lot of Good things about your Software and CoverMaster, and will Probably Use Both when I get my New Computer after Christmas.

Thank you BOTH Very Much for ALL the Help you have given, it is Most Appreciated.

All the Best.
PAB
:wavey:
 

ExpertLotto

Member
btw, the algorithm calculates the coverage on assumption that you hit 6 from your wheel. if you want to see coverage report for hit 5 or hit 4 only then the outermost loop must be shortened to
for each c=1,2,3,4,5 to 45,46,47,48,49 do
or
for each c=1,2,3,4 to 46,47,48,49 do
respectively.

anyway, if you have any questions - just ask.
 

PAB

Member
Thanks for the Additional Information ExpertLotto,

What I will TRY and do is to get the Category …
2 if 3 Matched = 2,024 Combinations Tested with 2,008 "Covered"
… to Work First, and then Build up ALL the Other Categories.
I can then get the Results to Output to my SpreadSheet.

Thanks Again.
All the Best.
PAB
:wavey:
 

PAB

Member
Hi,

I Used the Abbreviated Wheel LD[ 24,6,2,4,=15 ] …

01 03 07 12 15 16
01 04 05 17 20 21
01 08 09 10 19 22
01 13 14 18 23 24
02 03 06 09 21 23
02 10 12 14 16 20
02 11 15 19 20 24
03 04 07 10 18 24
03 05 07 14 17 19
04 06 08 14 15 22
04 09 11 13 16 19
05 10 13 15 17 23
05 11 12 18 21 22
06 08 12 16 17 24
07 08 13 20 22 23

.. for the Purposes of Trying to Work Out the Total "Coverage" for EACH Category …

Match
2 if 2
2 if 3
2 if 4
2 if 5
2 if 6
3 if 3
3 if 4
3 if 5
3 if 6
4 if 4
4 if 5
4 if 6
5 if 5
5 if 6
6 if 6

I Used Excel Formulas to Compile the Following Results. I thought if I could Achieve this Using Excel Formulas, I would have a Better Understanding of how to Translate it into Code.
The Ones with "<--- CORRECT" Next to them have Agreed with the Information Kindly Supplied by ExpertLotto ( Thanks Very Much ).

First, I Listed ALL 134,596 Combinations of 6 Numbers from 24 Numbers. Then I Tested EACH of these Combinations Against EACH of the 15 Combinations in the Abbreviated Wheel. I came up with the Following Results :-
Matched 2 if 6 Numbers = 688,500 Combinations
Matched 3 if 6 Numbers = 244,800 Combinations
Matched 4 if 6 Numbers = 34,425 Combinations
Matched 5 if 6 Numbers = 1,620 Combinations <--- CORRECT
Matched 6 if 6 Numbers = 15 Combinations <--- CORRECT

Second, I Listed ALL 42,504 Combinations of 5 Numbers from 24 Numbers. Then I Tested EACH of these Combinations Against EACH of the 15 Combinations in the Abbreviated Wheel. I came up with the Following Results :-
Matched 2 if 5 Numbers = 183,600 Combinations
Matched 3 if 5 Numbers = 45,900 Combinations
Matched 4 if 5 Numbers = 4,050 Combinations <--- CORRECT
Matched 5 if 5 Numbers = 90 Combinations <--- CORRECT

Third, I Listed ALL 10,626 Combinations of 4 Numbers from 24 Numbers. Then I Tested EACH of these Combinations Against EACH of the 15 Combinations in the Abbreviated Wheel. I came up with the Following Results :-
Matched 2 if 4 Numbers = 34,425 Combinations
Matched 3 if 4 Numbers = 5,400 Combinations
Matched 4 if 4 Numbers = 225 Combinations <--- CORRECT

Fourth, I Listed ALL 2,024 Combinations of 3 Numbers from 24 Numbers. Then I Tested EACH of these Combinations Against EACH of the 15 Combinations in the Abbreviated Wheel. I came up with the Following Results :-
Matched 2 if 3 Numbers = 4,050 Combinations
Matched 3 if 3 Numbers = 300 Combinations <--- CORRECT

Fifth, I Listed ALL 276 Combinations of 2 Numbers from 24 Numbers. Then I Tested EACH of these Combinations Against EACH of the 15 Combinations in the Abbreviated Wheel. I came up with the Following Results :-
Matched 2 if 2 Numbers = 225 Combinations <--- Probably CORRECT

Now Obviously Most of these Figures are Incorrect.
I know I am Missing Something Simple here, But I can't Seem to put my Finger on it. I think it is Might be to do with the Fact that Combinations are Already Included in Other Combinations. Any Ideas Please?.

Many Thanks in Advance.
All the Best.
PAB
:wavey:
 

PAB

Member
Hi lottoarchitect & ExpertLotto,

Are the Ambiguous Figures Anything to do with the Unique Representation of Subsets.

Many Thanks in Advance.
All the Best.
PAB
:wavey:
 

ExpertLotto

Member
you counts for the lower ranks are very high indeed. they are even higher than the total sum of all higher ranks so hard to tell what's wrong.
perhaps if you posted your vb code here i could try to find a bug.
 
Definitely the lower ranks counting is wrong. The maximum possible for the x if 6 match is 134,596 as you correctly say, so you cannot have Matched 2 if 6 Numbers = 688,500!! What I can figure out is that you continue checking the same combination even if it is found covered by at least one ticket of your wheel. Remember, we count only once the combination that is covered and not the total amount of the wheel tickets that cover the combination, which is probably the error in your code. In the lower ranks, several tickets will cover every tested combination and this can explain the wrong results you obtained for those categories. Also, you get correct results on the higher ranks even if the counting code is wrong because it happens only one ticket in your wheel to cover a particular tested combination. The solution to this error is as soon as you find a ticket that covers the tested combination, break the wheel tickets test loop and proceed with the next combination to test.

cheers
lottoarchitect
 
Last edited:

PAB

Member
I think I will have to Leave this for a While as I can't get it to Produce the Correct Results in VB.

Thanks Everyone for the Information and Help.
All the Best.
PAB
:wavey:
 

PAB

Member
Hi lottoarchitect & ExpertLotto,

I am Still Trying to Achieve this But Without Much Success.
I Wonder if you could Clarify something for me Please.
How is the 3 if 5 Category for Example Actually Calculated?. What is the Logic and Method of Achieving this Figure?.
I know there are 10 Combinations of 3 Numbers from 5 Numbers [ Combin(5,3) Using an Excel Formula ].

Many Thanks in Advance.
All the Best.
PAB
:wavey:
 

ExpertLotto

Member
perhaps you can try the algorithm i posted here before without collating the partial results.
the coverage table won't look like the one in covermaster but for a smaller wheels should be able to see if it's possible to add some rows together to get the expected results.
this way you can check if there's a bug in your coverage code or in your result collating code...
 

PAB

Member
Thanks for the Reply ExpertLotto,

At the Weekend, I will Continue Trying to Re-Write your Code as VBA Code.
I would Appreciate if you could just Clarify One thing for me Please.
What Description would you Use to Explain to Somebody the 3 if 5 Category. I am Basically Interested in the Theory.
My Thinking is that you Need to Work Out ALL the Unique 5 Number Combinations that are Contained in the Wheel. Then Calculate ALL the 3 Number Combinations and see How Many of them are Contained in Our Unique 5 Number Combinations. ANY of the 3 Number Combinations could be "Covered" More than Once, But we Only Need to Count them as One.
Am I on the Right Lines.

Thanks in Advance.
All the Best.
PAB
:wavey:
 

Sidebar

Top