Finding number of possibilities of n number of r combinations of which x can be unique behavior

156 Views Asked by At

I have say 5 alphabets altogether (a, b, c, d, e) out of which 3 (a,b,c) are from Bag 'A' and 2 (d,e) are from Bag 'B'
I want all possible combination of 3 alphabets of these 5. so I used permutations 5P3 = 60
a b c
a b d
a b e
a c b
a c d and so on

Out of these 60 possible combinations, i want to find out the number of possible combinations of which involves 2 alphabets from Bag 'B' (d,e).
example,
b d e
c e d

Is there a formula to find out this.

Note: as mentioned above if it is for 5 alphabets it is possible to find out manually. But if it involves more number, it is very difficult to find out manually, Have to find out a way to do it based on formula alone.

Can someone throw some light on my query?

1

There are 1 best solutions below

3
On BEST ANSWER

You want a selection of size $n$ that has $x$ from Bag $B$ and the rest from Bag $A$.

First pick your Bag $B$ letters. You need $x$ of them.

$$\binom{\text{# of letters in Bag }B}{x}$$

Then you need to pick the remainder from $A$.

$$\binom{\text{# of letters in Bag }A}{n-x}$$

So it's

$$\binom{\text{# of letters in Bag }B}{x}\binom{\text{# of letters in Bag }A}{n-x}$$

In your specific example, $$\binom{2}{2}\binom{3}{3-2}=3$$

This gives the number if their order isn't relevant. If the order is relevant, you just multiply by $n!$ to get all permutations for each combination. In your case $3\cdot3!=18$.