Login
📚 Discrete Mathematics
Chapters ▾
⇩ Download ▾

2.1 Additive and Multiplicative Principles

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?

It is important that the events be disjoint: i.e., that there is no way for A and B to both happen at the same time. For example, a standard deck of 52 cards contains 26 red cards and 12 face cards. However, the number of ways to select a card which is either red or a face card is not 26 + 12 = 38 . This is because there are 6 cards which are both red and face cards.

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 14 + 16 + 15 = 45 options.

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 6 + 6 + 6 + 6 = 4 6 . 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:

The multiplicative principle generalizes to more than two events as well.

Careful: “and” doesn't mean “times.” For example, how many playing cards are both red and a face card? Not 26 12 . 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 26 12 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.1

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 , we want to think of a set A and a set B . 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:

From this example we can see right away how to rephrase our additive principle in terms of sets:

This hardly needs a proof. To find A B , you take everything in A and throw in everything in B . Since there is no element in both sets already, you will have | A | things and add | 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:

The question is, what is | A × B | ? To figure this out, write out A × B . Let A = { a 1 , a 2 , a 3 , , a m } and B = { b 1 , b 2 , b 3 , , b n } (so | A | = m and | B | = n ). The set A × B contains all pairs with the first half of the pair being some a i A and the second being one of the b j B . In other words:

A × B = { ( a 1 , b 1 ) , ( a 1 , b 2 ) , ( a 1 , b 3 ) , ( a 1 , b n ) , ( a 2 , b 1 ) , ( a 2 , b 2 ) , ( a 2 , b 3 ) , , ( a 2 , b n ) , ( a 3 , b 1 ) , ( a 3 , b 2 ) , ( a 3 , b 3 ) , , ( a 3 , b n ) , ( a m , b 1 ) , ( a m , b 2 ) , ( a m , b 3 ) , , ( a m , b n ) }

.

Notice what we have done here: we made m rows of n pairs, for a total of m n pairs.

Each row above is really { a i } × B for some a i A . That is, we fixed the A -element. Broken up this way, we have

A × B = ( { a 1 } × B ) ( { a 2 } × B ) ( { a 3 } × B ) ( { a m } × B )

.

So A × 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 + + n = m n .

To summarize:

Again, we can easily extend this to any number of sets.

Principle of Inclusion/Exclusion

While we are thinking about sets, consider what happens to the additive principle when the sets are NOT disjoint. Suppose we want to find | A B | and know that | A | = 10 and | B | = 8 . This is not enough information though. We do not know how many of the 8 elements in B are also elements of A . However, if we also know that | A B | = 6 , then we can say exactly how many elements are in A , and, of those, how many are in B and how many are not (6 of the 10 elements are in B , so 4 are in A but not in B ). We could fill in a Venn diagram as follows:

Intersecting circles labeled A and B. Inside the region enclosed by both circles is the number 6. The number 4 is in the region inside A but outside B. The number 2 is in the region inside B but outside A.

This says there are 6 elements in A B , 4 elements in A B and 2 elements in B A . Now these three sets are disjoint, so we can use the additive principle to find the number of elements in A B . It is 6 + 4 + 2 = 12 .

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 A and B 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 | A | + | B | . This is 10 + 8 = 18 , which would be the answer if | A B | = 0 . We see that we are off by exactly 6, which just so happens to be | A B | . So perhaps we guess,

| A B | = | A | + | B | | A B |

.

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 A or B (or both). We can throw in everything in A , and everything in B . This would give | A | + | B | 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 A B exactly twice: once when we put in the elements from A and once when we included the elements from B . 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.

In other words, we have:

We can do something similar with three sets.

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 A , B , and A B in order to find the cardinality of A B . 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:

To determine how many elements are in at least one of A , B , or C we add up all the elements in each of those sets. However, when we do that, any element in both A and B is counted twice. Also, each element in both A and C is counted twice, as are elements in B and C , so we take each of those out of our sum once. But now what about the elements which are in A B C (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 | A | = 12 , | B | = 5 , | C | = 8 . We also have | A B | = 2 , | A C | = 6 , | B C | = 3 , and | A B C | = 1 . Therefore:

| A B C | = 12 + 5 + 8 2 6 3 + 1 = 15

.

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).

Your Blu-ray collection consists of 9 comedies and 7 horror movies. Give an example of a question for which the answer is:

  1. 16.
  2. 63.
  1. For example, 16 is the number of choices you have if you want to watch one movie, either a comedy or horror flick.
  2. For example, 63 is the number of choices you have if you will watch two movies, first a comedy and then a horror.

Let A , B , and C be sets.

  1. Find | ( A C ) B | provided | A | = 50 , | B | = 45 , | C | = 40 , | A B | = 20 , | A C | = 15 , | B C | = 23 , and | A B C | = 12 .
  2. Describe a set in terms of A , B , and C with cardinality 26.

For part (a) you could use the formula for PIE, but for part (b) you might be better off drawing a Venn diagram.

For how many three digit numbers (100 to 999) is the sum of the digits even? (For example, 343 has an even sum of digits: 3 + 4 + 3 = 10 which is even.) Find the answer and explain why it is correct in at least two different ways.

You could consider cases. For example, any number of the form ODD-ODD-EVEN will have an even sum. Alternatively, how many three digit numbers have the sum of their digits even if the first two digits are 54? What if the first two digits are 19?

The number 735000 factors as 2 3 3 5 4 7 2 . How many divisors does it have? Explain your answer using the multiplicative principle.

For a simpler example, there are 4 divisors of 6 = 2 3 . They are 1 = 2 0 3 0 , 2 = 2 1 3 0 , 3 = 2 0 3 1 and 6 = 2 1 3 1 .

Discrete Mathematics: An Open Introduction, 3rd edition, by Oscar Levin (discrete.openmathbooks.org), licensed under CC BY-SA 4.0; this adaptation is distributed under the same license. License: CC-BY-SA-4.0.