# Calculating combinations within constraints

Building out a web dev portfolio. For a web app I am working with lottery probabilities.

How many combinations are there if I only choose combinations within observed maximum and minimum values? Here are the stats:

The lottery I'm starting with is Mega Millions. 5 numbers drawn and not replaced from 1-75, with a sixth number chosen from 1-15.

C(75,5) * 15 = 258,890,850 combinations


My attempt is:

All combinations within maximums observed.
( 43 * (64-1) * (68-2) * (74-3) * (75-4) ) / 5! * 15 = 112,662,569.25

Less combinations below minimums observed.
( (3-1) * (8-2) * (20-3) * (23-4) ) / 4! = 161.5

Combinations within maximum & minimum limits = 112,662,407


Is there a better approach to calculating the number of combinations within constraints?

Your first calculation of the total number of combinations is close but may not be correct. I would guess that the sixth number cannot match any of the first five. In that case, you need to multiply first draws that have one number $1-15$ by $14$, those that have two by $13$, etc. Easier is to pick the sixth number first, then pick the rest from the remaining $74$, so there are $15 {74 \choose 5}$ possibilities.

Similarly, the calculation you want to do is made difficult by the interactions between the numbers. If the lowest number is $43$ there are many fewer choices for the others. It is going to be a mess

• Sixth number can match the other 5. Sixth number is independently drawn from a set of 1-15. Jan 15 '16 at 0:56
• OK then you are right Jan 15 '16 at 1:03
• What is good etiquette in this situation? You have addressed my question - and reaffirmed my approach. Should I mark it correct? Jan 17 '16 at 21:53
• It is your choice. I didn't cover the second half, which I think is the hard one. Marking this correct may discourage another answer, though after this much time you are unlikely to get one. Jan 17 '16 at 22:08