


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Jim Lambers Math 6A Spring Quarter 2003- Lecture 27 Notes
These notes correspond to Section 6.5 in the text.
In Lecture 7, we learned a useful technique for counting problems called the inclusion-exclusion principle. In its simplest form, the principle states that given two sets A 1 and A 2 ,
|A 1 ∪ A 2 | = |A 1 | + |A 2 | − |A 1 ∩ A 2 |.
Intuitively, this principle states that the number of ways to complete two tasks, when the tasks can possibly be performed at the same time, is equal to the sum of the number of ways to perform each task, less the number of ways to perform both. An alternative interpretation is that the number of objects that have either one of two properties is equal to the sum of the number of objects that have each property, less the number of objects that have both properties. This principle can easily be generalized to count the number of objects in the union of three sets A 1 , A 2 and A 3. Using the formula for the cardinality of the union of two sets, along with the Distributive Laws and the Associative Laws, we obtain
|A 1 ∪ A 2 ∪ A 3 | = |A 1 ∪ (A 2 ∪ A 3 )| = |A 1 | + |A 2 ∪ A 3 | − |A 1 ∩ (A 2 ∪ A 3 )| = |A 1 | + |A 2 | + |A 3 | − |A 2 ∩ A 3 | − |A 1 ∩ (A 2 ∪ A 3 )| = |A 1 | + |A 2 | + |A 3 | − |A 2 ∩ A 3 | − |(A 1 ∩ A 2 ) ∪ (A 1 ∩ A 3 )| = |A 1 | + |A 2 | + |A 3 | − |A 2 ∩ A 3 | − [|A 1 ∩ A 2 | + |A 1 ∩ A 3 | − |(A 1 ∩ A 2 ) ∩ (A 1 ∩ A 3 )|] = |A 1 | + |A 2 | + |A 3 | − |A 2 ∩ A 3 | − [|A 1 ∩ A 2 | + |A 1 ∩ A 3 | − |A 1 ∩ A 2 ∩ A 3 |] = |A 1 | + |A 2 | + |A 3 | − |A 1 ∩ A 2 | − |A 1 ∩ A 3 | − |A 2 ∩ A 3 | + |A 1 ∩ A 2 ∩ A 3 |.
Note that the formula for |A 1 ∪ A 2 ∪ A 3 | involves the cardinality of the intersections of pairs of sets chosen from {A 1 , A 2 , A 3 }, as well as the intersection of all three sets. Also note that the cardinality of the intersections of pairs of sets is subtracted, while the cardinality of the intersection of all three is added.
We will now state and prove the general inclusion-exclusion principle that counts the number of elements in the union of n sets A 1 , A 2 ,... , An. To state the formula concisely, we introduce some notation. Let Sn = { 1 , 2 ,... , n} be the set of the first n positive integers. We define Cr(Sn) to be the set containing all r-combinations of elements of Sn. Each r-combination s ∈ Cr(Sn) contains r distinct integers chosen from Sn, which we denote by s 1 , s 2 ,... , sr.
Theorem (Inclusion-Exclusion Principle) Let Sn = { 1 , 2 ,... , n}. If A 1 , A 2 ,... , An are sets, then ∣ ∣ ∣∣ ∣
⋃^ n
i=
Ai
∑^ n
r=
(−1)r+^
s∈Cr (Sn)
⋂^ r
j=
Asj
where Cr(Sn) is the set of all r-combinations of the set Sn and each r-combination s ∈ Cr(Sn) contains distinct elements s 1 , s 2 ,... , sr chosen from Sn.
Proof We must show that each element in the union of A 1 , A 2 ,... , An is counted exactly once by the formula stated in the theorem. Suppose that an element a belongs to r of these sets. Then, it is counted r times by the sum |A 1 | + |A 2 | + · · · + |An|. Since there are C(r, 2) ways to choose two of the r sets to which a belongs, it follows that a is counted C(r, 2) times by the sum of the cardinalities of the intersections of all pairs of sets. In general, a is counted C(r, k) times by the sum of the cardinalities of the intersections of all combinations of k sets, for k = 1, 2 ,... , r. It follows that the number of times a is counted in the formula in the statement of the theorem is
C(r, 1) − C(r, 2) + C(r, 3) + · · · + (−1)r+1C(r, r) =
∑^ r
k=
(−1)k+1C(r, k).
However, ∑r
k=
(−1)kC(r, k) = 0,
which yields ∑r
k=
(−1)k+1C(r, k) = −
∑^ r
k=
(−1)kC(r, k) = (−1)^0 C(r, 0) = 1,
so we conclude that a is counted exactly once. Since r is arbitrary, it follows that every element of the union is counted exactly once, so the formula computes the cardinality of the union correctly. 2
As in the case of three sets, the cardinality of the union of n sets is obtained by computing the cardinality of intersections of larger and larger combinations of sets, beginning with single sets, then pairs of sets, and so on, until the cardinality of the intersection of all n sets is included. Cardinalities of intersections of an even number of sets are subtracted, while cardinalities of intersections of an odd number of sets are added.
by 4, we have A 8 ⊂ A 4 , so |A 4 ∩ A 8 | = |A 8 | = 125. If a number is divisible by both 4 and 10, then it must be divisible by 20, since that is the least common multiple of 4 and 10. It follows that |A 4 ∩ A 10 | = 1000/20 = 50. Similarly, any number that is divisible by both 8 and 10 must be divisible by 40, so we have |A 8 ∩ A 10 | = 1000/40 = 25. Finally, any number that is divisible by 4, 8 and 10 must be divisible by 40, so we have |A 4 ∩ A 8 ∩ A 10 | = 25. We conclude that
|A 4 ∪ A 8 ∪ A 10 | = 250 + 125 + 100 − 125 − 50 − 25 + 25 = 300.
Certainly this approach is preferable to examining each integer to see if it is divisible by 4, 8 or 10 and counting the number of them that are, one by one. 2