The Inclusion-Exclusion Principle Table of Contents 1 Order of a Set 1 2 The Inclusion-Exclusion Principle 1 3 Examples 2 4 Homework Problems 5 4.1 Instructions...................................... 5 4.2 Problems........................................ 5 5 Document License (CC BY-ND 4.0) 7 5.1 License Links..................................... 7 1 Order of a Set Sometimes, we only know the number of elements in a set. For instance, we might know the number of people who live in a distant city without knowing a single person who lives in the city. Definition: If A is a finite set (meaning A is not infinite), then the order of A, denoted A is the number of elements in A. Example: Determine A if A = {0, 1, 2, 3, 4, 5}. A contains 6 elements, so A = 6. It is important to notice the difference between a set and its order. In the above example, A is a set which contains 6 different elements, while A is the number 6 which is not a set. Writing A = 6 is incorrect. 2 The Inclusion-Exclusion Principle Example: Let A = {a, b, c, d, e} and B = {c, d, e, f, g, h}. It follows that A B = {c, d, e}. Suppose we wish to determine A B without first finding A B. We see the A has 5 elements and B has 6 elements, so we could start with 5 + 6 = 11. However, this means that we have counted each element of A B (c, d, and e) twice. We still need to subtract one from the 1
previous total for each element in A B. Hence A B = 5 + 6 3 = 8. We see that this is correct since A B = {a, b, c, d, e, f, g, h}. The following diagram illustrates the situation. The above example illustrates how what is called the inclusion-exclusion principle works. Inclusion-Exclusion Principle: If A and B are finite sets, then A B = A + B A B. Proof: Let A and B be finite sets. The number of elements that are only in A is A A B. The number of elements that are only in B is B A B. An element in A B is either only in A, only in B, or in both A and B (in A B). This means the following: A B = A A B + B A B + A B = A + B A B 3 Examples 1. Find A B if A = 10, B = 22, and A B = 8. A B = A + B A B = 10 + 22 8 = 24 2. Find A B if A = 16, B = 33, and A B = 35. 2
A B = A + B A B 35 = 16 + 33 A B 35 = 49 A B A B = 14 3. Find A if A B = 92, B = 51, and A B = 30. A B = A + B A B 92 = A + 51 30 92 = A + 21 A = 71 4. Course A has 30 students, course B has 28 students, and 7 students are taking both courses. How many students are taking course A or course B or both courses? The last sentence of the problem is asking us to find the total number of students. The total number of students is the number of students in the set A B. This means we need to determine A B. Since course A has 30 students, then A = 30. Similarly, B = 28. Students taking both courses are students in A B, so A B = 7. Now we may use the inclusion-exclusion principle. A B = A + B A B = 30 + 28 7 = 51 5A. A group contains 45 people who own a cat, a dog, or both. If 36 of the people own a dog and 18 of the people own both a dog and a cat, then how many of the people own a cat? This problem has two categories of pet owners. This suggests that we could let D designate the set of dog owners and C designate the set of cat owners. The problem gives us the following information: D C = 45 D = 36 D C = 18 Since the problem asks us to determine the number of people in the group who own a cat, we need to find C. We may use the inclusion-exclusion principle to find this quantity. 3
D C = D + C D C 45 = 36 + C 18 45 = 18 + C C = 27 5B. How many people in the group do not own a cat? Since the total number of people in the group is 45 and 27 of the people own a cat, then the number of people who don t own a cat is 45 27 = 18. There is another way to think about this example. We may consider the universal set U (the set containing every element involved in the discussion) to be D C. Since C is the set of cat owners, then C (the complement of C) is the set containing all the people who don t own a cat. We need to find C. Clearly C + C = U which means that C = U C = 45 27 = 18. Notice that the inclusion-exclusion principle was not used to solve this part of the example. 5C. How many people in the group own a cat but not a dog? There are C = 27 people in the group who own a cat, and there are D C = 18 people in the group who own both a cat and a dog. The number of people in the group who own a cat but not a dog is C D C = 27 18 = 9. Notice that the inclusion-exclusion principle was not used to solve this part of the example. 4
4 Homework Problems 4.1 Instructions Work through the homework problems referring to your notes and the lesson notes when necessary. Use the homework problem solutions only when you get completely stuck. Redo the homework problems before a quiz without referring to any other materials. It is best to do this more than once. 4.2 Problems 1. Find A B if A = 54, B = 39, and A B = 17. 2. Find A B if A = 340, B = 68, and A B = 372. 3. Find B if A B = 173, A B = 23, and A = 95. 4. A city neighborhood has 45 houses that are white, 67 houses that have two stories, and 16 houses which are white and have two stories. Use the inclusion-exclusion principle to determine the number of houses in the neighborhood that are either white or have two stories or both. 5. A car dealer has a group of 36 cars which are either blue or have cruise control or both. There are 25 blue cars and 27 cars which have cruise control. Use the inclusion-exclusion principle to determine how many of these cars are blue and have cruise control. 6. A gamers club has 123 members who play Slackers of Doom or Library Adventure or both games. If 87 of the gamers play Library Adventure and 45 of the gamers play both games, how many play Slackers of Doom? 7. Professor X has a class which has 35 students who can attend a tutoring session at either 1 pm on Saturday or 2 pm on Saturday or during both times. The tutoring session will be scheduled for the time during which the most students can attend. If 17 students can attend the 1 pm session and 13 students can attend both sessions, during which time will the tutoring session be scheduled? 8. A hotel has 100 rooms. There are 74 rooms which have a refrigerator, 60 rooms which have a microwave oven, and 47 rooms which have both a refrigerator and a microwave oven. A. Use the inclusion-exclusion principle to determine the number of rooms which have a refrigerator or a microwave oven or both. B. How many rooms have neither a refrigerator nor a microwave oven? C. How many rooms have a refrigerator but not a microwave oven? 5
9. During the month of May in city Z, it rained during 15 days, it was windy during 13 days, and it neither rained nor was it windy during 10 days. A. Determine the number of days in May during which it either rained or was windy or both in Z. B. Use the inclusion-exclusion principle to determine the number of days in May during which it both rained and was windy in Z. C. Determine the number of days in May during which it rained but was not windy in Z. 10. Assume U = A B. Use the inclusion-exclusion principle to find A if B = 52, A B = 93, and A B = 29. 11. A small library has 70 titles that are either science fiction or fantasy or both. Of these, 17 titles are both science fiction and fantasy and 30 titles are not science fiction. Use the inclusion-exclusion principle to determine how many titles are fantasy. 12. Assume U = A B. Use the inclusion-exclusion principle to find A B if A = 50, B = 30, and A B = 60. 6
5 Document License (CC BY-ND 4.0) Copyright 2016 2017 Scott P. Randby This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0) or later version license. License legal code 5.1 License Links License summary: https://creativecommons.org/licenses/by-nd/4.0/ License legal code: https://creativecommons.org/licenses/by-nd/4.0/legalcode 7