Download presentation
Published byCameron Percival Norman Modified over 9 years ago
1
CSNB 143 Discrete Mathematical Structures
Chapter 10 - Functions
2
OBJECTIVES Student should be able to know about function as a map that has images and values. 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
Function Is a special relation.
Let A and B be nonempty sets. A function f from A to B, denoted f : A B is a relation from A to B such that for all a Dom (f), f(a) contains just one element of B. If a is not in Dom (f), then f(a) = . The relation f can be described as the set of pairs {(a, f(a)) | a Dom (f)} Functions are also called mappings or transformations since they can be geometrically viewed as rules that assign to each element a A, the unique element f(a) B.
4
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. f . b = f(a) B a . A
5
Ex 1: 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. Note that the element a B appears as the second elements of two different ordered pairs in f. This is allowed.
6
Ex 2: 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)}
7
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. Relation T is not a function since 3 has no image under f. Note that if the elements have two or more images or value, it is not a function.
8
Ex 3:. Let set A = B = Z, and C is a set of even integers
Ex 3: Let set A = B = Z, and C is a set of even integers. Let f: A B and g: B C as below: f(a) = a + 1 g(b) = 2b Find the g f We got (g f) (a) = g(f(a)) = g(a + 1) = 2(a + 1)
9
This is explained with Figure 2 below: g ◦ f f g
When it involves two or more functions, the product is what we called composition. b = f(a) . B . c = g(b) = g ◦ f(a) C a. A
10
Special Types of Functions
Let f is a function from A to B. We say that f is onto if its Ran(f) = B We say that f is a one-to-one if there is no f(a1) = f(a2) for two distinguish elements a1 and a2 for A. Ex 4: Consider the Ex 1. Ran(f) = {a, c, d} B, so f is not onto. And we can see that f(1) = f(2) = a, so f is not one-to-one.
11
Exercise: Let A = {a1, a2, a3, a4}; B = {b1, b2, b3}; C = {c1, c2} and D = {d1, d2, d3, d4}. Consider all function below from B to B, A to D, B to C, D to B and C to B. Identify either it is onto and/or one-to-one. f = {(b1, b2), (b2, b3), (b3, b1)} f = {(a1, d2), (a2, d1), (a3, d4), (a4, d3)} f = {(b1, c2), (b2, c2), (b3, c1)} f = {(d1, b1), (d2, b2), (d3, b1), (d4, b2)} f = {(c1, b1), (c2, b3)}
12
Invertible Functions A function f: A B is said to be invertible if its reverse relation, f -1 is also a function. Ex 5: Consider the Ex 1. So, 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.
13
Theorem: Let f: A B is a function. So,
f -1 is a function from B to A if and only if f is a one-to-one function. If f is a one-to-one function, then f -1 is also a one-to-one function.
14
Exercise: Let A = {a, b, c, d} and B = {1, 2, 3}. Identify the relation R from A to B is a function. If it is a function, give its range. R = {(a, 1), (b, 2), (c, 1), (d, 2)} R = {(a, 1), (b, 2), (a, 2), (c, 1), (d, 2)} R = {(a, 3), (b, 2), (c, 1)} R = {(a, 1), (b, 1), (c, 1), (d, 1)}
15
Let A = B = C = R (real numbers) and let f: A B, g: B C is explained as f(a) = a + 1 and g(b) = b Find: (g f)(-2) d) (f g)(x) (f g)(-2) e) (f f)(y) (g f)(x) f) (g g)(y)
16
For each of below, sets A and B and its function from A to B are given
For each of below, sets A and B and its function from A to B are given. Find if the function is onto and/or one-to-one. (a) A = {1, 2, 3, 4} = B; f = {(1, 1), (2, 3), (3, 4), (4, 2)} (b) A = {1, 2, 3}; B = {a, b, c, d}; f = {(1, a), (2, a), (3, c)} (c )A = {½, ¾, ¼}; B = {x, y, z, w}; f = {(½, x), (¼, y), (¾, w)} (d) A = {1.1, 7, 0.06}; B = {p, q}; f = {(1.1, p), (7, q), (0.06, p)}
17
Let f is a function from A = {1, 2, 3, 4} to B = {a, b, c, d}
Let f is a function from A = {1, 2, 3, 4} to B = {a, b, c, d}. Find out if f -1 is a function or not. f = {(1, a), (2, a), (3, c), (4, d)} f = {(1, a), (2, c), (3, b), (4, d)}
18
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.
19
Ex 6: Let A = {1, 2, 3}. So, all of its permutations:
1A P1 = P2 = P3 = P4 = P5 =
20
Ex 7: Using all permutation in Ex 6, 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)}
21
Put it back into P4-1 so we get
That is P4-1 = = P3
22
b) Function P2 relates 1 to 2 and function P3 relates 2 to 3, so, P3 P2 will relates 1 to 3. Also, P2 relates 2 to 1, and P3 relates 1 to 2, so, P3 P2 will relate 2 to 2. And P2 relates 3 to 3 and P3 relates 3 to 1, so, P3 P2 will relate 3 to 1. So, P3 P2 =
23
The process is like what was shown below:
P3 = ◦ P2 = = The composition of two permutations is another permutation, usually referred to as the product of these permutations. Theorem 1: If A = {a1, a2, …, an} is a set contained n elements, so there will be n! = n.(n – 1)… 2.1 permutation for A.
24
Let b1, b2, …. br are r elements of set A = {a1, a2, …. an}
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}
25
This is what we called as cyclic permutation length r or cycle length r. This concept is difference from cycle concept in graph. Ex 8: Let A = {1, 2, 3, 4, 5}. Cycle (1, 3, 5) is shown by a permutation Note that because of cyclic concept, a permutation can be written in many ways like (3, 5, 8, 2) = (5, 8, 2, 3) = (8, 2, 3, 5) = (2, 3, 5, 8)
26
Ex 9: 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) a) (4, 1, 3, 5) = and = (5, 6, 3) =
27
Ex 9: 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) b) (5, 6, 3) = and = (4, 1, 3, 5) = We can see that (4, 1, 3, 5) (5, 6, 3) (5, 6, 3) (4, 1, 3, 5)
28
Two cycles of set A is said to be disjoint if no elements of A appears in both cycles.
Ex 10: Let A = {1, 2, 3, 4, 5, 6}. So, cycles (1, 2, 5) and (3, 4, 6) are disjoint cycles, while cycles (1, 2, 5) and (2, 4, 6) are not. Theorem 2: A permutation for finite set that is not an identity, can be written as a product of disjoint cycles with length 2.
29
Ex 11:Write a permutation on set A = {1, 2, 3, 4, 5, 6, 7, 8) as a product of disjoint cycles:
Find all the cycles: Choose P(1) = 3, P(3) = 6, and P(6) = 1, so we have a cycle (1, 3, 6).
30
Next, choose elements in A by choosing the first elements not in the previous found cycle(s).
Choose P(2) = 4, P(4) = 5 and P(5) = 2, so we have a cycle (2, 4, 5). Choose P(7) = 8 and P(8) = 7, so the next cycle is (7, 8). Then it can be written as a product of disjoint cycle: P = (7, 8) (2, 4, 5) (1, 3, 6) Note that the order is not important since all cycles are disjoint. P = (2, 4, 5) (7, 8) (1, 3, 6) is also acceptable
31
Even and Odd Permutation
A cycle with length two is called transposition. That is, transposition for cycle P = (ai, aj) where P(ai) = aj and P(aj) = ai. All cycle with length more than two, can be written as product of transposition. Ex 12: A cycle given by (1, 2, 3, 4, 5), so, its product of transposition: (1, 2, 3, 4, 5) = (1, 5) (1, 4) (1, 3) (1, 2)
32
Ex 13: Write permutation P in Ex 11 as its product of transposition.
We have P = (7, 8) (2, 4, 5) (1, 3, 6) We can write (1, 3, 6) = (1, 6) (1, 3) (2, 4, 5) = (2, 5) (2, 4) So we can get: P = (7, 8) (2, 5) (2, 4) (1, 6) (1, 3).
33
Theorem 3: If a permutation for a finite set can be written in a product of an even number of transposition, it cannot be written in odd number and so on. A permutation for finite set is called even if it can be written as a product of an even number of transpositions. It is called odd if it can be written as a product of an odd number of transpositions.
34
Ex 14: Is permutation below is odd or even?
Write P as a product of disjoint cycles: P = (1, 2, 4, 7) (3, 5, 6) Then, wrote all cycles as a product of transposition: (1, 2, 4, 7) = (1, 7) (1, 4) (1, 2) (3, 5, 6) = (3, 6) (3, 5)
35
So, P = (1, 7) (1, 4) (1, 2) (3, 6) (3, 5) We find out that P is a product of an odd number of permutations, and it is called odd permutation.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.