[Math] Number of Combinations : picking exactly one element from each set .

combinatorics

Given the sets of numbers (1,2,3) , (1,4,6,8) and (1,2,7,8,10).
How many ways are there to choose exactly one element from each set.

NOTE: If we choose 2 from the first set we don't choose any element from third set because 2 also exists in the third set.
Also,the selection (1,1,2) is not allowed(we have selected 1 from first set and its also present in third set. So if we choose 2 from third set , this will mean that we have selected two elements from the third set).

Also , how to solve the generalised question:
Given 'N' sets. Sets may have non-empty intersections. How many ways are there to choose exactly one element from each set.

Best Answer

Suppose we have 3 sets: A, B, and C.

Let $a=|A-B\cup C|, \;\;b=|B-A\cup C|,\;\; c=|C-A\cup B|$ and

let $\;d=|A\cap B-C|, \;\;e=|A\cap C-B|, \;\;f=|B\cap C-A|,\;\;g=|A\cap B\cap C|$.

We can either choose 3 distinct elements, one element repeated twice and then a second element, or one element repeated 3 times; so this gives a total of

$\hspace{.4 in}\color{blue}{abc+(dc+eb+fa)+g}$ selections.


In this example, we get $1\cdot2\cdot2+0\cdot2+1\cdot2+1\cdot1+1=8$ selections.