Investigate!
-
A restaurant offers 8 appetizers and 14 entrées. How many choices do you have if:
-
you will eat one dish, either an appetizer or an entrée?
-
you are extra hungry and want to eat both an appetizer and an entrée?
-
Think about the methods you used to solve question 1. Write down the rules for these methods.
-
Do your rules work? A standard deck of playing cards has 26 red cards and 12 face cards.
-
How many ways can you select a card which is either red or a face card?
-
How many ways can you select a card which is both red and a face card?
-
How many ways can you select two cards so that the first one is red and the second one is a face card?
Consider this rather simple counting problem: at Red Dogs and Donuts, there are 14 varieties of donuts, and 16 types of hot dogs. If you want either a donut or a dog, how many options do you have? This isn’t too hard, just add 14 and 16. Will that always work? What is important here?
Additive Principle.
The
additive principle states that if event
can occur in
ways, and event
can occur in
disjoint ways, then the event “
or
” can occur in
ways.
It is important that the events be
disjoint: i.e., that there is no way for
and
to both happen at the same time. For example, a standard deck of 52 cards contains
red cards and
face cards. However, the number of ways to select a card which is either red or a face card is not
This is because there are 6 cards which are both red and face cards.
Example 1.1.1.
How many two letter “words” start with either A or B? (A
word is just a string of letters; it doesn’t have to be English, or even pronounceable.)
Solution.
First, how many two letter words start with A? We just need to select the second letter, which can be accomplished in 26 ways. So there are 26 words starting with A. There are also 26 words that start with B. To select a word which starts with either A or B, we can pick the word from the first 26 or the second 26, for a total of 52 words.
The additive principle also works with more than two events. Say, in addition to your 14 choices for donuts and 16 for dogs, you would also consider eating one of 15 waffles? How many choices do you have now? You would have
options.
Example 1.1.2.
How many two letter words start with one of the 5 vowels?
Solution.
There are 26 two letter words starting with A, another 26 starting with E, and so on. We will have 5 groups of 26. So we add 26 to itself 5 times. Of course it would be easier to just multiply
We are really using the additive principle again, just using multiplication as a shortcut.
Example 1.1.3.
Suppose you are going for some fro-yo. You can pick one of 6 yogurt choices, and one of 4 toppings. How many choices do you have?
Solution.
Break your choices up into disjoint events:
are the choices with the first topping,
the choices featuring the second topping, and so on. There are four events; each can occur in 6 ways (one for each yogurt flavor). The events are disjoint, so the total number of choices is
Note that in both of the previous examples, when using the additive principle on a bunch of events all the same size, it is quicker to multiply. This really is the same, and not just because
We can first select the topping in 4 ways (that is, we first select which of the disjoint events we will take). For each of those first 4 choices, we now have 6 choices of yogurt. We have:
Multiplicative Principle.
The
multiplicative principle states that if event
can occur in
ways, and each possibility for
allows for exactly
ways for event
then the event “
and
” can occur in
ways.
The multiplicative principle generalizes to more than two events as well.
Example 1.1.4.
How many license plates can you make out of three letters followed by three numerical digits?
Solution.
Here we have six events: the first letter, the second letter, the third letter, the first digit, the second digit, and the third digit. The first three events can each happen in 26 ways; the last three can each happen in 10 ways. So the total number of license plates will be
using the multiplicative principle.
Does this make sense? Think about how we would pick a license plate. How many choices we would have? First, we need to pick the first letter. There are 26 choices. Now for each of those, there are 26 choices for the second letter: 26 second letters with first letter A, 26 second letters with first letter B, and so on. We add 26 to itself 26 times. Or quicker: there are
choices for the first two letters.
Now for each choice of the first two letters, we have 26 choices for the third letter. That is, 26 third letters for the first two letters AA, 26 choices for the third letter after starting AB, and so on. There are
of these
third letter choices, for a total of
choices for the first three letters. And for each of these
choices of letters, we have a bunch of choices for the remaining digits.
In fact, there are going to be exactly 1000 choices for the numbers. We can see this because there are 1000 three-digit numbers (000 through 999). This is 10 choices for the first digit, 10 for the second, and 10 for the third. The multiplicative principle says we multiply:
All together, there were
choices for the three letters, and
choices for the numbers, so we have a total of
choices of license plates.
Careful: “and” doesn’t mean “times.” For example, how many playing cards are both red and a face card? Not
The answer is 6, and we needed to know something about cards to answer that question.
Another caution: how many ways can you select two cards, so that the first one is a red card and the second one is a face card? This looks more like the multiplicative principle (you are counting two separate events) but the answer is not
here either. The problem is that while there are 26 ways for the first card to be selected, it is not the case that
for each of those there are 12 ways to select the second card. If the first card was both red and a face card, then there would be only 11 choices for the second card.
Example 1.1.5. Counting functions.
How many functions
are there?
Solution.
Remember that a function sends each element of the domain to exactly one element of the codomain. To determine a function, we just need to specify the image of each element in the domain. Where can we send 1? There are 4 choices. Where can we send 2? Again, 4 choices. What we have here is 5 “events” (picking the image of an element in the domain) each of which can happen in 4 ways (the choices for that image). Thus there are
functions.
This is more than just an example of how we can use the multiplicative principle in a particular counting question. What we have here is a general interpretation of certain applications of the multiplicative principle using rigorously defined mathematical objects: functions. Whenever we have a counting question that asks for the number of outcomes of a repeated event, we can interpret that as asking for the number of functions from
(where
is the number of times the event is repeated) to
(where
is the number of ways that event can occur).
Subsection 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
and event
we want to think of a set
and a set
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 1.1.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?
Solution.
By now you should agree that the answer to the first question is
and the answer to the second question is
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
and
The set
contains all 9 shirts so
while
since there are 5 elements in the set
(namely your 5 pairs of pants). What are we asking in terms of these sets? Well in question 2, we really want
the number of elements in the union of shirts and pants. This is just
(since there is no overlap;
). Question 1 is slightly more complicated. Your first guess might be to find
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
there are, where
is a shirt and
is a pair of pants. As we will soon verify, this number is
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 and if (that is, if there is no element in common to both and ), then
This hardly needs a proof. To find
you take everything in
and throw in everything in
Since there is no element in both sets already, you will have
things and add
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 and we can form the set
to be the set of all ordered pairs where is an element of and is an element of We call the Cartesian product of and
Example 1.1.7.
Solution.
We want to find ordered pairs where can be either or and can be either 3, 4, or 5. is the set of all of these pairs:
The question is, what is To figure this out, write out Let and (so and ). The set contains all pairs with the first half of the pair being some and the second being one of the In other words:
Notice what we have done here: we made
rows of
pairs, for a total of
pairs.
Each row above is really for some That is, we fixed the -element. Broken up this way, we have
So
is really the union of
disjoint sets. Each of those sets has
elements in them. The total (using the additive principle) is
Multiplicative Principle (with sets).
Given two sets
and
we have
Again, we can easily extend this to any number of sets.
Subsection Principle of Inclusion/Exclusion
Investigate!
A recent buzz marketing campaign for
Village Inn surveyed patrons on their pie preferences. People were asked whether they enjoyed (A) Apple, (B) Blueberry or (C) Cherry pie (respondents answered yes or no to each type of pie, and could say yes to more than one type). The following table shows the results of the survey.
Pies enjoyed: |
A |
B |
C |
AB |
AC |
BC |
ABC |
Number of people: |
20 |
13 |
26 |
9 |
15 |
7 |
5 |
How many of those asked enjoy at least one of the kinds of pie? Also, explain why the answer is not 95.
While we are thinking about sets, consider what happens to the additive principle when the sets are NOT disjoint. Suppose we want to find
and know that
and
This is not enough information though. We do not know how many of the 8 elements in
are also elements of
However, if we also know that
then we can say exactly how many elements are in
and, of those, how many are in
and how many are not (6 of the 10 elements are in
so 4 are in
but not in
). We could fill in a Venn diagram as follows:
This says there are 6 elements in
4 elements in
and 2 elements in
Now
these three sets
are disjoint, so we can use the additive principle to find the number of elements in
It is
This will always work, but drawing a Venn diagram is more than we need to do. In fact, it would be nice to relate this problem to the case where
and
are disjoint. Is there one rule we can make that works in either case?
Here is another way to get the answer to the problem above. Start by just adding This is which would be the answer if We see that we are off by exactly 6, which just so happens to be So perhaps we guess,
This works for this one example. Will it always work? Think about what we are doing here. We want to know how many things are either in
or
(or both). We can throw in everything in
and everything in
This would give
many elements. But of course when you actually take the union, you do not repeat elements that are in both. So far we have counted every element in
exactly twice: once when we put in the elements from
and once when we included the elements from
We correct by subtracting out the number of elements we have counted twice. So we added them in twice, subtracted once, leaving them counted only one time.
Cardinality of a union (2 sets).
We can do something similar with three sets.
Example 1.1.8.
An examination in three subjects, Algebra, Biology, and Chemistry, was taken by 41 students. The following table shows how many students failed in each single subject and in their various combinations:
Subject: |
A |
B |
C |
AB |
AC |
BC |
ABC |
Failed: |
12 |
5 |
8 |
2 |
6 |
3 |
1 |
How many students failed at least one subject?
Solution.
The answer is not 37, even though the sum of the numbers above is 37. For example, while 12 students failed Algebra, 2 of those students also failed Biology, 6 also failed Chemistry, and 1 of those failed all three subjects. In fact, that 1 student who failed all three subjects is counted a total of 7 times in the total 37. To clarify things, let us think of the students who failed Algebra as the elements of the set
and similarly for sets
and
The one student who failed all three subjects is the lone element of the set
Thus, in Venn diagrams:
Now let’s fill in the other intersections. We know
contains 2 elements, but 1 element has already been counted. So we should put a 1 in the region where
and
intersect (but
does not). Similarly, we calculate the cardinality of
and
Next, we determine the numbers which should go in the remaining regions, including outside of all three circles. This last number is the number of students who did not fail any subject:
We found 5 goes in the “
only” region because the entire circle for
needed to have a total of 12, and 7 were already accounted for. Similarly, we calculate the “
only” region to contain only 1 student and the “
only” region to contain no students.
Thus the number of students who failed at least one class is 15 (the sum of the numbers in each of the eight disjoint regions). The number of students who passed all three classes is 26: the total number of students, 41, less the 15 who failed at least one class.
Note that we can also answer other questions. For example, how many students failed just Chemistry? None. How many passed Algebra but failed both Biology and Chemistry? This corresponds to the region inside both
and
but outside of
containing 2 students.
Could we have solved the problem above in an algebraic way? While the additive principle generalizes to any number of sets, when we add a third set here, we must be careful. With two sets, we needed to know the cardinalities of
and
in order to find the cardinality of
With three sets we need more information. There are more ways the sets can combine. Not surprisingly then, the formula for cardinality of the union of three non-disjoint sets is more complicated:
Cardinality of a union (3 sets).
To determine how many elements are in at least one of
or
we add up all the elements in each of those sets. However, when we do that, any element in both
and
is counted twice. Also, each element in both
and
is counted twice, as are elements in
and
so we take each of those out of our sum once. But now what about the elements which are in
(in all three sets)? We added them in three times, but also removed them three times. They have not yet been counted. Thus we add those elements back in at the end.
Returning to our example above, we have We also have and Therefore:
This is what we got when we solved the problem using Venn diagrams.
This process of adding in, then taking out, then adding back in, and so on is called the
Principle of Inclusion/Exclusion, or simply PIE. We will return to this counting technique later to solve for more complicated problems (involving more than 3 sets).