Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sets Prof. Richard Beigel Math C067 September 18, 2006 Revised September 20, 2006.

Similar presentations


Presentation on theme: "Sets Prof. Richard Beigel Math C067 September 18, 2006 Revised September 20, 2006."— Presentation transcript:

1 Sets Prof. Richard Beigel Math C067 September 18, 2006 Revised September 20, 2006

2 What is a set? A set is a collection of zero or more objects –These objects are called elements No duplicates Order does not matter

3 Examples {2,3,5,7,11} {(1,1), (2,2), (3,3)} {Apple, Orange, Banana, Peach} {Apple, Dell, IBM} {Heads, Tails} {Win, Lose, Tie} {}

4 No Duplicates {1,1,2,3,5,8} is not a set {1,2,3,5,8} is a set

5 Order does not matter {3,4} = {4,3} {1,2,3,4,5} = {2,3,4,5,1} {1,4,2,5,3} = {1,3,5,2,4} {Apple, Dell, IBM} = {Dell, Apple, IBM}

6 Element-of Notation “x  S” means that x is an element of the set S. 1  {1,2,3} 2  {1,2,3} 3  {1,2,3}

7 Not-an-element-of Notation “x  S” means that x is not an element of the set S. 0  {1,2,3} 4  {1,2,3} 17  {1,2,3}

8 Universal Set (Universe) U contains all possible elements

9 Empty Set {} contains no elements at all {} = the set of 70-year-old Math C067 students {} = the set of 25-year-old U.S. Presidents  is another symbol for the empty set

10 Set Descriptors The set consisting of all objects with some particular property can be denoted –{x : x has that particular property } {x : x is a positive integer less than 4} = {1,2,3} If it is understood that x is an integer we can write {x : 1  x < 4} = {1,2,3}

11 Examples with Letters Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D }

12 Intersection The intersection of two sets A and B consists of all objects that belong to both A and B A  B = {x : x  A and x  B} S  {} = {} (true for every set S) S  U = S (true for every set S)

13 Intersection Examples Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } P  V = { A }

14 Venn Diagram for P  V C D B O U I E A

15 Intersection Examples Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } C  P = { B, C, D }

16 Intersection Examples Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } G  P = { A, B, C, D } = P

17 Union The union of two sets A and B consists of all objects that belong to one or both sets A and B A  B = {x : x  A or x  B} S  {} = S (true for every set S) S  U = U (true for every set S)

18 Union Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } P  V = { A, B, C, D, E, I, O, U }

19 Venn Diagram for P  V C D B O U I E A

20 Union Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } G  P = { A, B, C, D, F }

21 Union Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } V  C = U

22 Disjoint Sets Two sets A and B are disjoint  A and B have no elements in common  A  B = {}

23 Disjointness Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } V and C are disjoint

24 Disjointness Examples { H, P } and { I, B, M } are disjoint

25 Venn Diagram of Disjoint Sets P H B M I

26 Subsets A is a subset of B (written A  B)  Every element of A is an element of B  A  B = A  A  B = B

27 Subset Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } P  G

28 Venn Diagram for P  G C D B F A

29 Subset Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } V  U

30 Subset Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } {}  V

31 Complement The complement of a set S consists of everything (in the universal set) that does not belong to S It is denoted S c S c = {x : x  S} U c = {}, {} c = U (S c ) c = S

32 Complementation Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } V = C c

33 Complementation Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } C = V c

34 Venn Diagram for V c B U E O I H CDF G J P KLM N Q W RST VXYZ A

35 DeMorgan’s Laws (A  B) c = A c  B c (A  B) c = A c  B c

36 Captain Morgan’s Law  =

37 Proof of DeMorgan’s 1 st Law

38 A  B U A B

39 (A  B) c U A B

40 AcAc U A

41 BcBc U B

42 A c  B c U B U A U B

43 Proof of DeMorgan’s 2 nd Law DeMorgan’s 1 st Law says (A  B) c = A c  B c Apply DeMorgan’s 1 st Law to A c and B c (A c  B c ) c = (A c ) c  (B c ) c (A c  B c ) c = A  B Complement both sides of the equation: ((A c  B c ) c ) c = (A  B) c A c  B c = (A  B) c

44 Cardinality (Size) of Sets |S| = n(S) = the number of elements of the set S

45 Cardinality Examples |{2,3,5,7,11}| = 5 |{(1,1), (2,2), (3,3)}| = 3 |{Apple, Orange, Banana, Peach}| = 4 |{Apple, Dell, IBM}| = 3 |{Heads, Tails}| = 2 |{Win, Lose, Tie}| = 3 |{}| = 0

46 Cardinality Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } |U| = 26

47 Cardinality Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } |V| = 5

48 Cardinality Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } |C| = 26-|V| = 26-5 = 21

49 Cardinality Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } |G| = 5

50 Cardinality Examples Let U = { A, B,…, Z } Let V = {x : x is a vowel} = { A, E, I, O, U } Let C = {x : x is not a vowel} = { B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z } Let G = {g : g is a grade} = { A, B, C, D, F } Let P = {g : g is a passing grade} = { A, B, C, D } |P| = 4

51 Cardinality of Union |A  B| =? |A| + |B| Let V = { A, E, I, O, U } 5 Let P = { A, B, C, D } +4 V  P = { A, B, C, D, E, I, O, U }  8

52 Cardinality of Union |A  B| =? |A| + |B| Let V = { A, E, I, O, U } 5 Let P = { A, B, C, D } +4 V  P = { A, B, C, D, E, I, O, U }  8

53 Cardinality of Union |A  B| = |A| + |B|  |A  B| Let V = { A, E, I, O, U } 5 Let P = { A, B, C, D } +4 V  P = { A }  1 V  P = { A, B, C, D, E, I, O, U }=8

54 Cardinality of Disjoint Union If A and B are disjoint sets then |A  B| = |A| + |B| Why? Because A  B = {}, |A  B| = |A| + |B|  |A  B| = |A| + |B|  |{}| = |A| + |B|  0 = |A| + |B|

55 Example If A and B are disjoint sets then |A  B| = |A| + |B| Let H = { H, P } 2 Let I = { I, B, M } +3 H  I = {} H  I = { H, P, I, B, M } =5

56 Difference of Two Sets The difference of two sets A and B consists of everything that belongs to A but does not belong to B. It is denoted A  B It is also denoted A \ B A  B = A  B c

57 Examples of Set Difference Let V = { A, E, I, O, U } Let P = { A, B, C, D } V  P = { E, I, O, U } P  V = { B, C, D }

58 V = (V  P)  (V  P) C D B O U I E A PVPV VPVP VPVP

59 P = (P  V)  (P  V) C D B O U I E A PVPV PVPV VPVP

60 Cardinality of a Set Difference A = (A  B)  (A  B) Because A  B and A  B are disjoint |A| = |A  B| + |A  B| Rearranging, |A|  |A  B| = |A  B| so |A  B| = |A|  |A  B|

61 |V  P| = |V|  |V  P| Let V = { A, E, I, O, U } 5 Let P = { A, B, C, D } V  P = P  V ={ A}  1 V  P = { E, I, O, U }=4 P  V = { B, C, D }

62 |P  V| = |P|  |P  V| Let V = { A, E, I, O, U } Let P = { A, B, C, D } 4 V  P = P  V ={ A}  1 V  P = { E, I, O, U } P  V = { B, C, D } =3

63 (Cartesian) Product of Two Sets A  B = {(a,b) : a  A and b  B} Let A = {egg roll, soup} Let B = {lo mein, chow mein, egg fu yung} A  B = {(egg roll,lo mein), (egg roll, chow mein), (egg roll,egg fu yung), (soup,lo mein), (soup,chow mein), (soup,egg fu yung)}

64 Cardinality of A  B |A  B| = |A|  |B| (the raised dot means multiply) Let A = {egg roll, soup} Let B = {lo mein, chow mein, egg fu yung} |A  B| = |A|  |B| = 2  3 = 6

65 Another Example Let A = {1,2,3,4} Let B = {a,b,c} A  B = {(1,a), (2,a), (3,a), (4,a), (1,b), (2,b), (3,b), (4,b), (1,c), (2,c), (3,c), (4,c)} = {(1,a), (2,a), (3,a), (4,a), (1,b), (2,b), (3,b), (4,b), (1,c), (2,c), (3,c), (4,c)} 4  3 rectangle contains 4  3 points

66 Longer Products A  B  C = (A  B)  C = A  (B  C) = {(a,b,c) : a  A and b  B and c  C} |A  B  C| = |A|  |B|  |C| A 2 = A  A A 3 = A  A  A, etc. |A k |= |A| k

67 Examples Let A = {Heads,Tails} A 2 = {(Heads,Heads), (Heads,Tails) (Tails,Heads), (Tails, Tails)} A 3 = {(Heads,Heads,Heads),(Heads,Heads,Tails), (Heads,Tails,Heads),(Heads,Tails,Tails), (Tails,Heads,Heads),(Tails,Heads,Tails), (Tails,Tails,Heads),(Tails,Tails,Tails)}

68 Examples Let A = {Heads,Tails} |A| = 2 |A 2 | = |A| 2 = 2 2 = 4 |A 3 | = |A| 3 = 2 3 = 8 |A 4 | = |A| 4 = 2 4 = 16

69 Application 1 Yong’s Chinese restaurant offers 3 entrees –lo mein, chow mein, and egg fu yung each of which can be prepared with –chicken, beef, pork, shrimp, or no meat Yong’s menu includes 2 desserts: –ice cream or lychee nuts

70 Application 1 (continued) Let M = {chicken,beef,pork,shrimp,plain} Let E = {lo mein, chow mein, egg fu yung} A dinner order without dessert can be represented as an ordered pair (m,e) where m  M and e  E. The set of all such dinner orders is M  E = {(m,e) : m  M and e  E} The number of possible dinner orders is |M  E| = |M|  |E| = 5  3 = 15.

71 Application 1 (continued) Let M = {chicken,beef,pork,shrimp,plain} Let E = {lo mein, chow mein, egg fu yung} Let D = {ice cream, lychee nuts} A dinner order including dessert can be represented as an ordered triple (m,e,d) where m  M, e  E, and d  D. The set of all such dinner orders is M  E  D = {(m,e,d) : m  M and e  E and d  E} |M  E  D | = |M|  |E|  |D| = 5  3  2 = 30

72 Application 2 The set of possible outcomes for a single coin flip is {H,T}, where H stands for heads and T stands for tails. We represent the results of several coin flips as an ordered tuple. The set of possible outcomes when one coin is flipped 10 times or when 10 distinguishable coins are flipped is {H,T} 10. The number of possible outcomes is |{H,T} 10 | = |{H,T}| 10 = 2 10 = 1024


Download ppt "Sets Prof. Richard Beigel Math C067 September 18, 2006 Revised September 20, 2006."

Similar presentations


Ads by Google