Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in)

Similar presentations


Presentation on theme: "Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in)"— Presentation transcript:

1 Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in) the set. A set may be itself be an element of some other set. A set can be a set of sets of sets and so on. Sets will be denoted be capital letters A, B, C,... Elements will be denoted by lower case letters a, b, c,.... x, y, z. The phrase “is an element of” will be denoted by the symbol . x  A denotes x is an element of the set A. x  A denotes x is not an element of the set.

2 Properties of Binary Relations Equivalence Relations Compatibility and Partial Ordering Relations Hasse Diagrams Functions Inverse Functions Composition of functions Recursive Functions Lattice and its properties Pigeon hole principle and its application

3 There are five ways to describe a set. 1. Describe a set by describing the properties of the members of the set. 2. Describe a set by listing its elements. 3. Describe a set by its characteristic functions defined as  A (x) = 1, if x  A = 0, if x  A. 4. Describe a set by a recursive formula. 5. Describe a set by an operation (such as union, intersection, complement etc.,) on some other sets.

4 Example: Describe the set containing all the non negative integers less than or equal to 5. Let A denote the set. 1. A = {x | x is a non-negative integer  5} 2. A = {0, 1, 2, 3, 4, 5}. 3.  A (x) = 1 for x = 0, 1, 2, 3, 4, 5 = 0 for x>5 and x<0 (otherwise) 4. A = {x i+1 = x i +1, i = 0, 1, 2, 3, 4 where x 0 = 0} 5. Let B = {0, 2, 4} and C = {1, 3, 5}. A = B  C.

5 Subset: Set A is said to be a subset of set B if every element of set A is an element of B. It is denoted as A  B. (A is contained in B) Ex: 1. If A = {0, 2, 4} and B = {0, 1, 2, 3, 4, 5}, then A  B. 2. If A = {0, 1, 2} and B = {0, 1, 2} then A  B. Proper subset: A is said to be a proper subset of B if A is a subset of B and there is at least one element of B which is not in A. It is denoted as A  B (A is strictly contained in B). Ex: If A = {0, 2, 4} and B = {0, 1, 2, 3, 4, 5}, then A  B. Properties: Let A, B, C be the sets. 1. A  A. 2. If A  B and B  C, then A  C. 3. If A  B and B  C, then A  C. 4. If A  B and A  C, then B  C (B is not contained in C).

6 A  B and B  A if and only if (iff) A and B have the same elements. Two sets A and B are equal iff A  B and B  A. It is denoted as A = B. To show that two sets A and B are equal, we must show that each element of A is also an element of B, and conversely. Empty/Null Set: A set containing no elements is called the empty/null set and is denoted as . Example:  = { } The empty set is a subset of every set. i.e.,   A for every A.

7 Singleton: A set containing a single element is called a Singleton. Operations on Sets. There are three operations on sets namely Complement, Union and Intersection. Complement: Absolute complement: Let U be the universal set and let A be any subset of U. The absolute complement of A, denoted as  ’, is defined as {x | x  A} or {x | x  U and x  A}. Ex: If U = {0, 1, 2, 3, 4, 5} and A = {0, 2, 4} then A ` = {1, 3, 5}.

8 Relative complement: If A and B are sets, the relative complement of A with respect to B isB – A = {x | x  B and x  A}. Ex: If A = {0, 2, 4} and B = {0, 1, 2, 3} then B – A = {1, 3}. It is clear that  ` = U and U ` = . The complement of complement of A is equal to A i.e. (A) `` = A. Ex: If U = {0, 1, 2, 3, 4, 5} and A = {0, 2, 4,} then A ` = {1, 3, 5} and A `` = {0, 2, 4} = A.

9 Union: The union, denoted as , two sets A and B is A  B = {x | x  A or x  B or x  both A and B}. Ex: If A = {0, 3, 6, 9} and B = {0, 2, 4, 6, 8} then A  B = {0, 2, 3, 4, 6, 8, 9}. Intersection: The intersection, denoted as , of two sets A and B is A  B = {x | x  A and x  B}. Ex: If A = {0, 3, 6, 9} and B = {0, 2, 4, 6, 8} then A  B = {0, 6}

10 Basic properties of Union and Intersection: UnionIntersection Idempotent: A  A = A A  A = A Commutative: A  B = B  A A  B = B  A Associative: A  (B  C) = (A  B)  C (A  B)  C = A  (B  C) Prove or Disprove (A  B)  C  A  (B  C). Ex: If A = {0, 1, 2}, B = {1, 3, 4} and C = {2, 4, 6} A  B = {0, 1, 2, 3, 4} L.H.S = (A  B)  C = {2, 4} R.H.S = A  (B  C) = {0, 1, 2, 4}  (A  B)  C  A  (B  C)

11 Difference: The set difference, denoted as -, of two sets A and B is A – B = {x| x  A and x  B}. Ex: Let A = {0, 1, 2, 3} and B = {3, 4, 5}, then A – B = {0, 1, 2}. Symmetrical difference (Boolean sum): The symmetrical difference, denoted as , of two sets A and B is A  B = {x|x  A or x  B, but not both}. Ex: If A = {0, 1, 2, 3} and B = {3, 4, 5} then A  B = {0, 1, 2, 4, 5}. Disjoint sets: Two sets A and B are said to be disjoint if they do not have a member in common. i.e. if A  B =  and A and B are disjoint sets.

12 Power set: The Power set, denoted as p, of the given set A is the family of sets such that x  A, iff x  p(A) i.e., p(A) = {x | x  A}. Ex: Let A = {a, b, c} p(A) = {{ }, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}} Cartesian product: The Cartesian product, denoted as X, of the sets A and B is the set of all ordered pairs (x, y) where x  A and y  B i.e., A X B = {(x, y)|x  A and y  B}. Ex: Let A = {0, 1} and B = {a, b} A X B = {(0, a), (0, b), (1, a), (1, b)} and B X A = {(a, 0), (a, 1), (b, 0), (b, 1)}. An ordered pair in a set is specified by two elements in a prescribed order i.e., (a, b)  (b, a).

13 Distributive and DeMorgan’s Laws Distributive Laws Let A, B and C be three sets. A  (B  C) = (A  B)  (A  C) and A  (B  C) = (A  B)  (A  C) Ex: A = {0, 1, 2}, B = {1, 2, 5} and C = {0, 5, 8} B  C = {0, 1, 2, 5, 8} A  B = {1, 2} A  C = {0} L.H.S= A  (B  C) = {0, 1, 2} R.H.S=(A  B)  (A  C) = {0, 1, 2}  A  (B  C) = (A  B)  (A  C)

14 A = {0, 1, 2}, B = {1, 2, 5} and C = {0, 5, 8} B  C = {5} A  B = {0, 1, 2, 5} A  C = {0, 1, 2, 5, 8} L.H.S= A  (B  C) = {0, 1, 2, 5} R.H.S= (A  B)  (A  C) = {0, 1, 2, 5}  A  B  C) = (A  B)  (A  C)

15 DeMorgan’s Laws: Let A and B be two sets. (A  B) ` = A `  B ` and (A  B) ` = A `  B ` Ex: Let U = {0, 1, 2, 3, 4, 5, 6, 7, 8}, A = {0, 1, 2} and B = {1, 2, 5}. A  B = {0, 1, 2, 5} A ` = {3, 4, 5, 6, 7, 8} B ` = {0, 3, 4, 6, 7, 8} L.H.S = (A  B)` = {3, 4, 6, 7, 8} R.H.S = A`  B` = {3, 4, 6, 7, 8}  (A  B) ` = A `  B `

16 Ex: Let U = {0, 1, 2, 3, 4, 5, 6, 7, 8}, A = {0, 1, 2} and B = {1, 2, 5}. A  B = {1, 2} A` = {3, 4, 5, 6, 7, 8} B` = {0, 3, 4, 6, 7, 8} L.H.S = (A  B)` = {0, 3, 4, 5, 6, 7, 8} R.H.S = A`  B` = {0, 3, 4, 5, 6, 7, 8}  (A  B)` = A`  B`

17 Venn diagrams: Venn diagrams are used to visualize various properties of the set operations. The Universal Set is represented by a large rectangular area. U Subsets are represented by circular areas A

18 Venn diagrams of set operations B

19

20 Properties of Binary Relations Relations Let A and B be nonempty sets. a relation R  A X B and (a, b)  R. a is related to b by R. a R b. Examples: Let A = {1, 2, 3} and B = {r, s}. R = {(1, r), (2, s), (3, r)} is a relation from A to B. Let A = {1, 2, 3, 4, 5}. Define the relation R (less than) on A: a R b if and only if a < b. R = {(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)}.

21 Domain of R Dom(R) Let R  X X Y be a relation from X to Y. Set of elements in X those are related to some element in Y. Subset of X. Set of all first elements in the pairs that make up R. Range of R Ran(R) Set of elements in Y that are related to some element in X. Subset of Y. Set of all second elements in the pairs that make up R. Example: R = {(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)} Dom(R) = {1, 2, 3, 4} Ran(R) = {2, 3, 4, 5}

22 The Digraph of a relation Geometrical representations of relations. Example: Let A = {1, 2, 3, 4} and R = {(1, 1), (1, 2), (2, 1), (2, 2 ), (2, 3), (2, 4), (3, 4), (4, 1)}. The Digraph of R is 13 4 2

23 1.Let A = {1, 2, 3, 4, 5, 6}. Construct pictorial descriptions of the relation R on A for the following: a. R = {(j, k) | j divides k} b. R = {(j, k) | j is a multiple of k} c. R = {(j, k) | (j – k)2  A} d. R = {(j, k) | j/k is a prime} 2. Let R be the relation from A = {1, 2, 3, 4, 5} to B = {1, 3, 5} which is defined by “x is less than y”. Write as a set of ordered pairs. 3. Find the domain and range of the relation R. A = {a, b, c, d}, B = {1, 2, 3}, R = {(a, 1), (a, 2), (b, 1), (c, 2), (d, 1)}.

24 4. Find the domain, range and digraph of the relation R. A = {1, 2, 3, 4, 8} = B; a R b if and only if a + b  9. 5. Find the relation determined by the digraph. 6. Find the relation determined by the digraph. 1 4 2 3 5 5 1 2 3 4

25 Properties of Relations 1.Reflexive A relation R on a set A is reflexive if (a, a)  R for all a  A. a R a for all a  A. Every element a  A is related to itself. Matrix must have all 1’s on its main diagonal. Dom(R) = Ran(R) = A. Example: Let A = {1, 2, 3} and R = {(1, 1), (1, 2), (2, 2), (2,3), (3, 3)}.

26 2.Irreflexive A relation R on a set A is irreflexive if a R a for every a  A. No element is related to itself. Matrix must have all 0’s on its main diagonal. Example: Let A = {1, 2, 3} and R = {(1, 2), (2, 1), (3, 1), (3, 2)}. Example: Let A = {1, 2, 3} and R = {(1, 1), (1, 2), (3, 1), (3, 2)} Neither reflexive nor irreflexive.

27 3.Symmetric A relation R on a set A is symmetric if whenever a R b, then b R a. Example: Let A = {1, 2, 3} and R = {(1, 1), (1, 2), (2, 1), (2, 2), (2, 3), (3, 2)}. 4.Asymmetric A relation R on a set A is asymmetric if whenever a R b, then b R a. Example: Let A = {1, 2, 3} and R = {(1, 1), (1, 2), (2, 2), (3, 2)}.

28 5. Antisymmetric A relation R on a set A is antisymmetric if whenever a R b and b R a, then a = b. Example: Let A = {1, 2, 3} and R = {(1, 1), (2, 2), (3, 3)}. 6. Transitive A relation R on a set A is transitive if whenever a R b and b R c, then a R c. Example: Let A = {1, 2, 3} and R = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}.

29 Exercises: Let A = {1, 2, 3, 4}. Determine whether the relation is reflexive, irreflexive, symmetric, asymmetric, antisymmetric, or transitive. 1. R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (3, 4), (4, 3), (4, 4)} 2. R = {(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)} 3. R = {(1, 3), (1, 1), (3, 1), (1, 2), (3, 3), (4, 4)} 4. R = {(1, 1), (2, 2), (3, 3)} 5. R = A x A 6. R = {(1, 2), (1, 3), (3, 1), (1, 1), (3, 3), (3, 2), (1, 4), (4, 2), (3, 4)} 7. R = {(1, 3), (4, 2), (2, 4), (3, 1), (2, 2)}

30 Equivalence Relations A relation R in a set A is called an equivalence relation if it is reflexive, symmetric, and transitive. If R is an equivalence relation in a set X, then D(R), the domain of R is X itself. Example: Let A = {1, 2, 3, 4} and R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (3, 4), (4, 3), (4, 4)}.

31 Equality of numbers on a set of real numbers. Equality of subsets of a universal set. Similarity of triangles on the set of triangles. Relation of statements being equivalent in the set of statements. Ex 1): Let X = {1,2,3,4} and R = {(1,1),(1,4),(4,1),(4,4),(2,2),2,3),(3,2),(3,3)} Write the matrix of R and sketch its graph. Ex 2): Let X = {1,2,……..,7} and R = {(x, y) I x - y is divisible by 3} Show that R is an equivalence relation.Draw the graph of R.

32 Exercises: Determine whether the relation R on the set A is an equivalence relation. 1) A = {a, b, c, d}, R = {(a, a), (b, a), (b, b), (c, c), (d, d), (d, c)} 2) A = {1, 2, 3, 4, 5}, R = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (3, 1), (2, 3), (3, 3), (4, 4), (3, 2), (5, 5)} 3) A = {1, 2, 3, 4}, R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 1), (3, 3), (1, 3), (4, 1), (4, 4)}

33 Compatibility Relations A relation R in a set X is said to be a compatibility relation if it is Reflexive and Symmetric.  All equivalence relations.  Compatibility relations which are not equivalence relations. Ex: A = {1, 2, 3}, R = {(1, 1), (1, 2), (2, 1), (2, 2), (2, 3), (3, 2), (3, 3)}

34 Ex: Let X={ball, bed, dog, let, egg} R={(x, y) I x,y  X  x R y if x and y contain some common letter} The relation ma

35 Operations on Relations Complement of R (R’) / Complementary relation a R’ b if and only if a R b. (R does not relate) Inverse relation (R -1 ) Relation from B to A (reverse order from R). b R -1 a if and only if a R b. (R -1 ) -1 = R Dom(R -1 ) = Ran(R) Ran(R -1 ) = Dom(R)

36 Example: Let A = {1, 2, 3, 4}, B = {a, b, c} R = {(1, a), (1, b), (2, b), (2, c), (3, b), (4, a)} and S = {(1, b), (2, c), (3, b), (4, b)}. Compute R’, R  S, R  S and R -1. A x B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c), (3, a), (3, b), (3, c), (4, a), (4, b), (4, c)} R’ = {(1, c), (2, a), (3, a), (3, c), (4, b), (4, c)} R  S = {(1, b), (2, c), (3, b)} R  S = {(1, a), (1, b), (2, b), (2, c), (3, b), (4, a), (4, b)} R-1 = {(a, 1), (b, 1), (b, 2), (c, 2), (b, 3), (a, 4)}

37 Composition of R and S (R  S) Let A, B, C are sets, R is a relation from A to B and S is a relation from B to C. R  S is a Relation from A to C. If a is in A and c is in C, then a (R  S) c ((a,c)  (R  S)) if and only if for some b in B, we have a R b and b S c. The relation R  S is R following S. Example: Let A ={1, 2, 3, 4}, R = {(1, 2), (1, 1), (1, 3), (2, 4), (3, 2)}, and S = {(1, 4), (1, 3), (2, 3), (3, 1), (4, 1)}. R  S = {(1, 4), (1, 3), (1, 1), (2, 1), (3, 3)}. Let A, B, and C be sets, R is a relation from A to B, and S is a relation relation from B to C Then (S  R) -1 = R -1  S -1

38 Ex 1): Let R = {(1,2), (3,4),(2,2)} and S = {(4,2),(2,5),(3,1),(1,3)} Find R  S, S  R, R  (S  R), (R  S)  R, R  R, S  S, and R  R  R Ex 2): For the relations R and S given in Ex (1) over the set {1,2,…….,5}, obtain the relation matrices for R  S and S  R

39 a b c A BC RS R0S Composition Of Relations Note: If R is a relation on set A then we can define the following R  R as R 2 (R  R )  R as R 3 So in general, R n is a relation on A defined recursively by i) R 1 =R ii) R n =R  R n-1

40 Distinct relations R 1, R 2,R 3,R 4 in a set X = {a, b, c} given by R 1 = {(a,b),(a,c),(c,b)} R 2 = {(a,b),(b,c),(c,a)} R 3 = {(a,b),(b,c),(c,c)} R 4 = {(a,b),(b, a),(c,c)} Denoting the composition of a relation by itself as R  R = R 2 R  R  R = R  R 2 = R 3 …….. R  R m-1 = R m …………

41 Example: Let A={ 1,2,3,4} B={w, x, y, z} C={5,6,7} and R1 be a relation from A to B defined by R1={(1,x),(2,x),(3,y)(3,z)} R2 and R3 be the relations from B to C defined by R3={(w,5)(x,6)} R4={(w,5),(w,6)} Then find R1  R2, R1  R3 M(R1),M(R2),M(R1  R2) and verify that M(R1  R2) = M(R1).M(R2)

42 Partial Ordering Relation / Partial Order: A relation R on set A is said to be a partial ordering relation or a partial order on A if i) R is Reflexive, ii) R is Antisymmetric and iii) R is Transitive on A. Partially Ordered Set (POSet) Set A with the Partial Order R. Denoted as (A, R).

43 Frequently used Partial Order Relations 1) Less than or equal to / Greater than or equal to Let Z be the Set of integers. Relation  is a partial order on Z. POSet is (Z, ≤). Relation ≥ is a partial order on Z. POSet is (Z, ≥). 2) Inclusion Let A be a collection of subsets of a set S. The relation  of set inclusion is a partial order on A.  (A,  ) is a POSet.

44 3) Divides and Integral Multiple If a and b are positive integers, then we say “a divides b”, written a I b, iff there is an integer c such that ac = b. 4) Lexicographic Ordering simple or total ordering

45 Total Order / Linear Order Let R be a partial order on a set A. R is Total order / Linear order on A, if for all x, y  A, either x R y or y R x. (A, R) Total ordered Set / Linearly ordered set / Chain. Ex: For any x, y  R, x  y or y  x.  (R,  ) is a totally ordered set. Note: Every total order is a partial order, but not every partial order is a total order.

46 Hasse / POSet diagrams 1. Draw the Hasse diagram of the digraph:

47 Since a partial order is reflexive, delete all such cycles from the digraph.

48 Also eliminate all edges that are implied by the transitive property and omit the edge from a to c.

49 Draw the digraph of a partial order with all edges pointing upward, so that arrows may be omitted from the edges. Finally, replace the circles representing the vertices by dots. The resulting diagram of a partial order is the Hasse diagram.

50 Draw the Hasse diagram of the relation R = {(1, 1), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)} on A = {1, 2, 3, 4}.

51

52

53 Let A = {1, 2, 3, 4, 12}. a. Define the relation R by aRb iff a | b. b. Prove that R is a partial order on A. c. Draw the Hasse diagram. a.R = {(a, b) | (a, b)  A and a | b} = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 12), (2, 2), (2, 4), (2, 12), (3, 3), (3, 12), (4, 4), (4, 12), (12, 12)} b. R is Reflexive since (a, a)  R for all a  A. R is Transitive since if (a, b)  R and (b, c)  R, then (a, c)  R. R is antisymmetric since if a | b and b | a, then a = b, for all a, b  A.  R is a partial order on A. c. Hasse Diagram

54 Upper bound of a subset B of A Element a  A, if x R a for all x  B. Lower bound of a subset B of A Element a  A, if a R x for all x  B. Least Upper Bound (LUB) / Supremum (Sup) of a subset B of A Element a  A, if A is an upper bound of B. A’ is an upper bound of B, then a R a’. Greatest Lower Bound (GLB) / Infimum (Inf) of a subset B of A Element a  A, if A is a lower bound of B. A’ is a lower bound of B, then a’ R a.

55 Given A = {1, 2, 3, 4, 5, 6, 7, 8} and B = {3, 4, 5}, Find, if they exist, all upper bounds of B; all lower bounds of B; the least upper bound of B; and the greatest lower bound of B for the poset given in Figure below. Upper bounds6, 7, 8 Lower bounds1, 2, 3 Least Upper Bound No Greatest Lower Bound 3

56 Find, if they exist, all upper bounds of B; all lower bounds of B; the least upper bound of B; and the greatest lower bound of B for the poset given below for B = {c, d, e}. Upper bounds are f, g, h. Lower bounds are a, b, c. LUB (B) = f GLB (B) = c

57 Lattice and its properties Lattice POSet (A, R) Every two-element subset {a, b} of A has a Least Upper Bound (LUB) and Greatest Lower Bound (GLB) in A. LUB {a, b} a  ba join b GLB {a, b}a  b a meet b Examples (Z+, |). (Dn, |), Dn be the Set of all positive divisors of n. D20 = {1, 2, 4, 5, 10, 20} (P(S),  ).

58 Sublattice: Let (L, R) be a lattice and M be a subset of L. Then M is called a sub lattice of L if a  b  M and a  b  M whenever a  M and b  M. Product of Lattices: Consider the lattices (L 1, R) and (L 2, R). Then these are posets. Also, (L 1 X L 2, R) is a poset under the product partial order defined by (a, b) R (a`, b`) if a R a` in L 1 and b R b` in L 2. L 1 X L 2 is called the product of L1 and L2.

59 Special types of Lattices Bounded Lattice: The least and greatest elements of a lattice are called the bounds of the lattice and are denoted by 0 and 1. A lattice which has both elements 0 and 1 is called a bounded lattice. Complete Lattice: A lattice is called complete if each of its nonempty subsets has a least upper bound and a greatest lower bound. Every finite lattice must be complete. Every complete lattice must have a least element and a greatest element.

60 Complement: In a bounded lattice an element b  L is called a complement of an element a  L if a  b = 0 and a  b = 1 Complemented Lattice: A lattice is said to be a complemented lattice if every element of L has at least one complement. Distributive Lattice: A lattice is called a distributive lattice for any a,b,c  L a  (b  c) = (a  b)  (a  c) a  (b  c) = (a  b)  (a  c)

61 Properties of Lattices Let (L, R) be a Lattice. For every a, b, c  L, Idempotent Properties  a  a = a  a  a = a Commutative Properties  a  b = b  a  a  b = b  a Associative Properties  a  (b  c) = (a  b)  c  a  (b  c) = (a  b)  c Absorption Properties  a  (a  b) = a  a  (a  b) = a  a  b = b if and only if a R b.  a  b = a if and only if a R b.  a  b = a if and only if a  b = b.


Download ppt "Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in)"

Similar presentations


Ads by Google