
Order Pair n An Ordered Pair consists of two elements, say a and b, in which one of them, saying a is Relations and Functions designated as the first element and the other as the second element. Peter Lo u The ordered pairs (1,2) and (2,1) are different u The set {1, 2} is not an ordered pair u Ordered pair can have same elements (1,1) CS218 © Peter Lo 2004 1 CS218 © Peter Lo 2004 2 Cartesian Product Notation for Number System n If X and Y are sets, we let X ´ Y denote the set of n Æ denotes Null Set all order pairs (x, y) where x Î X and y Î Y. n Z denotes the set of Integer n We call X ´ Y the Cartesian Productof X and Y. n Q denotes the set of Rational Numbers n If |X| = m, |Y| = n, then |X ´ Y| = mn n Qc denotes the set of Irrational Numbers n If A = {1, 2, 3} and B = {a, b}. n N denotes the set of Natural Numbers The Cartesian Product A ´ B n R denotes the set of Real Numbers = {(1, a), (1, b), (2, a), (2, b), (3, a), (3,b) } CS218 © Peter Lo 2004 3 CS218 © Peter Lo 2004 4 1 Introduction to Relations Domain and Range n A Binary Relation between sets A and B is a n The Domain of a relation R is the set of all first subset of A ´ B. In other word, a binary relation is elements of the ordered pair which belong to R, a collection of ordered pairs from A ´ B. and the Range of R is the set of second elements. n If A and B are equal, this relation is called n A relation is also written as aRb. Relation on the Set A. n Example: n Since relation R is a subset of A ´ B, any relation R has a complementary relation R, which is the u If A = {1, 2, 3}, B = {a, b, c}, and R = {(1, b), complement of the set R relative A ´ B. (1, c), (3, b)}. For this relation 1Rb, 1Rc, 3Rb, n (Do Ex. 1 & 2) domain = {1, 3}, range = {b, c}. CS218 © Peter Lo 2004 5 CS218 © Peter Lo 2004 6 Pictorial Representation of Graphical Representation of Relations Relations n Let R be a relation from A = {1, 2, 3} to B = {a, b} n Directed Graph is a way of picturing a relation when it is where R = {(1, a), (1, b), (3, a)}. The represented form a finite set to itself is to write down the elements of the set and then draw an arrow from an elements x to an as follows: element y whenever x is related to y. n (Do Ex. 3) n (Do Ex. 4 – 7) CS218 © Peter Lo 2004 7 CS218 © Peter Lo 2004 8 2 Matrix Representation of a Properties of Relations Relation n Let A be a set with n elements, and let B be a set with m n Reflexive elements and R be a relation between A and B. n Symmetric u A = {a1, a2, … , an} n Transitive u B = {b1, b2, … , bm} n Matrix M is called the Logical Matrix for R if n Irreflexive n Antisymmetric ì True "(ai ,b j ) Î R ü M (i, j) = í ý îFalse "(ai ,b j ) Ï Rþ n (Do Ex. 8) CS218 © Peter Lo 2004 9 CS218 © Peter Lo 2004 10 Reflexive Symmetric n Let R be a subset of A ´ A. Then R is called a n Let R be a subset of A ´ A. Then R is called a Reflexive Relation if "xÎA, (a, a)ÎR. Symmetric Relation if (a, b)ÎR Þ (b, a)ÎR. n The direct graph of every reflexive relation n The matrix representation for the symmetric includes an arrow from every point to the point relations are symmetric with respect to the main itself. diagonal. CS218 © Peter Lo 2004 11 CS218 © Peter Lo 2004 12 3 Transitive Irreflexive n A relation R in a set A is called a Transitive n A Relation R on a set S is Irreflexive Relation if Relation if ((a, b)ÎR Ç (b, c)ÎR) Þ (a, c)ÎR. x R x, "xÎR. n Example: n Example: u Let W = {a, b, c}, and let u The relation on the set {a, b, c} given by the set R = {(a, b), (c, b), (b, a), (a, c)}. of order pairs {(a, b), (b, c), (c, a)} is irreflexive, because it does not contain any of the ordered u Then R is not a transitive relation because pairs (a, a), (b, b) and (c, c). (c, b) ÎR and (b, a) ÎR but (c, a) Ï R. CS218 © Peter Lo 2004 13 CS218 © Peter Lo 2004 14 Antisymmetric Types of Relations n A Relation R on a set S is Antisymmetric if n Equivalence of Relations "x, yÎS, (xRy Ç yRx) Þ (x = y). n Partially Ordered Relations n Example: n Universal Relations u The relation “Greater than or equal to” on the n Empty Relations set of integer is antisymmetric because if x, y n Inverse Relations ÎZ, then (x ³ y and y £ x) Þ (x = y). n Composite Relations CS218 © Peter Lo 2004 15 CS218 © Peter Lo 2004 16 4 Equivalence Relations Example n A relation is an Equivalence Relation if it is n Provide that the relation = of equality on any set S reflexive, symmetric and transitive and is denoted is an equivalence relation. as ~. u (1) a = a for every a in S; (Reflexive property) u (2) if a = b, then b = a; (Symmetric property) u (3) if a = b and b = c, then a = c. (Transitive property) u Therefore, S is an equivalent relation. CS218 © Peter Lo 2004 17 CS218 © Peter Lo 2004 18 Partially Ordered Relations Example n A Relation on a set is reflexive, antisymmetric and n If a and b are positive integers, a|b means that a is transitive is called Partially Ordered Relation on a divisor of b, i.e. b = ac for some integer c. Show the set. that “|” is a partial ordering of the set of positive integers. CS218 © Peter Lo 2004 19 CS218 © Peter Lo 2004 20 5 Answer Universal and Empty Relations n By definition, the a|b means that the number b/a is an integer. n Universal Relation We need to verify reflexivity, antisymmetry, and transitivity. u Let A be any set, then A ´ A is known as the + u Reflexivity: "nÎZ , n|n as n/n is 1 Universal Relation. u Antisymmetry: If n|m and m|n, then m/n and n/m are both integers. Since n/m = (m/n)-1, the integer n/m has n Empty Relation the property that its reciprocal is also an integer. The u Let A be any set, then Æ is called the Empty only such positive integer is 1, and so n/m = 1, i.e. n = m. Relation. u Transitivity: If n|m and m|p, then p/n = (n/m) x (m/n) is an integer, since it is the product of two other integers. n It follows that “|” is a partial ordering. CS218 © Peter Lo 2004 21 CS218 © Peter Lo 2004 22 Inverse Relations Composite Relations n For every relation R between sets A and B is a n Let R be a relation between sets A and B, and let S be a subset of A ´ B, the Inverse Relation of R is the relation between B and C. The composition of R and S is reverses of the roles of A and B to obtain a the relation between A and C. relation between B and A. n The composite relation of S and R is denoted as S o R, given by S o R = {(x, z) | xÎA, zÎC, $yÎB, xRy Ç ySz} -1 n The inverse Relation of R is denoted as R and the n (Do Ex. 11) relation between B and A given by R-1 = {(y, x) | (x, y) ÎR} n (Do Ex. 9 – 10) CS218 © Peter Lo 2004 23 CS218 © Peter Lo 2004 24 6 Introduction to Functions Elements of a Function n A Function is an association of exactly one object n Functions are often referred to as Mappings or from one set (the range) with each object from Transformations. n The unique element y = f (x) of B assigned to xÎA by f is another set (the domain). called the Image of x under f. n This means that there must be at least one arrow n f: A®B indicate f is a function from A to B. The set A is leaving each point in the domain, and further that called the Domain of f, and set B is called Codomain of f. there can be no more than one arrow leaving each n The range of f denoted by f [A], is the set of all images: point in the domain. f [A] = {f(x) | x ÎA} n The Pre -image or Inverse Image of a set B contained in n (Do Ex. 12) the range of f is denoted by f -1(B) and is the subset of the domain whose members have images in b. CS218 © Peter Lo 2004 25 CS218 © Peter Lo 2004 26 Example Graphing Functions + n The geometric mean function gmean: N x N à R is defined by n gmean(x,y) = Ö(xy) The set of all ordered pairs of the function f u What is the domain ofgmean? plotted in a Cartesian coordinate system is called u Explain why the range ofgmean is different from the codmain the Graph of f.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages12 Page
-
File Size-