CSNB143 – Discrete Structure Topic 8 – Function. Learning Outcomes Students should be able to...

Preview:

DESCRIPTION

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

Citation preview

CSNB143 – Discrete Structure

Topic 8 – Function

Topic 8 – FunctionLearning 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.

Topic 8 – FunctionUnderstanding 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

Topic 8 – FunctionUnderstanding 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) = af(3) = df(4) = c

Since each set f(n) is a single value, f is a function.

Topic 8 – FunctionUnderstanding 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.

Topic 8 – FunctionSpecial types of function

Let f be a function from A to B,

Types Characteristics

Everywhere defined Dom(f) = A

Onto Ran (f) = B

One to one If f(a) = f(a’), then a = a’

Topic 8 – FunctionSpecial 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

Types Characteristics OutcomesEverywhere defined

Dom(f) = A Dom(f) = {1,2,3,4}. Hence Dom(f) = AHence f is of type everywhere defined

Onto Ran (f) = B Ran (f) = {a, d, c}Hence Dom(f) BHence f is not of type onto

One to one If f(a) = f(a’), then a = a’ Since f(1) = f(2) = aHence f is not of type one to one

Topic 8 – FunctionSpecial types of functions• Another example:Let A = {a1, a2, a3}; B = {b1, b2, b3}; C = {c1, c2} and D = {d1, d2, d3, d4}.

Consider the following four functions, from A to B, A to D, B to C, and D to B respectivelyIdentify the types of each functiona) f = {(a1, b2), (a2, b3), (a3, b1)}

b) f = {(a1, d2), (a2, d1), (a3, d4)}

c) f = {(b1, c2), (b2, c2), (b3, c1)}

d) f = {(d1, b1), (d2, b2), (d3, b1)}

Topic 8 – FunctionInvertible 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.

Topic 8 – FunctionPermutation 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:

Topic 8 – FunctionPermutation Function• Find a) P4

-1 b) P3 P2

a) See that P4 is a one-to-one function, we have

P4 = {(1, 3), (2, 1), (3, 2)} So, P4-1 = {(3, 1), (1, 2), (2, 3)}

b)

Topic 8 – FunctionCyclic Permutations• The composition of two permutations is another permutation, usually referred to

as the product of these permutations.• If A = {a1, a2, …, an} is a set contained n elements, so there will be n! = n.(n – 1)…

2.1 permutation for A.Let b1, b2, …. br are r elements of set A = {a1, a2, ….. an}.

Permutation for P: A A is given by: P(b1) = b2

P(b2) = b3

.

.P(br) = b1

P(x) = x if x A, x {b1, b2, … br}

Topic 8 – FunctionCyclic PermutationsExample:

Rule:P(b1) = b2

P(b2)= b3

P(x) = xP(br) = b1

Topic 8 – FunctionCyclic 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)

Recommended