[Math] Calculating number of combinations of multiple sets, each containing different number of elements

combinations

I'm not a math genius so please consider that when posting your explanation.

I have the following sets, arbitrarily named:

a [a1, a2, a3]

b [b1, b2]

c [c1, c2, c3, c4]

d [d1, d2, d3, d4, d5]

e [e1, e2, e3]

f [f1, f2]

g [g1]

Question #1) What is the total number of combinations if I have to select one element from each set? I think I know this answer, but I want to confirm. I believe this is the rule of products, so the answer is the number of elements in each set multiplied together.

In the case above, it would be:

3 * 2 * 4 * 5 * 3 * 2 * 1 = 720 combinations

Question #2) What is the total number of combinations if I have to select one element from set a, one element from set b, and one element from 4 of the 5 following sets: c, d, e, f, g?

How would this answer change if there was another set 'h' with 6 elements [h1, h2, h3, h4, h5, h6] and I had to still select one element each from set a and b, but now had to select one element each from 4 of the now 6 sets (c, d, e, f, g, h)?

Thank you for the help in advance.

Best Answer

Your answer to the first question is correct.

You can apply the same method to the second question.

Selections from sets a, b, c, d, e, f: $3 \cdot 2 \cdot 4 \cdot 5 \cdot 3 \cdot 2$

Selections from sets a, b, c, d, e, g: $3 \cdot 2 \cdot 4 \cdot 5 \cdot 3 \cdot 1$

Selections from sets a, b, c, d, f, g: $3 \cdot 2 \cdot 4 \cdot 5 \cdot 2 \cdot 1$

Selections from sets a, b, c, e, f, g: $3 \cdot 2 \cdot 4 \cdot 3 \cdot 2 \cdot 1$

Selections from sets a, b, d, e, f, g: $3 \cdot 2 \cdot 5 \cdot 3 \cdot 2 \cdot 1$

To find the number of selections from sets a and b and four of the five sets c, d, e, f, g, we add the above results to obtain \begin{align*} 3 \cdot 2 \cdot & (4 \cdot 5 \cdot 3 \cdot 2 + 4 \cdot 5 \cdot 3 \cdot 1 + 4 \cdot 5 \cdot 2 \cdot 1 + 4 \cdot 3 \cdot 2 \cdot 1 + 5 \cdot3 \cdot 2 \cdot 1)\\ & = 3 \cdot 2 \cdot 4 \cdot 5 \cdot 3 \cdot 2 \cdot 1\left(\frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \frac{1}{5} + \frac{1}{4}\right) \end{align*} The same method could be applied to your third question, but since there are $\binom{6}{4} = 15$ cases, calculating the answer is tedious. The cases are selections from the sets:

a,b,c,d,e,f

a,b,c,d,e,g

a,b,c,d,e,h

a,b,c,d,f,g

a,b,c,d,f,h

a,b,c,d,g,h

a,b,c,e,f,g

a,b,c,e,f,h

a,b,c,e,g,h

a,b,c,f,g,h

a,b,d,e,f,g

a,b,d,e,f,h

a,b,d,e,g,h

a,b,d,f,g,h

a,b,e,f,g,h