Given:
- Set of size
n
- Select elements (unordered, no duplicates) from that set
- Select
k
elements, for whichmin <= k < max
Question: How many k-combinations are there?
If k
were a fixed number, wikipedia has the answer: n! / (k! (n-k)!)
Unfortunately, it's not.
For example:
- Given the set
[A, B, C, D, E]
, select at least2
and at most3
elements. - So
n=5
,min=2
,max=4
,2 <= k < 4
. - Number of combinations:
6!/2!4! + 6!/3!3! = 720/48 + 720/36 = 35
So 35
combinations. What's the general formula given n
, min
, max
?
k < max
rather thank <= max
? – Henry May 06 '14 at 22:396!/2!4! + 6!/3!3! = 7!/3!4!
– Henry May 06 '14 at 22:40k <= max
is fine too. As for the sum, at least then!/(min! (n-max)!)
can be extracted? – Geoffrey De Smet May 07 '14 at 06:14