Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 3 Relation and Function Homework 4 For each of the following relations on set A = { 1,2,3,4 }, check each of them whether they are reflexive, irreflexive,

Similar presentations


Presentation on theme: "Chapter 3 Relation and Function Homework 4 For each of the following relations on set A = { 1,2,3,4 }, check each of them whether they are reflexive, irreflexive,"— Presentation transcript:

1

2 Chapter 3 Relation and Function Homework 4 For each of the following relations on set A = { 1,2,3,4 }, check each of them whether they are reflexive, irreflexive, transitive, symmetric, and/or anti-symmetric: R = { (2,2),(2,3),(2,4),(3,2),(3,3),(3,4) } S = { (1,1),(1,2),(2,1),(2,2),(3,3),(4,4) } T = { (1,2),(2,3),(3,4) } Represent the relation R, S, and T using matrices and digraphs.

3 Solution to Homework 4 Given A = { 1,2,3,4 }, then:
Chapter 3 Relation and Function Solution to Homework 4 Given A = { 1,2,3,4 }, then: R = { (2,2),(2,3),(2,4),(3,2),(3,3),(3,4) } Not reflexive, because (1,1) and (4,4) are not members of R Not irreflexive, because (2,2) and (3,3) are members of R Transitive, proven by (2,2) (2,3) (2,3) (2,2) (2,4) (2,4) (2,3) (3,2) (2,2) (2,3) (3,3) (2,3) (2,3) (3,4) (2,4) (3,2) (2,2) (3,2) a.s.o. Not symmetric, because {(4,2),(4,3)}  R. Not anti symmetric, because there exists (2,3) and (3,2) as members of R, while 2  3.

4 Solution to Homework 4 Given A = { 1,2,3,4 }, then:
Chapter 3 Relation and Function Solution to Homework 4 Given A = { 1,2,3,4 }, then: S = {(1,1),(1,2),(2,1),(2,2),(3,3),(4,4)} is Reflexive, because (a,a) is a member of R for each a  A Automatically not irreflexive, Transitive, proven by (1,1) (1,2) (1,2) (1,2) (2,2) (1,2) Symmetric, because if (a,b)  S then (b,a)  S, too Not anti symmetric, because there exists (1,2) and (2,1) as members of R while 1  2

5 Solution to Homework 4 Given A = { 1,2,3,4 }, then:
Chapter 3 Relation and Function Solution to Homework 4 Given A = { 1,2,3,4 }, then: T = {(1,2),(2,3),(3,4)} is Not reflexive, because {(1,1),(2,2),(3,3),(4,4)}  R Irreflexive, because there is no (a,a)  R for any a  A Not transitive, because (1,3) and (2,4) are not members of R Not symmetric, because (2,1), (3,2), and (4,3)  R Anti symmetric, because the definition of the property is not violated

6 Solution to Homework 4 Representation in matrices and digraphs:
Chapter 3 Relation and Function Solution to Homework 4 Representation in matrices and digraphs: R = { (2,2),(2,3),(2,4),(3,2),(3,3),(3,4) } S = { (1,1),(1,2),(2,1),(2,2),(3,3),(4,4) } T = { (1,2),(2,3),(3,4) } T R S

7 Chapter 3 Relation and Function Inverse of Relations If R is a relation from set A to set B, then the inverse of relation R, denoted with R–1, is the relation from set B to set A defined by: R–1 = { (b,a) | (a,b)  R }. Example: Suppose P = { 2,3,4 } Q = { 2,4,8,9,15 }. If the relation R from P to Q is defined by: (p,q)  R if p divides q without remainder, then the members of the relation can be obtained as: R = { (2,2),(2,4),(2,8),(3,9),(3,15),(4,4),(4,8) }. R–1, the inverse of R, is a relation from Q to P with: (q,p)  R–1 if q is a multiplication of p. It can be obtained that: R–1 = { (2,2),(4,2),(8,2),(9,3),(15,3),(4,4),(8,4) }.

8 Chapter 3 Relation and Function Combining Relations A binary relation is composed of a set of relation pairs. Thus, set operations such as intersection, union, difference, and symmetric difference between two relations or more are also applicable on binary relations. If both R1 and R2 are relations from set A to set B, then R1  R2, R1  R2, R1 – R2, and R1  R2 are also relations from set A to set B.

9 Chapter 3 Relation and Function Combining Relations Example: Given the sets A = {a,b,c} and B = {a,b,c,d}, Relation R1 = {(a,a),(b,b),(c,c)}, Relation R2 = {(a,a),(a,b),(a,c),(a,d)}, then R1  R2 = {(a,a)} R1  R2 = {(a,a),(b,b),(c,c),(a,b),(a,c),(a,d)} R1  R2 = {(b,b),(c,c)} R2  R1 = {(a,b),(a,c),(a,d)} R1  R2 = {(b,b),(c,c),(a,b),(a,c),(a,d)}.

10 Composition of Relations
Chapter 3 Relation and Function Composition of Relations Suppose R is a relation from set A to set B, and S is a relation from set B to set C, then composition of relations R and S, denoted with S ○ R, is a relation from set A to set C that is defined by: S ○ R = {(a,c)a  A, c  C, and for some b  B, (a, b)  R and (b, c)  S. Example: Given that R = { (1,2),(1,6),(2,4),(3,4),(3,6),(3,8) } is a relation from set {1,2,3} to set {2,4,6,8}; and S = { (2,u),(4,s),(4,t),(6,t),(8,u) } is a relation from set {2,4,6,8} to set {s,t,u}. then the composition of relations R and S is S ○ R = { (1,u),(1,t),(2,s),(2,t),(3,s),(3,t),(3,u) }.

11 Composition of Relations
Chapter 3 Relation and Function Composition of Relations Composition of relations R and S can also be represented by using an arrow diagram: R = { (1,2),(1,6),(2,4),(3,4),(3,6),(3,8) } S = { (2,u),(4,s),(4,t),(6,t),(8,u) } S ○ R = { (1,u),(1,t),(2,s),(2,t),(3,s),(3,t),(3,u) }

12 Chapter 3 Relation and Function Functions Suppose A and B are sets, then a binary relation f from A to B is called a function if every member in A is related with exactly one member in B. The notation of a function is written as f : A  B. Pronounced: “f maps or associates A to B.” A is called domain of f and B is called co-domain of f. Other terms for “function” are mapping and transformation. We write f(a) = b if the function maps or associates a  A with b  B.

13 Chapter 3 Relation and Function Functions If f(a) = b, then b is called the image of a and a is called the pre-image of b. A set that contains all mapping values of f is called the co-domain of f. Note that the range of f is an improper subset of the co-domain B. f maps A to B A B f Co-domain Domain f(4.3) 4.3 4 4.3 is the pre-image of 4 4 is the image of 4.3

14 Functions A function is a relation with special properties:
Chapter 3 Relation and Function Functions A function is a relation with special properties: Every member of set A must be utilized/employed by the procedure or rule that defines the function. The sentence “every member in A is related with exactly one member in B” has the meaning that if (a,b)  f and (a,c)  f, then b = c. Or in other words, if b = f(a) and c = f(a), then b = c.

15 Chapter 3 Relation and Function Functions Example: Suppose A = {1,2,3} and B = {u,v,w}, then the following relations: f = {(1,u),(2,v),(3,w)} is a function from A to B. Here, f(1) = u, f(2) = v, and f(3) = w. The domain of f is A and the co-domain of f is B. The range of f are {u,v,w}, which in this case is equivalent to set B. f = {(1,u),(2,u),(3,v)} is a function from A to B, although u becomes the image of two members of A. The domain of f is A and the co-domain of f is B. But, the range of f is {u,v} only, a subset of B.

16 Chapter 3 Relation and Function Functions Example: Suppose A = {1,2,3} and B = {u,v,w}, then the following relations: f = {(1,u),(2,v)} is not a function from A to B, because not all members of A is associated to any members of B. f = {(1,u),(1,v),(2,v),(3,w)} is not a function from A to B, because 1 is mapped to two members of B, which are u and v.

17 Chapter 3 Relation and Function Injective Function The function f that maps elements of A to elements of B is called an injective function if all members of A have distinct image in B. In other words, if f(x) = f(y) then x = y for all x and y in the domain of f. Injective function is also called one-to-one function.

18 Chapter 3 Relation and Function Injective Function Example: Suppose A = {1,2,3} and B = {u,v,w,x}, then the following relations: f = {(1,w),(2,u),(3,v)} is an injective function. All members of A have distinct image on B. f = {(1,u),(2,u),(3,v)} is not an injective function because f(1) = f(2) = u. Example: Let g: Z  Z, where g(x) = 2x–1. Is g injective? Example: Let h: Z  Z, where h(x) = x2 + 8x – 6. Is h injective?

19 Chapter 3 Relation and Function Surjective Function The function f that maps elements of A to elements of B is called a surjective function if every member B is the image of one or more members of A. In other words, all members of B become the range of f. The function f is called “the function on B.” Surjective function is also called on-to function.

20 Chapter 3 Relation and Function Surjective Function Example: Suppose A = {1,2,3} and B = {u,v,w}, then the following relations: f = {(1,u),(2,u),(3,v)} is not a surjective function because w is not included in the range of f. f = {(1,w),(2,u),(3,v)} is a surjective function because all members of B are included in the range of f. Example: For A = {0,1,2,3,…,9} and B = {0,1,2}, determine whether h: A  B, with h(x) = x mod 3 is a surjective function or not. (Hint: mod give the remainder after division. 24 mod 3 = 0, 18 mod 5 = 3).

21 Chapter 3 Relation and Function Bijective Function The function f that maps elements of A to elements of B is called a one-to-one correspondence or bijective if f is an injective function and a surjective function, simultaneously. Example: Suppose A = {1,2,3} and B = {u,v,w}, then the relation f = {(1,w),(2,u),(3,v)} is a bijective function, because f is an injective and also surjective function at the same time.

22 Exercise Injective, not surjective Not injective, surjective
Chapter 3 Relation and Function Exercise Injective, not surjective Not injective, surjective Not injective, not surjective Not a function

23 Exercise Example: Let g: Z  Z, where g(x) = 2x. Is g bijective?
Chapter 3 Relation and Function Exercise Example: Let g: Z  Z, where g(x) = 2x. Is g bijective? Example: Create a bijective function with domain and range of integers, f: Z  Z.

24 Chapter 3 Relation and Function Inverse of a Function Inverse of a function f that maps elements of A to elements of B can be obtained if and only if f bijective, that is there is a one-to-one correspondence from A to B. Inverse of function f is denoted by f –1, which is a bijective function from B to A. Suppose a  A and b  B, if f(a) = b then f –1(b) = a. A one-to-one correspondence is also called an invertible function, because its inverse can be defined. A function is said to be not invertible if it is not a bijective function. In this case, the inverse does not exist.

25 Chapter 3 Relation and Function Inverse of a Function Example: Suppose A = {1,2,3} and B = {u,v,w}, then the following relations: f = {(1,u),(2,u),(3,v)} is not a one-to-one correspondence. f –1= {(u,1),(u,2),(v,3)} is not a function at all  the inverse cannot be defined. f = {(1,w),(2,u),(3,v)} is a one-to-one correspondence. f –1= {(w,1),(u,2),(v,3)} is a function  the inverse can be defined  f is an invertible function

26 Composition of Functions
Chapter 3 Relation and Function Composition of Functions Suppose f is a function that builds a map from set A to set B, and likewise g from set B to set C. The composition of f and g, denoted as g ○ f, is function from A to C that is defined by: (g ○ f)(a) = g(f(a)) Example: Given function f = {(1,u),(2,u),(3,v)} that builds a map from A = {1,2,3} to B = {u,v,w}, and function g = {(u,y),(v,x),(w,z)} that builds a map from B = {u,v,w} to C = {x,y,z}. Then the composition of A to C is: g ○ f = {(1, y), (2, y), (3, x)}

27 Composition of Functions
Chapter 3 Relation and Function Composition of Functions Example: Suppose that the functions are f(x) = x – 1 and g(x) = x Determine f ○ g and g ○ f. Solution: (f○g)(x) = f(g(x)) = f(x2 + 1) = (x2 + 1) – 1 = x2 (g○f)(x) = g(f(x)) = g(x – 1) = (x –1)2 + 1 = x2 – 2x + 2

28 Several Special Functions
Chapter 3 Relation and Function Several Special Functions Floor Function and Ceiling Function Suppose x is a real number, whose value is between two integers. floor of x, denoted as x, yields the greatest integer which is less than or equal to x. ceiling of x, denoted as x, yields the smallest integer which is greater than or equal to x.

29 Several Special Functions
Chapter 3 Relation and Function Several Special Functions Example: Some examples for the values of floor function and ceiling function: 3.5 = 3 3.5 = 4 0.45 = 0 0.45 = 1 4.8 = 4 4.8 = 5 – 0.5 = – 1 – 0.5 = 0 –3.75 = – 4 –3.75 = – 3 How to make a round function, such that round(4.2) = 4, round(7.52) = 8?

30 Several Special Functions
Chapter 3 Relation and Function Several Special Functions Modulo Function Suppose a is an arbitrary integer and m is an arbitrary positive integer, then a mod m yields the remaining of the division if a is divided by m a mod m = r such that a = mq + r, where q is an arbitrary integer and 0  r < m The value of r can also be found using the formula of: r = a – mq where q = a/m

31 Several Special Functions
Chapter 3 Relation and Function Several Special Functions Example: Some examples for the values of modulo function: 25 mod 7 = 4, 25/7 = 3 and 25 – 73 = 4 15 mod 4 = 3, 15/4 = 3 and 15 – 43 = 3 3612 mod 45 = 12, 3612/45 = 80 and 3612 – 4580 = 12 0 mod 5 = 0, 0/5 = 0 and 0 – 50 = 0 –25 mod 7 = 3, –25/7 = –4 and –25 – 7(–4) = 3

32 Chapter 3 Relation and Function Exercise Problems Determine whether the following relations are injective, surjective, bijective, or neither. 1 2 3 4 a b c 1 2 3 4 a b c d 1 2 3 4 a b c (a) (b) (c) 1 2 3 a b c d 1 2 3 4 a b c d (d) (e)

33 Chapter 3 Relation and Function Exercise Problems Let f:RR and g:RR be defined by f(x) = 2x + 1 and g(x) = x2 – 2. Find the formula for the composition functions: f ○ f ○ g g ○ g ○ f 33


Download ppt "Chapter 3 Relation and Function Homework 4 For each of the following relations on set A = { 1,2,3,4 }, check each of them whether they are reflexive, irreflexive,"

Similar presentations


Ads by Google