Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
This work is licensed under the Creative commons Attribution-Non-commercial-Share Alike 2.5 South Africa License. You are free to copy, communicate and adapt the work on condition that you attribute the authors (Dr Les Underhill & Prof Dave Bradfield) and make your adapted work available under the same licensing agreement. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.5/za/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA Chapter 2 SET THEORY KEYWORDS: Set, subset, intersection, union, complement, empty and universal sets, mutually exclusive sets; pairwise mutually exclusive and exhaustive sets. Why do we have to do set theory? ... Simply because one of Murphy’s Laws states that before you can do anything, you have to do something else. Before we can do “statistics” we have to do “probability theory”, and for that we need some “set theory”. So here we go. Definition of sets . . . We define a set A to be a collection of distinguishable objects or entities. The set A is determined when we can either (a) list the objects that belong to A or (b) give a rule by which we can decide whether or not a given object belongs to A. Example 1A: (a) If we say, “The letters e, f, g belong to the set A”, then we write A = {e, f, g} (b) If we say, “The set B consists of real numbers between 1 and 10 inclusive”, then we write B = {x | 1 ≤ x ≤ 10}. We read this by saying: “The set B consists of all real numbers x such that x is larger than or equal to 1 but is less than or equal to 10.” Because the object e belongs to the set A we write e∈A and we say: “e is an element of A”. Because e does not belong to B, we write e 6∈ B and we say: “e is not an element of B”. Note, firstly, that if C = {1, 3, 5, a} and D = {a, 1, 5, 3} then C = D. The order in which we list the elements of a set is irrelevant. Secondly, if E = {a, b, c, a} and F = {a, b, c} then E = F . The set E contains only the distinguishable elements a, b and c. 47 48 INTROSTAT Example 2B: (a) Express in set theory notation: the set U of numbers which have square roots between 1 and 4. (b) Write out in full all the elements of the set Z = {(x, y) | x ∈ {1, 2, 3, 4}, y = x2 }. (a) Because the square roots of numbers between 1 and 16 belong to U , we write U = {x | 1 ≤ x ≤ 16}. (b) Z = {(1, 1), (2, 4), (3, 9), (4, 16)}. Example 3C: Which of the following statements are correct and which are wrong? (a) (b) (c) (d) (e) (f) (g) {3, 3, 3, 3} = {3} 6 ∈ {5, 6, 7} C = {−1, 0, 1} F = {x | 4 < f < 5} {1, 2, 7} = {7, 2, 1, 7} If H = {2, 4, 6, 8}, J = {1, 2, 3, 4} and K = {2x | x ∈ H}, then K = J {1} ∈ {1, 2, 3}. Subsets . . . Suppose we have two sets, G and H, and that every element of G also belongs to H. Then we say that “G is a subset of H” and we write G ⊂ H. We can also write H ⊃ G and say “H contains G”. If every element in G does not also belong to H, we write G 6⊂ H and say “G is not a subset of H.” Example 4A: Let G = {1, 3, 5}, H = {1, 3, 5, 9} and J = {1, 2, 3, 4, 5}. Then clearly G ⊂ H, H 6⊂ J, J ⊃ G. Note that the notation ⊂, ⊃ for sets is analogous to the notation ≤, ≥ for ordinary numbers (rather than the notation <, >). The “round end” of the subset notation tells you which of the sets is “smaller” (in the same way as the “pointed end” shows which of two numbers is smaller). Our definition of subset has a curious (at first sight) but logical consequence. Because every element in G belongs to G, we can write G ⊂ G. For numbers, we can write 2 ≤ 2. If H ⊂ G and G ⊂ H, then, obviously, H = G. For numbers, x ≤ 2 and x ≥ 2 together imply that x = 2. Example 5C: Let V = {v | 0 < v < 5}, W = {0, 5}, X = {1, 2, 3, 4}, Y = {2, 4}, Z = {x | 1 ≤ x ≤ 4}. Which of the following statements are true, and which are false: (a) V = W (e) X = Z (b) Y ⊂ X (f) Z 6⊂ V (c) W ⊃ V (g) Y ⊂ W (d) Z ⊃ X (h) Y ∈ Z 49 CHAPTER 2. SET THEORY Intersections . . . Suppose that L = {a, b, c} and M = {b, c, d}. Then L 6⊂ M and M 6⊂ L. But if we consider the set N = {b, c}, then we see that N ⊂ L and N ⊂ M , and that no other set of which N is a subset has this property. This leads us to the idea of intersection. The intersection of any two sets is the set that contains precisely those elements which belong to both sets. For the sets, L, M and N above we write N = L ∩ M and read this “N equals L intersection M ”. The intersection of two sets M and N can be thought of as the set containing those elements which belong to both M and to N . Example 6A: If P = {x | 0 ≤ x ≤ 10} and Q = {x | 5 < x < 20}, find P ∩ Q. Is 5 ∈ P ∩ Q? Is 10 ∈ P ∩ Q? Paying careful attention to the endpoints, P ∩ Q = {x | 5 < x ≤ 10}. No, 5 6∈ P ∩ Q, but, yes, 10 ∈ P ∩ Q. The empty set, mutually exclusive sets . . . What happens if L = {a, b, c} and R = {d, e, f }? If we want L ∩ R to be a set, then we must introduce a new concept, the empty set, the set that has no members. This is a sensible concept: consider the set of English-speaking fish, or consider the set of real numbers whose square is negative. We reserve the symbol ∅ to denote the empty set. We use this symbol for no other purpose. We write and read this as L ∩ R = ∅, “the intersection of sets L and P is the empty set”. Pairs of sets whose intersection is the empty set are said to be mutually exclusive sets (or disjoint sets). Thus L and R are mutually exclusive. The universal set, the sample space . . . Another reserved symbol is the letter S. It is used for the set containing all objects under consideration. Thus if, in a particular problem, the only objects of interest are the colours of a traffic light, then S = {red, amber, green}. The set S is known to mathematicians as the universal set. In statistical jargon the set S is called the sample space. Unions The concept union contrasts with the concept intersection. The union of two sets A and B is the set that contains the elements that belong to A or to B. Here we use the word “or” in an inclusive sense — we do not exclude from the union those elements that belong to both A and B. If A = {1, 2, 3} and B = {2, 3, 4, 5} then the union of A and B is the set C = {1, 2, 3, 4, 5}. We write C =A∪B and say “C equals A union B”. 50 INTROSTAT Example 7A: If P = {x | 0 ≤ x ≤ 10} and Q = {x | 5 < x < 20}, find P ∪ Q. The union includes all the elements of both set P and set Q: P ∪ Q = {x | 0 ≤ x < 20}. Complements . . . Our final concept from set theory is that of the complement of a set. Given the sample space S, we define the complement of a set A to be the set of elements of S which are not in A. The complement of A is written A, and is always relative to the sample space S. If S = {1, 2, 3, 4, 5, 6}, A = {1, 3, 5} and B = {2, 4, 6} then A = {2, 4, 6}. We write A=B and say “the complement of A equals B” or, more briefly, “A complement equals B”. Example 8A: If S = {x | 0 ≤ x ≤ 1} and D = {x | 0 < x < 1}, find D. Because the set D excludes the endpoints of the interval from zero to one, D = {0, 1}. Example 9C: If the sample space S contains the letters of the alphabet, i.e. S = {a, b, c, . . . , x, y, z}, the set A contains the vowels, the set B contains the consonants, the set C contains the first 10 letters of the alphabet C = {a, b, c, . . . , h, i, j} pick out the true and false statements in the following list: (a) A ∪ B = S (g) S ∩ B = B (b) A ∩ B = ∅ (h) A ∪ A = S (c) S ⊂ S (i) C ∩ A = {o, u} (d) A ∩ C = {a, e, i} (j) (A ∪ C) = A ∩ C (k) A ∩ C ⊂ C (e) A ⊂ B (l) S = ∅ (f) A = B Venn diagrams . . . A pictorial representation of sets that helps us solve many probems in set theory is known as the Venn diagram. In the diagrams below think of all the “points” in the rectangle as being the sample space S, and all the points inside the circles for A and B as the sets A and B respectively. The shaded area in the diagram on the left then represents A ∩ B, the set of points belonging to A and B. Similarly the diagram on the right is a visual representation of A ∪ B, the set of points belonging to A or B. Recall once again the special, inclusive meaning we give to “or”. When drawing Venn diagrams it is helpful to associate “intersection” with “and” and “union” with “or”. S A S A B A∩B B A∪B 51 CHAPTER 2. SET THEORY The diagram on the left below shows how to depict two mutually exclusive sets in a Venn diagram. Venn diagrams are usually only useful for up to three sets: the area shaded in the diagram on the right is A ∩ B ∩ C. S A S B A B C A∩B∩C A∩B =∅ Pairwise mutually exclusive, exhaustive sets . . . If a family of sets A1 , A2 , . . . , An are such that any pair of them is mutually exclusive, i.e. Ai ∩ Aj = ∅ if i 6= j, and if A1 ∪ A2 ∪ . . . ∪ An = S, i.e. the union of the sets “exhausts” the sample space, then the family of sets A1 , A2 , . . . , An are said to be pairwise mutually exclusive and exhaustive. If we represent such a family of sets on a Venn diagram, the sets must cover the sample space, and they must be disjoint. Here are two examples: ....... ..... ......... ..... ..... .......... ........... ...... ......... ...... ..... ......... . . . . ...... . . . . . . . . . ...... ... ..... . . . . . . . . . . . . . . . . . . . . . .. ..... ...... ...... .......... ...... ... ...... ......... ...... ..... .... ......... ...... ...... .... .......... ...... ...... . ... ................. . . . . . . . . . . . . ........... ...... ...... . ...... ..... 3 ...... ...... ...... ...... ...... ...... . .. . . . . . . . . ...... .... .... ...... ...... ...... ...... ...... ...... ...... ...... . ..... . . . . . . . . . . . . . . . . ..... ...... ...... ...... ...... 4.................. ...... ..... .... ...... ...... ..... ...... ...... ...... . . . . . . . . . . . . . . ..... . . .. ..... ...... ...... ...... ...... ..... . . . . . . . . . . . . . . .. ..... ...... ...... ..... n−1............... ...... ...... ...... ... ...... ...... ..... . . . . . . . . . . . ..... ...... n ...... ..... ...... ..... ...... ..... ... ... A1.............. .. A2 ... .... A A .. . A A S ... ..... .. ... ....... ..... ....... ... . ....... ... ... ....... . . . ... . ... . . .. ... ... ....... ... ....... . . ... . . 3 . . . . . 1 .... ..... ... ....... ... ....... 8 6 ........ ... ............. .......................................................................... . . . . . . . ...... ....... . . . . . . . . . . . . .... .. .......... ... ... ... ......... ...... ... .. ... ........... .. ... ... ... .......... ..... ... ... .. . ........... . . ... .......... . . . .. . . 2 ..... .... . . . . . . . . . . 5 ..... .. ......... .. . .......... ... .. .. ........... ... ... ... .............. .. ... ... ............ .. ... . . .. . . . . .. . .. .. ..... ... ... .. ... ... ... .. ... ... ... .. ...... . .. . . . 9 7 4 .... .. ... ... . ... ... ... ... ... ... .. ... ... . . . . . . ... ... ... A A A A S A A A A A Using Venn diagrams . . . Example 10B: Draw Venn diagrams to show that (A ∪ B) ∩ C = (A ∩ C) ∪ (B ∩ C) In the left-hand Venn diagram, the grey-shaded shaded area is A ∪ B, and the vertically shaded area is C. Their intersection (A ∪ B) ∩ C is shaded both grey and vertically. In the right-hand Venn diagram, the two shaded areas are A ∩ C and B ∩ C. Their union is the same as the area shaded both grey and vertically in the left-hand diagram. 52 INTROSTAT A B S A B C C (A ∪ B) ∩ C (A ∩ C) ∪ (B ∩ C) S Example 11C: Draw Venn diagrams to show that the following are true: (a) A ∪ B = A ∪ (B ∩ A) (b) (A ∩ C) ∪ (B ∩ A) = (A ∪ C) ∩ (A ∩ B) (c) The sets A ∩ B, A ∩ C, B ∩ A and (A ∪ C) form a family of pairwise mutually exclusive and exhaustive sets. Example 12C: Draw Venn diagrams to determine which of the following statements are true. (a) (b) (c) (d) (e) (f) (A ∩ B) = A ∩ B (A ∩ B) ∪ (A ∩ B) ⊂ A ∪ B (A ∪ B) ∩ C = (A ∩ C) ∪ (B ∩ C) (C ∩ A) ∪ (C ∩ B) = (C ∪ (A ∩ B)) [(A ∪ B) ∩ C] ∪ [(A ∪ C) ∩ B] = [(A ∪ B ∪ C) ∩ (A ∪ B) ∩ C] ∪ (A ∩ B) If the sets A1 , A2 , A3 , and A4 are pairwise mutually exclusive and exhaustive, and B is an arbitrary set, then B = (A1 ∩ B) ∪ (A2 ∩ B) ∪ (A3 ∩ B) ∪ (A4 ∩ B). Solutions to examples . . . 3C (a), (b), (c) and (e) are correct; (d) should read either F = {x | 4 < x < 5} or F = {f | 4 < f < 5}. For (f), check that the following statement is correct: if H and J are as given, and if K = {2x | x ∈ J} then K = H. For (g), note that we never use the ∈-notation with a set on the left hand side. 5C Only (b) and (d) are true. 9C All are true. 11C All are true. 12C (b) (c) (e) and (f) are true. For (a), check that (A ∩ B) = A ∪ B is true. 53 CHAPTER 2. SET THEORY Easy exercises . . . 2.1 Let S be {1, 2, 3, 4, 5, 6}, the set of all possible outcomes when a die is thrown and the number of dots on the uppermost face recorded. Describe in words the following sets: (a) {6} (d) {2, 4, 6} (b) {1, 2, 3, 4} (e) {5, 6} (c) {1, 3, 5} (f) {6} ∗ 2.2 If S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, and A = {0, 1, 2}, B = {3, 4, 5, 6, 7}, C = {7, 8}, and D = {2, 4, 6, 8}, which of the following statements are true? (a) (b) (c) (d) (e) (f) A and B are mutually exclusive B = {0, 1, 2, 8, 9} A ∪ B ∪ C ∪ D = {0, 1, 2, 3, 4, 5, 6, 7, 8} D ⊂ (B ∪ C) A ∩ B ∩ C ∩ D = {9} A ∪ (B ∩ D) = (A ∩ B) ∪ (A ∩ D). 2.3 Let S denote the set of all companies listed on the Johannesburg Stock Exchange. Let A = {x | x is in the gold mining sector}, let B = {x | x has annual turnover exceeding R10 million}, let C = {x | x has financial year ending in June}, let D = {x | the share price of x is higher now than six months ago}. Describe in words the following sets: (a) (b) (c) (d) ∗ 2.4 A ∪ B, A ∩ D, A ∩ C ∩ D, B ∩ (C ∪ A), (e) (f) (g) (h) A, C ∪ D, B∩C (B ∩ A) ∪ (C ∩ D). If A, B and C are subsets of a universal set S, draw Venn diagrams to determine which of the following statements are true. (a) (b) (c) (d) (e) (f) (g) (h) (i) (j) A∪A=S A∩A=∅ A∪B =A∩B A∩B =A∪B A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) A∪B∪C =S A∩B∩C =∅ A∪B ⊃A∩B A ∩ (B ∪ C) ⊂ A ∪ (B ∩ C) 2.5 If S = {1, 2, 3}, list all the subsets of S. ∗ 2.6 Draw a series of Venn diagrams representing three sets, and shade in the following areas. (a) (b) (c) (d) A∩B∩C (B ∩ A) ∪ (A ∩ C) A∪B∪C (A ∪ B ∪ C) ∩ (B ∩ C). 54 INTROSTAT More difficult exercises . . . ∗ 2.7 Let B1 , B2 , . . . , Bn be n disjoint subsets of S such that ∪ni=1 Bi = S and Bi ∩ Bj = ∅ for i 6= j. Let A be any other subset of S. Use a Venn diagram to show that A = ∪ni=1 (A ∩ Bi ). [Notation: ∪ni=1 Bi means B1 ∪ B2 ∪ . . . ∪ Bn .] 2.8 Show that if the set S has n elements, then S has 2n subsets. [Hint: Use the binomial theorem.] 2.9 Let A and B be two events defined on a sample space S. Depict the following events in Venn diagrams: (a) C = (A ∩ B) ∪ (A ∩ B) (b) D = (A ∪ B) ∪ (A ∩ B) (c) What can you say about events C and D? Solutions to exercises . . . 2.1 (a) (b) (c) (d) (e) (f) The number six is obtained. A number less than or equal to four is obtained. An odd number is obtained. An even number is obtained. A number greater than or equal to 5 is obtained. A number other than 6 is obtained. 2.2 All are true except (d) and (f). 2.3 (a) Set of companies either in the gold mining sector or with turnovers exceeding R10 million. (b) Set of gold mining companies whose share price is higher now than six months ago. (c) Set of gold mining companies with a financial year ending in June whose share price is higher now than six months ago. (d) Set of all companies which have an annual turnover exceeding R10 million and which are either gold mining companies or companies with financial years ending in June (or both). (e) Set of companies not in the gold mining sector. (f) Set of companies which either do not have a financial year ending in June or have a share price which is higher now than six months ago. (g) Set of companies which either do not have an annual turnover exceeding R10 million or do not have financial year ending in June. CHAPTER 2. SET THEORY 55 (h) Set of companies which either do not have an annual turnover exceeding R10 million or are not in the gold mining sector or both have a financial year ending in June and have a share price which is higher now than six months ago. (Notice how difficult it is to express unambiguously in words the meaning of a few mathematical symbols.) 2.4 All are true, except (g) and (h). 2.5 ∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}. 2.9 (c) C and D are mutually exclusive. 56 INTROSTAT