PDA

View Full Version : Math question -- Combinations



YourLandlord
03-04-2010, 11:29 PM
Okay, so the formula for combinations is simple and common.

I have a set of elements that can be put in combinations, but some of the elements are not allowed to combine.

For example, A, B, C, and D.

Normally, 4 choose 2 (for example) results in a certain number of combinations.

What if I want to do 4 choose 2 but A and D are not allowed to be a combination?

Is there any formula that can produce number of combinations but account for unallowable combinations?

hc5duke
03-05-2010, 12:14 AM
Okay, so the formula for combinations is simple and common.

I have a set of elements that can be put in combinations, but some of the elements are not allowed to combine.

For example, A, B, C, and D.

Normally, 4 choose 2 (for example) results in a certain number of combinations.

What if I want to do 4 choose 2 but A and D are not allowed to be a combination?

Is there any formula that can produce number of combinations but account for unallowable combinations?

I'm not a mathematician but can't you do this?

(all possibilities) - sum_of(not allowable combinations)

So in your example
= (4 choose 2) - (2 choose 2) = 5
you're going from [AB, AC, AD, BC, BD, CD] to [AB, AC, BC, BD, CD]

If you also disallowed A+C, you would have
(ABCD) - (AD) - (AC)
= (4 choose 2) - (2 choose 2) - (2 choose 2) = 6 - 1 - 1 = 4, which makes sense since you're going from [AB, AC, AD, BC, BD, CD] to [AB, BC, BD, CD]

Deslok
03-05-2010, 12:37 AM
As noted, basically the formula for it would be:
# of possible combinations using old fashion rule - # of bad combinations using other rule.

So, for example, if you had 10 elements, where A and B can't both be selected in a grouping of 4, you'd do

10 C 4(number of ways to select groups of 4 from 10 elements) - 8 C 2(number of different ways you can pick 2 other elements if you automatically select A and B) so your answer would be 210 - 28 = 182

hughgs
03-05-2010, 07:22 AM
Okay, so the formula for combinations is simple and common.

I have a set of elements that can be put in combinations, but some of the elements are not allowed to combine.

For example, A, B, C, and D.

Normally, 4 choose 2 (for example) results in a certain number of combinations.

What if I want to do 4 choose 2 but A and D are not allowed to be a combination?

Is there any formula that can produce number of combinations but account for unallowable combinations?

As other posters have noted there is no generic, simply formula for what you are looking for. In essence you'll have to count the number of disallowed combinations. So, the real question for you is how many elements do you have and how many of those elements do you choose? If your sample space is relatively small (<= 27 for me) then you can list and count. If it's big then you can have issues.

I have access to a program (Matlab) which could count the number of combinations if you PM me.

YourLandlord
03-05-2010, 07:33 AM
Okay, these are good insights -- thanks for the help. I'll be taking another look at this work this afternoon and will provide a little more detail. Cheers.