How to calculate number of combinations?

I want to divide the sets (6 out of 49) into categories.
Three main categories are
a) sets with equal (3) even and odd numbers (can be calulated by COMBIN(25,3) * COMBIN(24,3) )
b) sets with majority of EVEN numbers (I can calculate as well)
c) sets with majority of ODD numbers (I can calculate as well).

Within each main category I want 3 subcategories:
1) sets with equal numbers (3) above the middle (25)
2) sets with majority of numbers below the middle
3) sets with majority of numbers above the middle

How can I CALCULATE the amount of numbers in each of the 3 subcategories?
 

GillesD

Member
Combinations

SoftwareTester

If I read you well, there are 1,532,168 combinations combining 3 even / 3 odd numbers while having 3 numbers <= 25 and 3 numbers >25.

I got this result by two methods:

1 – running through all possible combinations in VBA in Excel and counting those that met the criteria mentioned

2 – theorical calculations with the COMBIN function in Excel as explained below:

The possibilities are:

For numbers <=25, you can have either 3 even / 0 odd, 2 even / 1 odd, 1 even /2 odd or 0 even / 3 odd while for number >25, you can have either 0 even / 3 odd, 1 even / 2 odd, 2 even / 1 odd or 3 even / 0 odd

You then combine those combinations to have 6 numbers meeting your criteria (4 possibilities) and use the COMBIN function to get the formulas:

A =COMBIN(12,3)*COMBIN(13,0)*COMBIN(12,0)*COMBIN(12,3) = 48,400
B =COMBIN(12,2)*COMBIN(13,1)*COMBIN(12,1)*COMBIN(12,2) = 679,536
C =COMBIN(12,1)*COMBIN(13,2)*COMBIN(12,2)*COMBIN(12,1) = 741,312
D =COMBIN(12,0)*COMBIN(13,3)*COMBIN(12,0)*COMBIN(12,3) = 62,920

For a total of 1,532,168 combinations

For once I am not too sure of my calculations but having obtained the same value by 2 methods, it improves my chances of being right
 

r2lboroy

Member
Please send me your calculation of 6/49 lotto in Philippines every thursday and sunday of the month 2008. Thanks in advance and more power to you. I'll be waiting your prompt reply soon as possible.
 
Thanks for explaning those calculations
A =COMBIN(12,3)*COMBIN(13,0)*COMBIN(12,0)*COMBIN(12, 3) = 48,400
B =COMBIN(12,2)*COMBIN(13,1)*COMBIN(12,1)*COMBIN(12, 2) = 679,536
C =COMBIN(12,1)*COMBIN(13,2)*COMBIN(12,2)*COMBIN(12, 1) = 741,312
D =COMBIN(12,0)*COMBIN(13,3)*COMBIN(12,3)*COMBIN(12, 0) = 62,920

but i don't really get it as I can't extrapolate for the other parts

I understand the following :
a) calculate the ODDpart
b) calculate the LOWpart
c) multiply them

or:

Sum = 0
for i = 0 to 3
OddPart = COMBIN(12,3-i) * COMBIN(13, i)
LowPart = COMBIN(12,3-i) * COMBIN(12, i)
Sum = Sum + OddPart * LowPart
next i

It provides the correct answer for the 'BalancedMiddle' group as I call it (balanced = 3 Odd / 3 Even ; Middle = 3 Low / 3 High)

First thing i don't understand is why LowPart will not be built up by COMBIN(12,x) * COMBIN(13,x) as there will be a different number of balls in 'Low' and in 'high'; just like in 'Odd' and 'Even'

Second thing I don't understand is how to extrapolate to other groups.
If I try to calculate other groups (LowMiddle, BalancedHigh) I just get nowhere : i can't find the correct formulas.

I guess finding the OddPart for 'Odd' group (so : OddLow, OddMiddle, OddHigh) will be
COMBIN(12,6) * COMBIN(13,0)
COMBIN(12,5) * COMBIN(13,1)
COMBIN(12,4) * COMBIN(13,2)

But don't know how to calculate LowPart or MiddlePart or HighPart.

I do have the values (counted them) but I want to understand too (and also be able to calculate for different of balls and balls to be drawn).

The values:
OddLow = 1785498
OddMiddle = 1651936
OddHigh = 1506186
OddMajority = 4943620 (= OddLow + OddMiddle + OddHigh)

BalancedLow = 1651936
BalancedMiddle = 1532168 // Complies with formula
BalancedHigh = 1471096
Balanced = 4655200 (= BalancedLow + BalancedMiddle + BalancedHigh)

EvenLow = 1506186
EvenMiddle = 1471096
EvenHigh = 1407714
EvenMajority = 4384996 = (EvenLow + EvenMiddle + EvenHigh)
 

time*treat

Member
counting the subcats

SoftwareTester said:
I want to divide the sets (6 out of 49) into categories.
Three main categories are
a) sets with equal (3) even and odd numbers (can be calulated by COMBIN(25,3) * COMBIN(24,3) )
b) sets with majority of EVEN numbers (I can calculate as well)
c) sets with majority of ODD numbers (I can calculate as well).

Within each main category I want 3 subcategories:
1) sets with equal numbers (3) above the middle (25)
2) sets with majority of numbers below the middle
3) sets with majority of numbers above the middle

How can I CALCULATE the amount of numbers in each of the 3 subcategories?

For the top part, follow GillesD's advice. For the bottom part (3 subcats), a simpler solution is to just have the code look at each combination and "add one" to the 'type' it matches. Save or print the results. Since they are constant, you'll only need to do it once.
 

johnph77

Member
One of the things to take into consideration is that GillesD's calculations include the middle number 25 but your subcriteria seems (to me, anyway) to fail to bring that number into play.
 
johnph77 said:
One of the things to take into consideration is that GillesD's calculations include the middle number 25 but your subcriteria seems (to me, anyway) to fail to bring that number into play.

Maybe I didn't describe my (sub)criteria well (sorry if i didn't), but actually ALL combinations do fit into a category.
I just counted how many fall into each category (time*treat : I divided them already and posted the counts I obtained) and while generating the list of sets I put them into the right positions. As such that's not the problem. The problem is I don't UNDERSTAND how many fall into each category and as I intend to divide them further I SHOULD know how to CALCULATE the size of each part. Apart from that, if ever I wanted to look at other Lotto systems (6-39 or so) I have to do it again instead of just changing the number 49 into 39 and I like my software to be " as general as possible and reasonable" (something I learned from experience).
 

johnph77

Member
Possibly a function to define the middle number? Maybe, assuming the letter "Z" as the highest number drawn, and "M" as the middle number, "M=INT((Z+1)/2)? Possibly the results of that formula may have to be readjusted if the lottery being calculated has an even number for the highest number drawn.

And I do understand about the "as general as reasonable and possible" part and the need to include all possibilities in the total number of calculations - that's why I raised the issue in the first place.

Good luck.
 

mremixer

Member
Full Combinations? How?

I came across this thread through curiosity and now my curiosity is peaked!

I fully understand the COMBIN function, I have also grasped GillesD's (God bless him!) way of working out the sub criteria requested.

I even adapted it to my approach (24 Low & 25 High).

I have tried to take it further but as I am still very much a noob (well I thought I had a competent grasp till I saw some of the stuff you guys were doing, now I consider myself back to noob status! lol!) I am getting lost & confused.

I would like to take it through all the possible "Ratio's" i.e. 6/0, 5/1, 4/2, 3/3, 2/4, 1/5, 0/6 Odd/Even with all the possible "Sub Criteria" of 6/0, 5/1, 4/2, 3/3, 2/4, 1/5, 0/6 High/Low.

Obviously we have the full 3/3 Odd/Even with all High/Low possibilities thanks to GillesD (and Software Tester for asking!) and I have expanded a little further by breaking the 6/0 & 0/6 (Odd/Even) into all possible High/Low "Ratio" combinations BUT thats where I get lost!

Anyone shed some light?
 

GillesD

Member
Calculations for Low / High ratios

I am not too sure where you got lost but may be this will help.

In my case, I consider LOW the numbers 1 to 25 and HIGH the numbers 26 to 49. The following table gives the Excel formula and the number of combinations for all possible ratios (xL / yH).

Split 0L / 6H : =COMBIN(25,6)*COMBIN(24,0) or 177,100 combinations
Split 1L / 5H : =COMBIN(25,5)*COMBIN(24,1) or 1,275,120 combinations
Split 2L / 4H : =COMBIN(25,4)*COMBIN(24,2) or 3,491,400 combinations
Split 3L / 3H : =COMBIN(25,3)*COMBIN(24,3) or 4,655,200 combinations
Split 4L / 2H : =COMBIN(25,2)*COMBIN(24,4) or 3,187,800 combinations
Split 5L / 1H : =COMBIN(25,1)*COMBIN(24,5) or 1,062,600 combinations
Split 6L / 0H : =COMBIN(25,0)*COMBIN(24,6) or 134,596 combinations

If you want LOW numbers to be 1 to 24, then switch the numbers 24 and 25 in the formulas.
 

johnph77

Member
One thing to consider is that there are 25 odd numbers and 24 even numbers in a 49-number matrix - the formulas and figures for high-low depicted above would apply for odd-even as well. Hope this saves some of your time.
 

mremixer

Member
I obviously didn't explain well enough.

I get the High/Low & Odd/Even Ratios separately, thats not where I am lost. I would like to now split into sub criteria for each of the high/low ratios using odd/even.

For example: (This is as far as I got before getting lost!)

6 Low No's 0 High No's split further as:

6 Low No's 0 High All Even = 924 Possibilities
5 Low No's 1 High All Even = 9504 Possibilities
4 Low No's 2 High All Even = 32670 Possibilities
3 Low No's 3 High All Even = 48400 Possibilities
2 Low No's 4 High All Even = 32670 Possibilities
1 Low No 5 High All Even = 9504 Possibilities
0 Low No's 6 High All Even = 924 Possibilities

Total Possibilities 134596 (Equates to the 6/0 possibilities for High/Low)

Now I'm lost! I would like to break down the 6/0 High/Low into its subs for odd/even 5/1, 4/2, 3/3, 2/4, 1/5 As well as all the other possible sub sets for each High/Low.

Does that make more sense?
 

GillesD

Member
Multiple criteria

There are often 2 ways to get things done: the easy way and the hard way.

To get the various breakdowns between Low/High and Even/Odd, I choose the easy way (for me at least): going through all combinations and counting each possibility and the table below gives the results for all 49 possibilities of xL / yH and xE / yO. As usual for me, I consider 1-25 as low numbers and 26-49 as high numbers.

0 L / 6 H - 0 E / 6 O: 924 combinations
0 L / 6 H - 1 E / 5 O: 9,504 combinations
0 L / 6 H - 2 E / 4 O: 32,670 combinations
0 L / 6 H - 3 E / 3 O: 48,400 combinations
0 L / 6 H - 4 E / 2 O: 32,670 combinations
0 L / 6 H - 5 E / 1 O: 9,504 combinations
0 L / 6 H - 6 E / 0 O: 924 combinations
1 L / 5 H - 0 E / 6 O: 10,296 combinations
1 L / 5 H - 1 E / 5 O: 86,724 combinations
1 L / 5 H - 2 E / 4 O: 260,040 combinations
1 L / 5 H - 3 E / 3 O: 363,000 combinations
1 L / 5 H - 4 E / 2 O: 251,460 combinations
1 L / 5 H - 5 E / 1 O: 81,576 combinations
1 L / 5 H - 6 E / 0 O: 9,504 combinations
2 L / 4 H - 0 E / 6 O: 38,610 combinations
2 L / 4 H - 1 E / 5 O: 283,140 combinations
2 L / 4 H - 2 E / 4 O: 784,278 combinations
2 L / 4 H - 3 E / 3 O: 1,059,696 combinations
2 L / 4 H - 4 E / 2 O: 737,946 combinations
2 L / 4 H - 5 E / 1 O: 251,460 combinations
2 L / 4 H - 6 E / 0 O: 32,670 combinations
3 L / 3 H - 0 E / 6 O: 62,920 combinations
3 L / 3 H - 1 E / 5 O: 432,432 combinations
3 L / 3 H - 2 E / 4 O: 1,156,584 combinations
3 L / 3 H - 3 E / 3 O: 1,532,168 combinations
3 L / 3 H - 4 E / 2 O: 1,059,696 combinations
3 L / 3 H - 5 E / 1 O: 363,000 combinations
3 L / 3 H - 6 E / 0 O: 48,400 combinations
4 L / 2 H - 0 E / 6 O: 47,190 combinations
4 L / 2 H - 1 E / 5 O: 329,472 combinations
4 L / 2 H - 2 E / 4 O: 881,166 combinations
4 L / 2 H - 3 E / 3 O: 1,156,584 combinations
4 L / 2 H - 4 E / 2 O: 784,278 combinations
4 L / 2 H - 5 E / 1 O: 260,040 combinations
4 L / 2 H - 6 E / 0 O: 32,670 combinations
5 L / 1 H - 0 E / 6 O: 15,444 combinations
5 L / 1 H - 1 E / 5 O: 118,404 combinations
5 L / 1 H - 2 E / 4 O: 329,472 combinations
5 L / 1 H - 3 E / 3 O: 432,432 combinations
5 L / 1 H - 4 E / 2 O: 283,140 combinations
5 L / 1 H - 5 E / 1 O: 86,724 combinations
5 L / 1 H - 6 E / 0 O: 9,504 combinations
6 L / 0 H - 0 E / 6 O: 1,716 combinations
6 L / 0 H - 1 E / 5 O: 15,444 combinations
6 L / 0 H - 2 E / 4 O: 47,190 combinations
6 L / 0 H - 3 E / 3 O: 62,920 combinations
6 L / 0 H - 4 E / 2 O: 38,610 combinations
6 L / 0 H - 5 E / 1 O: 10,296 combinations
6 L / 0 H - 6 E / 0 O: 924 combinations

No, I did not do this manually and if some are interested, I will post the VBA code that did it.

Now comes the hard way: I will try to formulate a way to calculate each possibility but it may take some time, especially since the Canadiens are on the way to ...
 

Sidebar

Top