sets
play

Sets Reading: EC 3.1-3.3 Peter J. Haas INFO 150 Fall Semester - PowerPoint PPT Presentation

Sets Reading: EC 3.1-3.3 Peter J. Haas INFO 150 Fall Semester 2019 Lecture 11 1/ 21 Sets Definitions Defining Sets Set Operations The Inclusion-Exclusion Principle Cartesian Products The Power Set Lecture 11 2/ 21 Some Common Sets


  1. Sets Reading: EC 3.1-3.3 Peter J. Haas INFO 150 Fall Semester 2019 Lecture 11 1/ 21

  2. Sets Definitions Defining Sets Set Operations The Inclusion-Exclusion Principle Cartesian Products The Power Set Lecture 11 2/ 21

  3. Some Common Sets Loose definition: A set is a collection of objects (called members or elements) I This loose general definition can lead to paradoxes (e.g., Russell’s Paradox) I To stay out of trouble, we will work with a small number of well-understood sets Basic Sets I N = { 0 , 1 , 2 , 3 , . . . } : The set of natural numbers I Z = { . . . , � 3 , � 2 , � 1 , 0 , 1 , 2 , 3 , . . . } : The set of integers I Q : The set of rational numbers, e.g., ratios of integers such as 2 3 , 3 1 , � 17 4 I R : The set of real numbers, i.e., decimal numbers with possibly infinite strings of digits after the decimal point Variations on Basic Sets I R + : The set of positive real numbers I R � 0 : The set of nonnegative real numbers I Q + : The set of positive rationals I Q � 0 : The set of nonnegative rationals I Z + : The set of positive integers I Z � 0 : The same as N Lecture 11 3/ 21

  4. Subsets Definitions for Subsets I x 2 A : The element x is a member of the set A I A ✓ B : A is a subset of B , i.e., every element in A is also in B I A = B : Set A and B contain exactly the same elements 13 I ; : The empty set, i.e., the set that contains no elements I U : For any given discussion, all sets will be subsets of a larger set called the universal set or the universe Some Formal Definitions I A ✓ B : 8 x 2 U , ( x 2 A ) ! ( x 2 B ) I A = B : A ✓ B and B ✓ A True or False? (If false, give a counterexample) - 3) L I Z ✓ N false I N ✓ Z True I 3G ) } False I Q ✓ Z 3 e I Z ✓ Q True Ira ) False I R ✓ Q I Q ✓ R True Lecture 11 4/ 21

  5. √ Digression: 2 is Irrational Theorem p 2 is irrational Proof by Contradiction: ( reduced form ) 1. Suppose the theorem is false p 2 = a 2. Then we can write b where a and b are relatively prime 3. So 2 = a 2 b 2 , or a 2 = 2 b 2 G 4. Therefore a 2 is even, which implies that a is even (see end of Lecture 7) 5. Therefore a = 2 k for some integer k 6. So a 2 = 4 k 2 = 2 b 2 and hence b 2 = 2 k 2 7. Therefore b 2 is even, so that b is even 8. Thus a and b are both even 9. This contradicts the assumption that a and b are relatively prime 10. Since assuming that the theorem is false leads to a contradiction, the theorem must be true. Lecture 11 5/ 21

  6. " " duplicates contain bag More Examples a set considers ← 1. { 1 , 2 , 3 , 4 , 5 } = { 4 , 2 , 3 , 1 , 5 } = { 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , 5 , 5 , 5 , 5 } elements only unique 2. { 2 , 4 } ✓ { 1 , 2 , 3 , 4 , 5 } is true 3. { 1 , 2 , 3 , 4 , 5 } ✓ { 2 , 4 } is false I E.g., 1 is a counterexample to “if x 2 { 1 , 2 , 3 , 4 , 5 } , then x 2 { 2 , 4 } ” 4. ; ✓ { 1 , 2 , 3 , 4 , 5 } is true I There is no counterexample to “if x 2 ; , then x 2 { 1 , 2 , 3 } ” I The empty set is a subset of every set 5. { John , Sue , Chen , Shankar } is a set containing 4 names I U = the set of all first names of people 6. { (1 , 3) , (2 , 5) , (3 , 7) } is a set of ordered pairs 7. {{ 3 , 4 } , { 5 , 6 , 7 }} is a set of sets Lecture 11 6/ 21

  7. Set-Builder Notation Even natural numbers I { x : x 2 N and x is even } or I { x 2 N : x is even } or I { x 2 N : x = 2 k for some k 2 N } (a property description) I { 2 k : k 2 N } (a form description) closed interval Intervals intervals ° interval I { x 2 R : � 2 . 1  x  2 . 6 } or [ � 2 . 1 , 2 . 6] . open I { x 2 R : � 2 . 1 < x < 2 . 6 } or ( � 2 . 1 , 2 . 6) closed } semi I { x 2 R : � 2 . 1 < x  2 . 6 } or ( � 2 . 1 , 2 . 6] I { x 2 R : � 2 . 1  x < 2 . 6 } or [ � 2 . 1 , 2 . 6) I { x 2 N : 3  x < 6 } or [3 , 6) = { 3 , 4 , 5 } Form description prime } Other examples: give an alternate description bane . b a I { n 2 N : n has exactly two positive divisors } Sa : , ¢ I { x 2 R : x 2 + 1 = 0 } Lecture 11 7/ 21

  8. Examples of Form Notation 0,3 6 1. The set of integers that are multiples of 3: { 3 k : k 2 Z } - u - , , 2. The set of perfect square integers: { m 2 : m 2 N } or { m 2 : m 2 Z } , 4,9 , O I - v . , 3. The set of natural numbers that end in a 1: { 10 k + 1 : k 2 N } 41121 - , - 4. The set Q : { a b : a 2 Z and b 2 Z + } Lecture 11 8/ 21

  9. Operations on Sets Operations on Sets A and B 1. Intersection A \ B : A \ B = { x 2 U : x 2 A and x 2 B } 2. Union A [ B : A [ B = { x 2 U : x 2 A or x 2 B } 3. Di ff erence A � B : A � B = { x 2 U : x 2 A and x 62 B } 4. Complement A 0 : A 0 = { x 2 U : x 62 A } or A 0 = U � A Definition Set A and B are disjoint if A \ B = ; . Example: Suppose U = { 1 , 2 , . . . , 12 } , A = { 1 , 2 , 3 , 4 , 5 } , B = { 2 , 4 , 6 , 8 , 10 } I A 0 = , 14 { 6,7 , . . . I A \ B = 5443 , 8,10 ) , 3,6 { I I A [ B = , 43,4 , 3,53 I I I A � B = , 8,10 } I B � A = I 6 to I A \ { 8 , 10 , 12 } = 0 I U 0 = Lecture 11 9/ 21

  10. to BHT for Sets logic Relation → false of close v U → true n u n → → Theorem For sets A , B , and C , the empty set ; , and the universal set U , the following properties hold: (a) Commutative A \ B = B \ A A [ B = B [ A (b) Associative ( A \ B ) \ C = A \ ( B \ C ) ( A [ B ) [ C = A [ ( B [ C ) (c) Distributive A \ ( B [ C ) = ( A \ B ) [ ( A \ C ) A [ ( B \ C ) = ( A [ B ) \ ( A [ C ) (d) Identity A \ U = A A [ ; = A A [ A 0 = U A \ A 0 = ; (e) Negation ( A 0 ) 0 = A (f) Double negative (g) Idempotent A \ A = A A [ A = A ( A \ B ) 0 = A 0 [ B 0 ( A [ B ) 0 = A 0 \ B 0 (h) DeMorgan’s laws (i) Universal bound A [ U = U A \ ; = ; (j) Absorption A \ ( A [ B ) = A A [ ( A \ B ) = A U 0 = ; ; 0 = U (k) Complements A � B = A \ B 0 (l) Compl. & neg. ¢ Duality principle u : s → n u u u → of → n Lecture 11 10/ 21

  11. Verification via Venn Diagrams U A B 3 Example: U = { 1 , 2 , . . . , 15 , 16 } , A = { 1 , 2 , 5 , 7 , 9 , 11 , 13 , 15 } , 5 7 11 15 2 B = { 2 , 3 , 5 , 7 , 11 , 13 } , C = { 1 , 4 , 9 , 16 } 13 9 1 6 16 4 10 12 C 8 Example: Show that A \ ( B [ C ) = ( A \ B ) [ ( A \ C ) 14 A B A B Also: A \ ( B [ C ) ✓ B [ C C C U U A B A B A B C C C U U U Lecture 11 11/ 21

  12. → HEB ) Elementwise Proofs 1 e A) tlxeu :@ Definition Example 1: Prove that A ∩ B ⊆ A 1. Let x ∈ A ∩ B 2. Then x ∈ A and x ∈ B 3. In particular, x ∈ A 4. So ( x ∈ A ∩ B ) → ( x ∈ A ), and hence A ∩ B ⊆ A Lecture 11 12/ 21

  13. An LB uld ) thou Elementwise Proofs 2 , # formal Version : ) get B) YAK ) → Example 2: Prove that A ∩ ( B ∪ C ) ⊆ ( A ∩ B ) ∪ ( A ∩ C ) 1. Let x ∈ A ∩ ( B ∪ C ) 2. Then x ∈ A and x ∈ B ∪ C 3. Case 1: x ∈ B 3.1 Then x ∈ A ∩ B since x ∈ A and x ∈ B 3.2 Hence in ( A ∩ B ) ∪ ( A ∩ C ) by argument similar to Example 1 4. Case 2: x ∈ C 4.1 Then x ∈ A ∩ C 4.2 Hence in ( A ∩ B ) ∪ ( A ∩ C ) by argument similar to Example 1 5. In either case, x ∈ A ∩ ( B ∪ C ) implies that x ∈ ( A ∩ B ) ∪ ( A ∩ C ) I Lecture 11 13/ 21

  14. Elementwise Proofs 3 Example 3: Prove that A ∩ ( B ∪ C ) = ( A ∩ B ) ∪ ( A ∩ C ) I By above result, it su ffi ces to show that ( A ∩ B ) ∪ ( A ∩ C ) ⊆ A ∩ ( B ∪ C ) not @ Let CAN B) U x a that NEA hence HEA i. show and exo B xe A then An B I :X a hence HEA case . ' and xeA C Anc Then Case 2 : exe . ' both XEA cases in so . Show that XO BVC a . XEB BUC An hence Xe > B case I xe : , GC hence X Arc Xo Laser : L BUD , 46 An Bvc hence X EA and XE 3 , - Lecture 11 14/ 21

  15. Elementwise Proofs 4 Example 4: Prove that ( A ⊆ B ) ∧ ( B ⊆ C ) → ( A ⊆ C ) 1. Let x ∈ A 2. Then x ∈ B since A ⊆ B 3. Hence x ∈ C since B ⊆ C 4. So ( x ∈ A ) → ( x ∈ C ), and hence A ⊆ C Lecture 11 15/ 21

  16. The Inclusion-Exclusion Principle A B Definition C n ( A ) = the number of elements in the set A U Example I A = { 2 k : k 2 Z + and k  15 } and B = { 3 k : k 2 Z + and k  10 } F 3 I n ( A ) = n ( B ) = } 2,416,410,13143^936,9 ) I A \ B = U - 163 A Any B I I n ( A \ B ) = - since 2 4 3 6 8 14 18 9 I 2,346,8 , 9,1914143 10 12 I A [ B = 16 15 24 30 20 22 21 71-3 26 28 27 I n ( A [ B ) = I - Theorem (The Inclusion-Exclusion Principle) Let sets A , B , and C be given. Then I n ( A [ B ) = n ( A ) + n ( B ) � n ( A \ B ) I n ( A [ B [ C ) = n ( A )+ n ( B )+ n ( C ) � n ( A \ B ) � n ( A \ C ) � n ( B \ C )+ n ( A \ B \ C ) n ( A ) + n ( B ) + n ( C ) = n 1 + n 2 + n 3 + 2 n 4 + 2 n 5 + 2 n 6 + 3 n 7 Lecture 11 16/ 21

  17. Cartesian Products Ordered pairs: Definition The Cartesian product A ⇥ B of sets A and B is defined as { ( a , b ) : a 2 A and b 2 B } . When both coordinates are taken from the same set A , we write A 2 instead of A ⇥ A . Example: For second graph, the set of plotted points are { ( x , y ) 2 R 2 : y = 3 x � 1 } Example: Succinctly describe the sequence a 1 = 2 , a 2 = 4 , a 3 = 8 , . . . using ordered scn.sn ) I pairs (1 , 2) , (2 , 4) , (3 , 8), etc.: nett : Example: Describe all possible (sandwich, drink) orders where sandwiches are of type Gbh ,3)xSA,B,4D3 1, 2, or 3 and drinks are A , B , C , or D : 49,13A } . - Example: Describe all possible pairs (type of A, type of B) of people you might teller }t=E4TlxE4T3 :{ encounter on the island of Liars and Truthtellers: ( 417USD Truth Liar , , Lecture 11 17/ 21

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend