Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Mathematics CS 2610

Similar presentations


Presentation on theme: "Discrete Mathematics CS 2610"— Presentation transcript:

1 Discrete Mathematics CS 2610
January 27, 2009

2 Agenda Set Theory Set Builder Notation Universal Set
Power Set and Cardinality Set Operations Set Identities Cartesian Product

3 Sets A set is an unordered collection of objects. Examples:
{ 1, 6, 7, 2, 9 } { a, d, e, 1, 2, 3} Order and repetition don’t matter = {6, 7, 1, 2, 9} = {a, a, d, d, e, e, 1, 2, 3} The empty set, or the set containing no elements.  = {} Note:   {} Singleton is a set S that contains exactly one element

4 Universal Set Universal Set is the set containing all the objects under consideration. It is denoted by U

5 Set Builder Notation concise definition of a set
Set Builder – characterize the elements in a set by stating the properties that the elements must have to belong to the set. { x | P (x) } reads x that satisfy P(x), x such that P(x) x belongs to a universal set U. concise definition of a set Examples: P = { x | x is prime number} U : Z+ M = { x | x is a mammal} U: All animals Q+ = { x  R | x = p/q, for some positive integers p, q }

6 Elements of sets x  S means “x is an element of set S”
x  S means “x is not an element of set S Example: 3  S reads: “3 is an element of the set S ”. Which of the following is true: 3  R -3  N

7 Subsets A  B means “A is a subset of B” or, “B contains A”
“every element of A is also in B” or, x ((x  A)  (x  B)) A  B means “A is a subset of B” B  A means “B is a superset of A”

8 Subsets A  B means “A is a subset of B” For Every Set S,
i)   S, the empty set is a subset of every set ii) S  S, every set is a subset of itself

9 Proper Subsets iff, A  B and A  B
A subset A of B is said to be a proper subset if A is not equal to B. iff, A  B and A  B iff, A  B and there is an x  B but x  A. x ((x  A)  (x  B))  x ((x  B)  (x  A)) This is sometimes written A  B.

10 Set Equality A = B if and only if A and B have exactly the same elements. iff, A  B and B  A iff, A  B and A  B iff, x ((x  A)  (x  B)). To show equality of sets A and B, must prove both: A  B B  A

11 Set Cardinality The cardinality of a set is the number of distinct elements in the set. |S | denotes the cardinality of S. S = {1,2,3} |S| = 3 S = {5,5,5,5,5,5} |S| = 1 S =  |S| = 0 S = { , {}, {,{}} } |S| = 3 A set S is said to be finite if its cardinality is a nonnegative integer. Otherwise, S is said to be infinite. Given N = {0,1,2,3,…}, |N| is infinite (natural nos.)

12 Power Sets The power set of S is the set of all subsets of S.
P(S) = { x | x  S } If S = {a}, P(S) = ? {, {a}} If S = {a,b}, P(S) = ? {, {a}, {b}, {a, b}} If S = , P(S)= ? {} Fact: if S is finite, |P(S)| = 2|S|.

13 n-Tuples An ordered n-tuple, n  Z+, is an ordered list
(a1, a2, …, an). Its first element is a1. Its second element is a2, etc. Enclosed between parentheses (list not set). Order and length matters: (1, 2)  (2, 1)  (2, 1, 1).

14 Cartesian Product The Cartesian Product of two sets A and B is:
A x B = { (a, b) | a  A  b  B} Example: A= {a, b}, B= {1, 2} A  B = {(a,1), (a,2), (b,1), (b,2)} B  A = {(1,a), (1,b), (2,a), (2,b)} Not commutative! In general, A1 x A2 x … x An = {(a1, a2,…, an) | a1  A1, a2  A2, …, an  An} |A1 x A2 x … x An| = |A1| x |A2| x … x |An|

15 Union Operator The union of two sets A and B is:
A  B = { x | x  A v x  B } Example: A = {1,2,3}, B = {1,6} A  B = {1,2,3,6}

16 Intersection Operator
The intersection of two sets A and B is: A  B = { x | x  A  x  B} Example: A = {1,2,3}, B = {1,6} A  B = {1} Two sets A, B are called disjoint iff their intersection is empty. A  B =  A = {1,2,3}, B = {9,10}, C = {2, 9} A and B are disjoint sets, but A and C are not

17 Set Theory : Inclusion/Exclusion
What is the cardinality of A  B ? twice A B AB Once |AB| = |A| + |B| - |A  B|

18 Set Complement The complement of a set A is: A = { x | x  A} Example:
U = N A = {xN | x is odd } A = {xN | x is even } x  A  x  A  = U U = 

19 Set Difference The set difference, A - B, is:
A - B = { x | x  A  x  B } Example: A = {2,3,4,5 }, B = {3,4,7,9 } A- B = {2, 5} B – A = {7,9} It is not commutative!!


Download ppt "Discrete Mathematics CS 2610"

Similar presentations


Ads by Google