<<

2.4. WORKING WITH SETS

In this section we present a general method for proving identities and set laws using Venn diagrams. We also state two fundamental results in elementary : De Morgan’s Laws and the Inclusion-Exclusion Principle. Finally, we apply this last result to solve survey problems.

Proving Set Identities

EXAMPLE 1. In the previous section we defined the set difference 퐴 − 퐵 to be the set consisting of all the elements in 퐴 that are not in 퐵. The for this set is shown again in Figure 4 below.

Figure 4: Venn Diagram for the Set Difference 퐴 − 퐵

Suppose we now want to find an expression for 퐴 − 퐵 that doesn’t use the difference . Can we accomplish this using any combination of the other three set operations defined earlier? Looking at the shaded region in Figure 4 does suggest a few options, though they may not seem obvious at first. The region in set 퐴 that is not shaded lies entirely in set 퐵. The shaded region is, therefore, the common region between set 퐴 and everything outside of set 퐵. This insight leads us to posit the following identity:

퐴 − 퐵 = 퐴 ∩ 퐵̅ This identity is, in fact, commonly used whenever the difference operation is not considered. One way to get a sense of why 퐴 − 퐵 and 퐴 ∩ 퐵̅ are equal for any sets 퐴 and 퐵 is by using actual sets. Take a look back at the example we presented in the last section featuring even and prime outcomes of a die throw. From Figure 2, we infer the following:

퐴 − 퐵 = {2,4,6} − {2,3,5} = {4,6} and 퐴 ∩ 퐵̅ = {2,4,6} ∩ {̅̅2̅̅,3̅̅,̅5̅̅} = {2,4,6} ∩ {1,4,6} = {4,6}.

So the identity holds indeed with these sets since 퐴 − 퐵 = 퐴 ∩ 퐵̅ = {4,6}. You can check that the region containing outcomes 4 and 6 in Figure 2 corresponds to the shaded region in Figure 4.

Still, how can we prove the identity in general for any sets 퐴 and 퐵? As it turns out, there is a rather straightforward procedure to do this. This method is based on a labeling, or indexing (typically with numbers), of all the different regions in the general Venn diagram resulting from set intersections. Our case involves only two sets intersecting, thus producing a total of four distinct regions. Note that this indexing is arbitrary and can be fixed in any way we choose. Figure 5 below shows one such indexing of the four regions in a general Venn diagram for two sets.

Figure 5: Indexing Regions in a General Venn Diagram for Two Sets The simple principle behind this procedure is that any in the must belong to exactly one of the four indexed regions. We shall see later how this idea can be extended to the case of three intersecting sets. In essence, the method works for any finite number of intersecting sets (though the cases of four or more intersecting sets are rarely done through Venn diagrams).

Technically, the two overlapping sets are said to partition the universe into four distinct regions. This partition highlights two important facts:

1. The four indexed regions are disjoint (so no element in the universe can belong to two regions).

2. The four indexed regions exhaust the entire universe (so no element in the universe can exist outside these regions).

Based on the indexing shown in Figure 5, we conveniently describe the two sets in the identity by listing the regions contained within them. We then have 퐴 = {2,3} and 퐵 = {3,4}. Note that region 1, which lies outside the two sets, corresponds to 퐴̅̅̅∪̅̅̅퐵̅, while region 3, which is common to both sets, corresponds to 퐴 ∩ 퐵

We then prove the identity 퐴 − 퐵 = 퐴 ∩ 퐵̅ by showing that the expressions on both sides of the identity consist of the same set of indexed regions. In other words, we show that the Venn diagram for each side produces identical shadings. Practically speaking, we can mimic the work we did earlier with the sets of even and prime die outcomes, but using indices instead of die outcomes.

The expression 퐴 − 퐵 consists of region 2 only since 퐴 − 퐵 = {2,3} − {3,4} = {2}. The expression 퐴 ∩ 퐵̅ also consists of region 2 only since

퐴 ∩ 퐵̅ = {2,3} ∩ {̅̅3̅,̅4̅̅} = {2,3} ∩ {1,2} = {2}.

Thus, we have now completed our proof. Figure 4 is the corresponding Venn ̅ diagram for both 퐴 − 퐵 and 퐴 ∩ 퐵.

EXAMPLE 2. The procedure used in Example 1 to prove 퐴 − 퐵 = 퐴 ∩ 퐵̅ can be readily extended to expressions with three sets. Consider the following identity:

퐴 ∪ (퐵 ∩ 퐶) = (퐴 ∪ 퐵) ∩ (퐴 ∪ 퐶)

This is one of the distributive laws for sets presented in the last section. If you remember some basic algebra, this result will surely make a lot of sense. Structurally, it ( ) looks a lot like this kind of simplification: 푎 푏 + 푐 = 푎푏 + 푎푐 where 푎, 푏, 푐 are variables standing for numbers. This resemblance is not surprising given that all the properties in elementary algebra, including the distribution of variables shown above, are ultimately derived from set laws.

Just like in the previous example, we can start by using actual sets to make the property convincing. Suppose 퐴 is the set of letters in the word “OLIVE,” 퐵 is the set of letters in the word “BASIL” and 퐶 is the set of letters in the word “GARLIC.” Then the left-hand-side of the identity is given by

퐴 ∪ (퐵 ∩ 퐶) = {푂, 퐿, 퐼, 푉, 퐸} ∪ ({퐵, 퐴, 푆, 퐼, 퐿} ∩ {퐺, 퐴, 푅, 퐿, 퐼, 퐶}) { } = 퐸, 퐼, 퐿, 푂, 푉 ∪ {퐴, 퐼, 퐿} = {퐴, 퐸, 퐼, 퐿, 푂, 푉}. while the right-hand-side of the identity is given by

(퐴 ∪ 퐵) ∩ (퐴 ∪ 퐶) = ({푂, 퐿, 퐼, 푉, 퐸} ∪ {퐵, 퐴, 푆, 퐼, 퐿}) ∩ ({푂, 퐿, 퐼, 푉, 퐸} ∪ {퐺, 퐴, 푅, 퐿, 퐼, 퐶}) { } = 퐴, 퐵, 퐸, 퐼, 퐿, 푂, 푆, 푉 ∩ {퐴, 퐶, 퐸, 퐺, 퐼, 퐿, 푂, 푅, 푉} = {퐴, 퐸, 퐼, 퐿, 푂, 푉}.

Thus, we have confirmation that the property holds with our sets since 퐴 ∪ (퐵 ∩ 퐶) and (퐴 ∪ 퐵) ∩ (퐴 ∪ 퐶) are both equal to {퐴, 퐸, 퐼, 퐿, 푂, 푉}. The example we used here illustrates how the set operations of union and intersection follow the distributive law. Of course, it is by no means an actual proof since the property should hold for all sets 퐴, 퐵, 퐶 and not just one interaction of sets we fixed at the outset. To prove the property in general we use the indexing procedure outlined in the previous example.

Our case now involves three intersecting sets partitioning the universe into eight distinct regions. Figure 6 below shows one such indexing of the eight regions in a general Venn diagram for three sets.

Figure 6: Indexing Regions of a General Venn Diagram for Three Sets

Based on the indexing shown in Figure 6, we write the three sets in the identity in terms of the regions as follows:

퐴 = {2,5,6,8}, 퐵 = {3,5,7,8}, and 퐶 = {4,6,7,8}.

Note that region 1, which lies outside all three sets, corresponds to 퐴̅̅̅∪̅̅̅퐵̅̅̅∪̅̅̅퐶̅, while region 8, which is common to all three sets, corresponds to 퐴 ∩ 퐵 ∩ 퐶. All other regions correspond, similarly, to specific sets whose expressions can be worked out using set operations. An element in region 7, for example, would belong to both sets 퐵 and 퐶, but not to set 퐴. You can check that region 7 corresponds to the set (퐵 ∩ 퐶) − 퐴, or (퐵 ∩ 퐶) ∩ 퐴̅.

We are now ready to proceed with our proof of the distributive law. The left- hand-side 퐴 ∪ (퐵 ∩ 퐶) consists of the regions 2, 5, 6, 7, and 8 since

퐴 ∪ (퐵 ∩ 퐶) = {2,5,6,8} ∪ ({3,5,7,8} ∩ {4,6,7,8}) { } = 2,5,6,8 ∪ {7,8} = {2,5,6,7,8},

The right-hand-side (퐴 ∪ 퐵) ∩ (퐴 ∪ 퐶) also consists of the regions 2, 5, 6, 7, and 8 since (퐴 ∪ 퐵) ∩ (퐴 ∪ 퐶) = ({2,5,6,8} ∪ {3,5,7,8}) ∩ ({2,5,6,8} ∪ {4,6,7,8}) { } = 2,3,5,6,7,8 ∩ {2,4, 5,6, 7,8} = {2,5,6,7,8}.

Thus the left- and right-hand-sides of the identity are identical sets. This completes our proof of the property. The Venn diagram for sets 퐴 ∪ (퐵 ∩ 퐶) and

(퐴 ∪ 퐵) ∩ (퐴 ∪ 퐶) is show in Figure 7 below.

Figure 7: Venn Diagram for Sets 퐴 ∪ (퐵 ∩ 퐶) and (퐴 ∪ 퐵) ∩ (퐴 ∪ 퐶)

De Morgan’s Laws

Once you consider complementation in a universe with two sets, two immediate questions come to mind:

1. How is the of the union 퐴 ∪ 퐵 related to the sets 퐴, 퐵? 2. How is the complement of the intersection 퐴 ∩ 퐵 related to the sets 퐴, 퐵?

The 19th century British logician Augustus De Morgan (1806 – 1871) answered these questions by formulating his eponymous laws:

1. The complement of the union is the intersection of the complements: 퐴̅̅̅∪̅̅̅퐵̅ = 퐴̅ ∩ 퐵̅

2. The complement of the intersection is the union of the complements: 퐴̅̅̅∩̅̅̅퐵̅ = 퐴̅ ∪ 퐵̅

De Morgan’s Laws are not only fundamental to set theory, but also to propositional logic. We shall revisit them in the next chapter. For now, let us think about the validity of these laws. Take the second law, for example. Suppose you thought that complementation distributes inside the intersection so that 퐴̅̅̅∩̅̅̅퐵̅ = 퐴̅ ∩ 퐵̅. Why isn’t this true? Using the method with indexed regions, you can show that the Venn diagram for 퐴̅̅̅∩̅̅̅퐵̅ shades everything except for the overlapping region common to both sets, while the Venn diagram for 퐴̅ ∩ 퐵̅ only shades the region lying outside both sets (check this). Since the two Venn diagrams corresponding to both sides of the property we claimed are different, we conclude that our initial guess was wrong: 퐴̅̅̅∩̅̅̅퐵̅ ≠ 퐴̅ ∩ 퐵̅. Let’s apply the same method now to prove De Morgan’s second law, which states that complementing an intersection actually results in a union of complements, or 퐴̅̅̅∩̅̅̅퐵̅ = 퐴̅ ∪ 퐵̅. Using the indexing from Figure 5, we can work out the regions for both sides of the identity as follows:

퐴̅̅̅∩̅̅̅퐵̅ = {̅̅2̅,̅3̅̅}̅̅∩̅̅{̅̅3̅,̅4̅̅} = {̅̅3̅̅} = {1,2,4} and 퐴̅ ∪ 퐵̅ = {̅̅2̅,̅3̅̅} ∪ {̅̅3̅,̅4̅̅} = {1,4} ∪ {1,2} = {1,2,4}.

This proves De Morgan’s second law. The Venn diagram for sets 퐴̅̅̅∩̅̅̅퐵̅ and 퐴̅ ∪

퐵̅ is show in Figure 8 below. The proof for the first law is left as an exercise.

Figure 8: Venn Diagram for Sets ̅퐴̅̅∩̅̅̅퐵̅ and 퐴̅ ∪ 퐵̅

The Inclusion-Exclusion Principle & Survey Problems

Indexing all the distinct regions of a Venn diagram proved to be a powerful method for proving set identities and set laws. Another key application of this method is related to the of finite sets and the solution of survey problems.

Let’s start with a simple example. Suppose a recent survey of 1600 commuters in New York City showed that 662 people ride the subway, 203 people ride the bus, and 45 people ride both the subway and the bus. Based on this data, how many people do not ride the subway or the bus to work? If you try to work out this number in your head, you may find it more challenging than expected. In fact, this type of question can only be answered by applying the so-called Inclusion-Exclusion Principle stated below.

THEOREM: Let 퐴 and 퐵 be finite sets. Then the of 퐴 ∪ 퐵 is given by

|퐴 ∪ 퐵| = |퐴| + |퐵| − |퐴 ∩ 퐵|.

In other words, the cardinality of the union of two sets (|퐴 ∪ 퐵|) is the sum of the cardinality of each set (|퐴| + |퐵|) minus the cardinality of the intersection of the two sets (|퐴 ∩ 퐵|). This essential principle makes sense once you realize that elements in the overlapping region common to both sets should not be counted twice. In the case of three sets, this principle prevents elements that belong to multiple sets from being counted more than once (up to three times in the region common to all sets). In the case of , the formula is simplified to |퐴 ∪ 퐵| = |퐴| + |퐵| since |퐴 ∩ 퐵| = 0; in the case where 퐴 ⊆ 퐵, we have |퐴 ∪ 퐵| = |퐵|.

Let’s now answer the previous question involving commuters. Figure 9 below shows the Venn diagram corresponding to this survey, where set 퐴 represents the commuters who ride the subway, set 퐵 represents the commuters who ride the bus, and the 푈 represents all the commuters who were surveyed. Note that this diagram only displays the following information given by the survey data:

. |푈| = 1600 (total number of commuters / size of survey) . |퐴| = 662 (number of commuters who ride the subway) . |퐵| = 203 (number of commuters who ride the bus) . |퐴 ∩ 퐵| = 45 (number of commuters who ride the subway and the bus)

We put question marks wherever we don’t yet know the number of commuters:

. |퐴 − 퐵| =? (number of commuters who only ride the subway) . |퐵 − 퐴| =? (number of commuters who only ride the bus) . |퐴̅̅̅∪̅̅̅퐵̅| =? (number of commuters who don’t ride the subway or the bus)

Figure 9: Venn Diagram for Commuter Survey (Incomplete)

To complete Figure 9, we proceed by finding the number of commuters who only ride one type of mass transit system (the question marks inside each set) and the number of commuters who don’t ride either type of mass transit system (the question mark outside both sets). This last number is the answer we seek. We start by finding |퐴 − 퐵| and |퐵 − 퐴| as follows:

|퐴 − 퐵| = |퐴| − |퐴 ∩ 퐵| = 662 − 45 = 617

|퐵 − 퐴| = |퐵| − |퐴 ∩ 퐵| = 203 − 45 = 158

So 617 commuters only ride the subway, while 158 commuters only ride the bus. Next we find |퐴̅̅̅∪̅̅̅퐵̅|, the answer to our question, by using the Inclusion-Exclusion Principle as follows: |퐴̅̅̅∪̅̅̅퐵̅| = |푈| − |퐴 ∪ 퐵| = |푈| − (|퐴| + |퐵| − |퐴 ∩ 퐵|) = 1600 − (662 + 203 − 45) = 1600 − 820 = 780

Therefore, 780 commuters in the survey did not ride the subway or the bus. The completed Venn diagram for this survey is shown below in Figure 10.

Figure 10: Venn Diagram for Commuter Survey (Complete) Surveys involving three sets are solved in a similar fashion, using the survey data and the Inclusion-Exclusion Principle to deduce the number of elements corresponding to each of the eight regions in the Venn diagram. In those cases, the typical procedure is to work outwards with the regions: start with the innermost region, where all three sets overlap, continue to the three regions where exactly two sets overlap, then move to the three regions inside each set where there is no overlap, and finish with the region outside all three sets. Three-set surveys are left as exercises.