Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSNB143 – Discrete Structure Topic 8 – Function. Learning Outcomes Students should be able to understand function and know how it maps. Students should.

Similar presentations


Presentation on theme: "CSNB143 – Discrete Structure Topic 8 – Function. Learning Outcomes Students should be able to understand function and know how it maps. Students should."— Presentation transcript:

1 CSNB143 – Discrete Structure Topic 8 – Function

2 Learning Outcomes Students should be able to understand function and know how it maps. Students should be able to identify different type of function and solve it.

3 Topic 8 – Function Understanding function Function is a special type of relation A function f from A to B is written as we write a normal relation f : A  B The rule is for all a  Dom (f), f(a) contains just one element of B. If a is not in Dom (f), then f(a) = . The element a is called an argument of the function f and f(a) is called the value of the function for the argument a and is also referred to as the image of a under f

4 Topic 8 – Function Understanding function The rule for f : A  B is for all a  Dom (f), f(a) contains just one element of B. If a is not in Dom (f), then f(a) = . Example: Let A = {1, 2, 3, 4} and B = {a, b, c, d} and let f = {(1, a), (2, a), (3, d), (4, c)} We have f(1) = a f(2) = a f(3) = d f(4) = c Since each set f(n) is a single value, f is a function.

5 Topic 8 – Function Understanding function Another example: Let A = {1, 2, 3} and B = {x, y, z}. Consider the relations R = {(1, x), (2, x), (3, x)} S = {(1, x), (1, y), (2, z), (3, y)} T = {(1, z), (2, y)} Determine if the relations R, S and T are functions – Relation R is a function with Dom(R) = {1, 2, 3} and Ran(R) = {x}. – Relation S is not a function since S(1) = {x, y}. It shows that element 1 has two images under f. Note that if the elements have two or more images or value, it is not a function. – Relation T is not a function since 3 has no image under f.

6 Topic 8 – Function Special types of function Let f be a function from A to B, TypesCharacteristics Everywhere definedDom(f) = A OntoRan (f) = B One to oneIf f(a) = f(a’), then a = a’

7 Topic 8 – Function Special types of function Example: Let A = {1, 2, 3, 4} and B = {a, b, c, d} and let f = {(1, a), (2, a), (3, d), (4, c)}. Determine the type of function f is TypesCharacteristicsOutcomes Everywhere defined Dom(f) = ADom(f) = {1,2,3,4}. Hence Dom(f) = A Hence f is of type everywhere defined OntoRan (f) = BRan (f) = {a, d, c} Hence Dom(f)  B Hence f is not of type onto One to oneIf f(a) = f(a’), then a = a’Since f(1) = f(2) = a Hence f is not of type one to one

8 Topic 8 – Function Special types of functions Another example: Let A = {a 1, a 2, a 3 }; B = {b 1, b 2, b 3 }; C = {c 1, c 2 } and D = {d 1, d 2, d 3, d 4 }. Consider the following four functions, from A to B, A to D, B to C, and D to B respectively Identify the types of each function a)f = {(a 1, b 2 ), (a 2, b 3 ), (a 3, b 1 )} b)f = {(a 1, d 2 ), (a 2, d 1 ), (a 3, d 4 )} c)f = {(b 1, c 2 ), (b 2, c 2 ), (b 3, c 1 )} d)f = {(d 1, b 1 ), (d 2, b 2 ), (d 3, b 1 )}

9 Topic 8 – Function Invertible function A function f: A  B is said to be invertible if its reverse relation, f -1 is also a function Example: Consider f = {(1, a), (2, a), (3, d), (4, c)}. therefore, f -1 = {(a, 1), (a, 2), (d, 3), (c, 4)} We can clearly see that f -1 is not a function because f -1 (a) = {1, 2}. So f is not an invertible function. Note that if the elements have two or more images or value, it is not a function.

10 Topic 8 – Function Permutation Function This is a part in which set A have a relation to itself. Set A is finite set. In this case, a function must be onto and one-to-one. A bijection from a set A to itself is called a permutation of A. Example:

11 Topic 8 – Function Permutation Function Find a) P 4 -1 b) P 3  P 2 a) See that P 4 is a one-to-one function, we have P 4 = {(1, 3), (2, 1), (3, 2)} So, P 4 -1 = {(3, 1), (1, 2), (2, 3)} b)

12 Topic 8 – Function Cyclic Permutations The composition of two permutations is another permutation, usually referred to as the product of these permutations. If A = {a 1, a 2, …, a n } is a set contained n elements, so there will be n! = n.(n – 1)… 2.1 permutation for A. Let b 1, b 2, …. b r are r elements of set A = {a 1, a 2, ….. a n }. Permutation for P: A  A is given by: P(b 1 ) = b 2 P(b 2 ) = b 3. P(b r ) = b 1 P(x) = x if x  A, x  {b 1, b 2, … b r }

13 Topic 8 – Function Cyclic Permutations Example: Rule: P(b 1 ) = b 2 P(b 2 )= b 3 P(x) = x P(b r ) = b 1

14 Topic 8 – Function Cyclic Permutations Example: Let A = {1, 2, 3, 4, 5, 6}. Find: a)(4, 1, 3, 5)  (5, 6, 3) b)(5, 6, 3)  (4, 1, 3, 5)


Download ppt "CSNB143 – Discrete Structure Topic 8 – Function. Learning Outcomes Students should be able to understand function and know how it maps. Students should."

Similar presentations


Ads by Google