Counting With Sets
Do you believe the additive and multiplicative principles? How would you convince someone they are correct? This is surprisingly difficult. They seem so simple, so obvious. But why do they work?
To make things clearer, and more mathematically rigorous, we will use sets. Do not skip this section! It might seem like we are just trying to give a proof of these principles, but we are doing a lot more. If we understand the additive and multiplicative principles rigorously, we will be better at applying them, and knowing when and when not to apply them at all.
We will look at the additive and multiplicative principles in a slightly different way. Instead of thinking about event \(A\) and event \(B\text{,}\) we want to think of a set \(A\) and a set \(B\text{.}\) The sets will contain all the different ways the event can happen. (It will be helpful to be able to switch back and forth between these two models when checking that we have counted correctly.) Here's what we mean:
Example \(\PageIndex{6}\)
Suppose you own 9 shirts and 5 pairs of pants.
- How many outfits can you make?
- If today is half-naked-day, and you will wear only a shirt or only a pair of pants, how many choices do you have?
- Answer
-
By now you should agree that the answer to the first question is \(9 \cdot 5 = 45\) and the answer to the second question is \(9 + 5 = 14\text{.}\) These are the multiplicative and additive principles. There are two events: picking a shirt and picking a pair of pants. The first event can happen in 9 ways and the second event can happen in 5 ways. To get both a shirt and a pair of pants, you multiply. To get just one article of clothing, you add.
Now look at this using sets. There are two sets, call them \(S\) and \(P\text{.}\) The set \(S\) contains all 9 shirts so \(|S| = 9\) while \(|P| = 5\text{,}\) since there are 5 elements in the set \(P\) (namely your 5 pairs of pants). What are we asking in terms of these sets? Well in question 2, we really want \(|S \cup P|\text{,}\) the number of elements in the union of shirts and pants. This is just \(|S| + |P|\) (since there is no overlap; \(|S \cap P| = 0\)). Question 1 is slightly more complicated. Your first guess might be to find \(|S \cap P|\text{,}\) but this is not right (there is nothing in the intersection). We are not asking for how many clothing items are both a shirt and a pair of pants. Instead, we want one of each. We could think of this as asking how many pairs \((x,y)\) there are, where \(x\) is a shirt and \(y\) is a pair of pants. As we will soon verify, this number is \(|S| \cdot |P|\text{.}\)
From this example we can see right away how to rephrase our additive principle in terms of sets:
Additive Principle (with sets)
Given two sets \(A\) and \(B\text{,}\) if \(A \cap B = \emptyset\) (that is, if there is no element in common to both \(A\) and \(B\)), then
\begin{equation*} \card{A \cup B} = \card{A} + \card{B}. \end{equation*}
This hardly needs a proof. To find \(A \cup B\text{,}\) you take everything in \(A\) and throw in everything in \(B\text{.}\) Since there is no element in both sets already, you will have \(\card{A}\) things and add \(\card{B}\) new things to it. This is what adding does! Of course, we can easily extend this to any number of disjoint sets.
From the example above, we see that in order to investigate the multiplicative principle carefully, we need to consider ordered pairs. We should define this carefully:
Cartesian Product
Given sets \(A\) and \(B\text{,}\) we can form the set \(A \times B = \{(x,y) \st x \in A \wedge y \in B\}\) to be the set of all ordered pairs \((x,y)\) where \(x\) is an element of \(A\) and \(y\) is an element of \(B\text{.}\) We call \(A \times B\) the Cartesian product of \(A\) and \(B\text{.}\)
Example \(\PageIndex{7}\)
Let \(A = \{1,2\}\) and \(B=\{3,4,5\}\text{.}\) Find \(A \times B\text{.}\)
- Answer
-
We want to find ordered pairs \((a,b)\) where \(a\) can be either \(1\) or \(2\) and \(b\) can be either 3, 4, or 5. \(A \times B\) is the set of all of these pairs:
\begin{equation*} A \times B = \{(1,3), (1,4), (1,5), (2,3), (2,4), (2,5)\} \end{equation*}
The question is, what is \(\card{A \times B}\text{?}\) To figure this out, write out \(A \times B\text{.}\) Let \(A = \{a_1,a_2, a_3, \ldots, a_m\}\) and \(B = \{b_1,b_2, b_3, \ldots, b_n\}\) (so \(\card{A} = m\) and \(\card{B} = n\)). The set \(A \times B\) contains all pairs with the first half of the pair being some \(a_i \in A\) and the second being one of the \(b_j \in B\text{.}\) In other words:
\begin{align*}
A \times B = \{ & (a_1, b_1), (a_1, b_2), (a_1, b_3), \ldots (a_1, b_n),\\
& (a_2, b_1), (a_2, b_2), (a_2, b_3), \ldots, (a_2, b_n),\\
& (a_3, b_1), (a_3, b_2), (a_3, b_3), \ldots, (a_3, b_n),\\
& \vdots\\
& (a_m, b_1), (a_m, b_2), (a_m, b_3), \ldots, (a_m, b_n)\}.
\end{align*}
Notice what we have done here: we made \(m\) rows of \(n\) pairs, for a total of \(m \cdot n\) pairs.
Each row above is really \(\{a_i\} \times B\) for some \(a_i \in A\text{.}\) That is, we fixed the \(A\)-element. Broken up this way, we have
\begin{equation*} A \times B = (\{a_1\} \times B) \cup (\{a_2\} \times B) \cup (\{a_3\}\times B) \cup \cdots \cup (\{a_m\} \times B). \end{equation*}
So \(A \times B\) is really the union of \(m\) disjoint sets. Each of those sets has \(n\) elements in them. The total (using the additive principle) is \(n + n + n + \cdots + n = m \cdot n\text{.}\)
To summarize:
Multiplicative Principle (with sets)
Given two sets \(A\) and \(B\text{,}\) we have \(\card{A \times B} = \card{A} \cdot \card{B}\text{.}\)
Again, we can easily extend this to any number of sets.