Sets and set operations Lecture 5 ICOM 4075
Reviewing sets s defined in a previous lecture, a setis a collection of objects that constitute the elementsof the set We say that a set containsits elements, and that an element belongs to its set If S is a set and x an element in S, we write x ЄS
Examples of sets 1. The set of integers: {, -3, -2, -1, 0, 1, 2, 3, } 2. The set of the vowels in the Latin alphabet: {a, e, i, o, u} 3. The set of all real solutions of the equation x⁴ + y⁴ 1 4. The set of 6 foot tall people 5. The set with no elements: this is the so-called empty set, and is denoted by φ
Describing sets a) By listing: this is, providing a list (sometimes partial list or mere pattern of formation) of the elements Example: Integers {, -3, -2, -2, 0, 1, 2, 3, } b) By property:this is, by providing a logical statement (property) that characterizes membership in the set. In this case, an element x is in the set if the statement is true for x and it is not if the statement is false Property logical statement Example: {x : x is an integer and x⁴ + 1 is even} 1Є, since 1⁴+1 2; 3Є since 3⁴+182; etc
Equality of sets Definition: Two sets are equalif they have the same elements. If S and R are sets and they are equal, then we write S R Examples: {1, 2, 3} {3, 1, 2} {a, b, a} {a, b} {a, c} {a}
Implications of equality s illustrated in the previous examples, (as a consequence of the definition of equality between sets) we have that in sets: Repeated elements do not count (repetitions are ignored) There is no particular order of the elements in a set
Finite and infinite sets set is finiteif it has a finite number of elementsor if it is the empty set. Otherwise, the set is said to be infinite Examples: The set of vowels in the Latin alphabet is finite since it has only 5 elements The set of people 20 foot tall is finite since it is empty The set of integers is infinite
Subsets Definition: If and B are sets and every element in is also an element in B, we say that is a subset of B. If is a subset of B we write: B Remark: The empty set is a subset of any set
The power set Definition: The power set of a set is the set of all subsets of (includes the empty set and the set itself). The power set of is denoted by pow() Example: Let {1, 2, 3}. The subsets of are: φ, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, and itself. Thus, pow( ) {φ, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, }
Proof strategies with subsets and equalities Following are useful strategies for proving logical statements asserting that two sets are equal or that one set is a subset of another set: Statement to prove is a subset of B is not a subset of B equals B is not equal to B Strategy Forarbitrary x in, show that x is also in B Find an element in that is not an element in B Show that is a subset of B and B is a subset of Find an element in that is not in B oran element in Bthat is not in
Example 1 Prove that is subset of B where {x : x 1 / (3n + 6), for some natural n} B {x : x 1 / n, for some natural n} Proof: If x is an element in, then there is a natural number q such that x 1 /(3q + 6). So, x 1 / 3(q + 2) or what is the same x 1 / 3k, where k q + 2 is a natural number. generic element in Therefore, x 1 / n with n 3k, a natural number. Conclusion: x is in B. Just a bit of algebra The generic element in satisfies the condition of membership in B
Example 2 Let {x : x 3k + 4, k integer} and B {x : x 5k + 6, k integer}. Is subset of B or B subset of? nswer: Neither is subset of B nor B is subset of. Proof: 7 is in, since 3 1+4 7. But, 7 is not in B since 7 5k+6 implies k 1/5 which is not integer. So, is not a subset of B. Reciprocally, 11 is in B since 5 1+6 11. But, 11 is not in since 11 3k+4 implies k 7/3 which is not integer. So, B is not a subset of.
Example 3 Let {x : x is prime and 12 x 18} and B {x : x 4 k + 1 and k 3 or k 4} Prove that B. Proof: First prove that is a subset of B: Note that {13, 17} since these are the primes that satisfy the property. But, 13 4 3 + 1 and 17 4 4 + 1. Therefore, 13 is in B and 17 is in B. Reciprocally, if k 3, 4 k + 1 4 3 + 1 13. Now, 13 is prime and 12 13 18. So, 13 is in. lso, if k 4, 4 k + 1 4 4 + 1 17. But, 17 is prime and 12 17 18. So, 17 is in
Set operations The main set operations are Union of sets Intersection of sets Complement of a set
The union of two sets Definition: given two sets and B, their unionis the set U B defined as U B {x: x in or x in B} Example 1: Let {a, b, c, d} and B {a, e, f}. Then, U B {a, b, c, d, e, f} Example 2: Let be the even numbers and B be the odd numbers. Then, U B is the set of natural numbers
Properties of union 1. φ 2. B B 3. (B C) ( B) C 4. 5. Bif andonly if B B
Proving some of these properties These properties (as any other property) are logical statements about sets and operations. This is, they are ultimately mathematical statements. We ll prove a one of them. Let s take for example, properties 5.
Proof of property 3 Remark: Note that property is and if and only if statement, and therefore, there are two implications involved. These are: (a) If B then B B (b) If Proof of (a): B B then The thesis is a equality of sets. We ll prove it by proving that: B B, and B B B
Proof of (a) (continuation) If x B, then x or x B. Since by hypothesis B, we have that if x, then x B. Therefore, if x B, then x B. This is, B B. Reciprocally, if x B then x B or x ; therefore, B B. So, B B.
Proof of (b) Theimplication is now : If B B then, B. We use the contrapositive: If B then B B. Proof of the contrapositive: If B, then there is an element x such that x B. But then,x B but x B. Therefore B and B do not have thesameelements. This is, B B.
Infinite unions Definition: Let ₁, ₂, ₃, be an infinite collection of sets. Their unionis define as the set: Thus, Now, U i 1 Example: Let { 2i, 2i}, i i 1 U i 1 i { 2, i {x : x, for some i 1,2,3,... 2}; 2 i { 4, 4}; 1} { 6, 6}, etc... {...,-10, -8, - 6, - 4, - 2, 2, 4, 6, 8,10,...} 3
Intersections Definition: The intersection of two sets and B is defined to be the set Example: B {x : x and x B} Let {n : n is integer and n 3k + 7 for some integer k} and let B {m : m is integer and m 4k + 5 for some integer k} Then B {n : n 3k + 7 4k + 5, for some integer k} Is there a solution? Yes!Pick k 2. Then 3k + 7 13 4k + 5. Therefore, B {13}.
Properties of the intersection of two sets 1. φ φ 2. B B 3. ( B) C (B C) 4. 5. B if and only if B
Further examples 1. Let {x : x is integer and x and let B the set of all integers. 20 for some integer k} k Then B {-20, -10, -5, - 4, - 2, 2, 4, 5,10, 20} 2. Let {y : y (x -1) 2 + 2 for some real number x} and let B {z :z -2x + 3 for some real number x}. Then, B {3}since if y z then (x -1) 2 + 2 2x + 3 x 2 2x + 1+ 2-2x + 3 x 2 + 3 3. This is, x 0. By replacing in both equations : y z 3.
,, Infinite intersections Definition : The intersection of 1 I i 1 i 2 Example: Let 3,...of sets is defined to be the set {x : x is an element of positive even number.then, I i 2 i i {x : x is integer and -i { 2, 0, 2} an infinite collection i for all i} x : i} where i is a
Complement of a set Definition: The complementof a set always refer to sets that are subsets of a particular set U, called universe, universal set or universe of discourse. Thus, if U, the complement of, denoted ', is defined to be the set ' {x U : x }
Example Let be the set of odd numbers. If U is chosen to be the set of naturals, then { 0, 2, 4, 6, }, this is, the set of all even numbers But if U is chosen to be the set of all real numbers, then {x: x real and x 2n+1 for any n natural}
Operational properties: Combining union and intersection 1. 2. ( B C) ( B) ( C) ( B C) ( B) ( C) Illustration of 1. : Let {1, 2, 3}, B {a, b, 2, 3} and C {1, 2, b, c}. Then, (B C) {1, 2,3} ({a,b, 2,3} {1,2, b,c}) {1, 2,3} {a,b,c,1, 2,3} {1, 2,3} ( B) ( C) ({1,2,3} {a,b, 2,3}) ({1,2,3} {1,2, b,c}) {2,3} {1, 2} {1, 2,3}
Properties of complement 1.(')' 2. φ' 3. 4. 5.( 6.( U and U' ' B if B)' B)' φ φ and and only if ' ' B' B' ' B' U ' De Morgan s LWS
Illustration of De Morgan s laws 7}' 5, 3, o,1, e,i, {a, B)' Then,( 9}. 7,8, 6, 5, 4, 3, 2, 0,1, u, o, e,i, {a, with universeu 7} 5, 3, o,1, i, {a,e, B 7}, 3, o, {a, Let 9} 6,8, 4, 2, 0, {u, 6,8,9} 4, 2, 0, {u, 9} 6,8, 4,5, 2, 0,1, u, {e,i, B' ' 9} 6,8, 4, 2, 0, {u,
Summary Notion of set, set descriptions Set equality and its implications Finite sets and infinite sets Subsets, power set Proof strategies with subsets and set equalities Operations with sets: definitions and properties Properties of combined operations
Exercises 1. Describe each of the following sets in terms of a property 1. {1, 5, 9, 13, } 2. B {, -8, -5, -2, 1, 4, 7, } 3. C {1, 2, 5, 10, 17,,82} 2. Write down the power set for each of the following sets 1. pow({a, b}) 2. {a, {a, b}, φ} 3. {φ, {φ}}
Exercises (cont.) 3. Is it true that power( B) power() power(b)? {x : x is integer and x -i or x i}, if i is even 4. Let i < > {x : x is integer and -i < x < i}, if i is odd 1.Find the union of 2. Find the intersection of 3.Find the union of 4. Find the intersection of the collection{ the collection{ the collection{ the collection{ i i :i natural} i :i natural} :i 1, 2, 3, 4, 5} i :i 1,3,5,7}