CHAPTER 4: FUNCTIONS AND RELATIONS - PowerPoint PPT Presentation

1 / 68
About This Presentation
Title:

CHAPTER 4: FUNCTIONS AND RELATIONS

Description:

Range of f {A, B, C, D} because each grade except E as assigned to some student. Adam ... Determining which pairs of cities linked by airline flights in a network ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 69
Provided by: assocprofd1
Category:

less

Transcript and Presenter's Notes

Title: CHAPTER 4: FUNCTIONS AND RELATIONS


1
CHAPTER 4 FUNCTIONS AND RELATIONS
  • Fundamental Discrete Structure
  • DCT 1073

2
CONTENT
  • 4.1 Introduction to Functions
  • 4.2 One-to-one Functions
  • 4.3 Onto Functions
  • 4.4 Relations and Their Properties
  • 4.4.1 Relations
  • 4.4.2 Reflexive
  • 4.4.3 Symmetric
  • 4.4.4 Transitive

3
OBJECTIVES
  • At the end of this chapter you should be able to
  • Identify a function, sum, product composite
    functions.
  • Find the domain and range of a function
  • Identify a one-to-one function.
  • Find the inverse of a function.
  • Identify an onto function.
  • Identify a bijection.
  • Find a binary relation from A to B
  • Define a function as relation
  • Find relations on a set
  • Determine whether a relation is reflexive,
    symmetric or transitive

4
4.1 INTRODUCTION TO FUNCTION
  • Lesson outcome
  • Identify a function, sum, product composite
    functions.
  • Find the domain and range of a function

5
What is a Function ?
  • Let A and B be sets. A function f from A to B is
    an assignment of exactly one element of B to each
    element of A.
  • We write f (a) b if b is the unique element of
    B assigned by the function f to the element a of
    A.
  • If f is a function from A to B, we write f A ?
    B .
  • b f (a) is the value of f at the number a.

A
B
f
f
a (input) Dependent variable
a
b
b f (a) Output Independent variable
(input) (output)
6
Examples of Functions
a b c
a b c
1 2 3 4
1 2 3 4
2. A function 3. Not a
function
7
Domain Range of a Function
  • If f is a function from A to B, we say that A is
    the domain of f and B is the codomain of f.
  • If , f (a) b we say that b is the image of a
    and a is a pre-image of b.
  • The range of f is the set of all images of
    elements of A.
  • Also, if f is a function from A to B, we say that
    f maps A to B.

A
B
f
f
b f (a) Image of a
a
b
a Pre-image of b
domain codomain / range
f maps A to B
8
Example
  • What are the domain, codomain and range of the
    function that assigns grades to students as
    follows?
  • Domain of f Adam, Bob, Chu, Deen, Emy
  • Codomain of f A, B, C, D, E
  • Range of f A, B, C, D because each grade
    except E as assigned to some student.

Adam Bob Chu Deen Emy
A B C D E
9
Example
  • Let f be the function from Z to Z that assigns
    the square of an integer to this integer.
  • What are the domain, codomain and range of the
    function?
  • Domain of f the set of all integers
  • Codomain of f the set of all integers
  • Range of f the set of all nonnegative
    integers that are perfect squares,
    namely, 0, 1, 4, 9, .

10
EXERCISE 4.1
  • Find the domain and range of each of the
    following functions
  • d . the function that assigns to each
    positive integers the largest integer do not
    exceeding the square root of the integers.

11
Sum Product of Functions
Sum of functions Product of functions
The domain consists of the number x that are in
the domains of both f1 f2.
12
EXERCISE 4.1
  • Let f and g be two functions defined as
  • Find the following and determine the domain
  • in each case

13
Composite Function
g
f
x (input) domain
f (g (x)) Output range
g (x)
14
Example Composite Function
Suppose that,
Then,
15
EXERCISE 4.1
3. Suppose that,
Find
State the domain for each composite function
16
4.2 ONE-TO-ONE FUNCTION
Lesson outcome Identify a one-to-one
function. Find the inverse of a function.
17
One-to-one Functions
  • A function f is one-to-one (injection) iff
  • implies
  • for all x and y in the domain f.

One-to-one
Not one-to-one
18
Example 1
  • Determine whether the function f from a, b, c,
    d to 1, 2, 3, 4, 5 with f (a) 4, f (b) 5,
    f (c) 1, and f (d) 3 is one-to-one.
  • Solution

f is one-to-one since f takes on different
values at the four elements of its domain.
19
Example 2
  • Determine whether the function
    from the set of integers to the set of integers
    is one-to-one.
  • Solution

f is not one-to-one since but
20
Example 3
  • Determine whether the function
    from the set of integers to the set of integers
    is one-to-one.
  • Solution

f is one-to-one since when
21
EXERCISE 4.2
  • Determine whether the function f from a, b, c,
    d to itself with f (a) b, f (b) a, f (c)
    c, and f (d) d is one-to-one.
  • Determine whether the function f (n) 2n 5
    from N to Z is one-to-one.
  • Let B 1, -1 and
  • Determine whether the function f from Z to
    B is one-to-one.

22
Inverse Functions
  • If f is a one-to-one function X ? Y, its
    inverse is a function that assigns to
    the unique element
  • such that .

Domain of f Range of f
f
x
y
23
Example 1
  • Let f be the function from a, b, c to 1, 2, 3
    such that f (a) 2, f (b) 3, and f (c) 1. Is
    f is invertible? What is its inverse?
  • Solution
  • f is invertible since f is one-to-one function
    (WHY?).
  • Thus its inverse are given by

24
Example 2
  • Let f Z ? Z be such that and
    f is one-to-one. Find its inverse.
  • Solution
  • f is invertible since f is one-to-one function.
  • Thus its inverse are given by

25
EXERCISE 4.2
4. Find the inverse of the following
functions a. b.
5. The function
is one-to-one. Find its inverse and check the
result. Find also the domain and range of the
inverse function.
26
4.3 ONTO FUNCTION
Lesson outcome Identify an onto
function. Identify a bijection.
27
1.2.2 Onto Functions
  • A function f from X to Y is called onto
    (surjection) iff for every element there is an
    element with

Not onto
Onto
28
Example 1
  • Let f be the function from a, b, c, d to 1, 2,
    3 defined by f (a) 3, f (b) 2, f (c) 1,
    and f (d) 3. Is f an onto function?
  • Solution

f is onto function since all three elements of
the codomain are images of elements in the
domain,
29
Example 2
  • Is the function from the set of
    integers to the set of integers onto?
  • Solution

f is not onto since there is no integer x with
30
Example 3
  • Is the function from the set
    of integers to the set of integers onto?
  • Solution

f is not one-to-one since since for every integer
y there is an integer x such that
31
EXERCISE 4.3
  • Let A 1, 2, 3, 4 and B a, b, c, d.
    Determine whether the function f A ? B with f
    (1) b, f (2) d, f (3) c, and f (4) a is
    onto.
  • Determine whether the function f (n) n from Z
    to Z is onto.
  • Let B 1, -1 and
  • Determine whether the function f from Z to
    B is onto.

32
Bijections
The function f is a one-to-one correspondence or
bijection if it is both one-to-one and onto.

a b c d
a b c d
1 2 3 4
1 2 3 4
One-to-one and onto (BIJECTION)
Neither one-to-one nor onto
33
Examples of not Bijection
a b c
a b c d
1 2 3
1 2 3 4
Onto but not one-to-one
One-to-one but not onto
34
Example
  • Let f be the function from a, b, c, d to 1, 2,
    3, 4 with f (a) 4, f (b) 2, f (c) 1, and f
    (d) 3. Is f a bijection?
  • Solution

f is bijection since f is both one-to one and
onto.
35
EXERCISE 4.3
  • Suppose that the sets X and Y are X a, b, c ,
    d, e and Y 1, 2, 3, 4 and the
    functions f X ? Y, g X ? X, and h Y ? X
    are defined as follows
  • f (a) 3 g(a) b h (1) a
  • f (b) 4 g(b) d h (2) c
  • f (c) 2 g(c) e h (3) b
  • f (d) 4 g(d) a h (4) e
  • f (e) 1 g(e) c
  • Which of these functions are surjections,
    injections and bijections?

36
4.4 RELATIONS AND THEIR PROPERTIES
37
Introduction
  • Relations can be used to solve problems such as
  • Determining which pairs of cities linked by
    airline flights in a network
  • Finding a viable order for different phases of a
    complicated project
  • Producing a useful way to store information in
    computer databases

38
4.4.1 RELATIONS
Lesson outcome Find a binary relation from A to
B Define a function as relation Find relations
on a set
39
Binary Relations
Let A and B be sets. A binary relation from A to
B is a subset of
Example
  • Let A 0, 1, 2 and B a, b.
  • Then (0, a), (0,b), (1, a), (2,b) is a relation
    from A to B since its a subset of (0, a), (0,b),
    (1, a), (1,b), (2, a), (2,b)

.
40
Functions as Relations
  • Recall A function f from set A to set B assign
    exactly one element of B to each element of A

Example
  • Let A 1, 2, 3, 4 and B a, b, c, d.
  • Let f (1, a), (2, a), (3, d), (4, c) is a
    relation from A to B
  • Here we have
  • f (1) a, f (2) a, f (3) d, and f (4) c
  • Since each set f (x) is a single value, f is a
    function.
  • The domain of f is given by 1, 2, 3, 4
  • The range of f is given by a, c, d

41
EXERCISE 4.4
  • Determine whether each relation represents a
    function. If it a function, state the domain and
    range.
  • (1,4), (2,5), (3,6), (4,7)
  • (1,4), (2,4), (3,5), (6,10)
  • (-3,9), (-2,4), (0,0), (1,1), (-3,8)
  • (1, x), (2, x)
  • (1, x), (1, y), (2, z), (3, y)

42
EXERCISE 4.4
  • Let A a1, a2, a3, B b1, b2, b3, C c1,
    c2, and D d1, d2, d3 , d4. Consider the
    following functions respectively.
  • f1 (a1, b2), (a2, b3), (a3, b1), f1 A ?
    B
  • f2 (a1, d2), (a2, d1), (a3, d4), f2 A ?
    D
  • f3 (b1, c2), (b2, c2), (b3, c1), f3 B ?
    C
  • f4 (d1, b1), (d2, b2), (d3, b1), f4 D ? B
  • Determine whether each function is one-to-one,
    onto or one-to one and onto.

43
EXERCISE 4.4
  • Find the inverse of the following functions
  • a. (1,4), (2,5), (3,6), (4,7)
  • b. (-3,-27), (-2,8), (-1,1), (0,0), (1,1),
    (2,8), (3,27)

44
Relations on a Set
  • A relation on the set A is a relation from A to
    A.
  • In other words, a relation on a set A is a
    subset of
  • On A set with n elements there are
    relations.

Example
  • Let A 1, 2, 3, 4. Which ordered pairs are in
    the relation I R (a, b) a divides b?

Solution
R (1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2,
4), (3, 3), (4, 4)
45
Example
  • Consider these relations on the set of integers.
    Which of these relations contain each of the
    pairs (1, 1), (1, 2), (2, 1), (1,-1), and (2, 2)?

SOLUTION
46
EXERCISE 4.4
  • Let A 1, 2, 3, 4, 5. Which ordered pairs are
    in the following relation a R b iff a lt
    b ?
  • An airlines services the 5 cities c1, c2, c3, c4
    and c5. Table below gives the cost (in dollars)
    of going from ci to cj.
  • Find R if the following relation is
    define on the set of cities
    A c1, c2, c3, c4, c5 ci R cj iff the
    cost of going from ci to cj is less or equal to
    180.

From / To c1 c2 c3 c4 c5
c1 140 100 150 200
c2 190 200 160 220
c3 110 180 190 250
c4 190 200 120 150
c5 200 100 200 150
47
Properties of Relations
  • Reflexive
  • Symmetric
  • Transitive

48
4.4.2 REFLEXIVE
Lesson outcome Determine whether a relation is
reflexive
49
Reflexive
A relation R on set A is called Reflexive if
Example
  • Consider the following relations on 1, 2, 3, 4.
    Is this relation reflexive?
  • (a)
  • (b)

Not reflexive since (3, 3) is not in this relation
Not reflexive since (2, 2) is not in this relation
50
Reflexive
  • (c)
  • (d)
  • (e)
  • (f)

Reflexive
Not reflexive
Reflexive
Not reflexive
51
Reflexive Example 2
Consider these relations on the set of integers
Reflexive since for every integer a
Not reflexive
Reflexive
Reflexive
52
Reflexive Example 3
  • Is the divides relation on the set of positive
    integers reflexive?
  • Since aa whenever a is a positive integer, the
    divides relation is reflexive.

Solution
53
4.4.1 SYMMETRIC
Lesson outcome Determine whether a relation is
symmetric
54
Symmetric
  • Symmetric if then
  • Antisymmetric and
  • only if
  • Example
  • Consider the following relations on 1, 2, 3, 4.
  • (a)

Not symmetric
Not antisymmetric
55
Symmetric
(b)
Symmetric
Not antisymmetric
(c)
Symmetric
Not antisymmetric
(d)
Antisymmetric
Not symmetric
56
Symmetric
(e)
Not symmetric
Antisymmetric
(f)
Not symmetric
Antisymmetric
57
Symmetric Example 2
  • (g)
  • (h)
  • (i)

Consider these relations on the set of integers
Antisymmetric
Not symmetric
Not symmetric
Antisymmetric
Symmetric
Not antisymmetric
58
Symmetric Example 2
(j) (k) (l)
Symmetric
Antisymmetric
Not symmetric
Antisymmetric
Symmetric
Not antisymmetric
59
Symmetric Example 3
  • Is the divides relation on the set of positive
    integers integers symmetric? Is it antisymmetric?
  • This relation is not symmetric since 12 , but
    .
  • It is antisymmetric, for if a and b are positive
    integers with a b and b a , then a b.

Solution
60
4.4.4 TRANSITIVE
Lesson outcome Determine whether a relation is
transitive
61
Transitive
Transitive if and then
  • Example
  • Consider the following relations on 1, 2, 3, 4.

(a)
Not transitive
(b)
Not transitive
62
Transitive
(c)
Not transitive
(d)
Transitive
(e)
Transitive
(f)
Transitive
63
Transitive Example 2
Consider these relations on the set of integers
(a)
Transitive
(b)
Transitive
64
Transitive Example 2
(c)
Transitive
(d)
Transitive
65
Transitive Example 2
(e)
Not transitive
(f)
Not transitive
66
Transitive Example 3
  • Is the divides relation on the set of positive
    integers integers transitive?
  • Suppose that a divides b and b divides c.
  • Then there are positive integer k and l such that
    b ak and c bl.
  • Hence, c a (kl) so that a divides c. It
    follows that this relation is transitive.

Solution
67
EXERCISE 4.4
  • Let A 1, 2, 3, 4. Determine whether the
    relation is reflexive, symmetric, antisymmetric
    or transitive.
  • R (1,1), (1,2), (2,1), (2,2), (3,3), (3,4),
    (4,3), (4,4)
  • R (1,2), (1,3), (1,4), (2,3), (2,4), (3,4)
  • R (1,3), (1,1), (3,1), (1,2), (3,3), (4,4)
  • R (1,1), (2,2), (3,3)
  • R
  • R A A
  • R (1,2), (1,3), (3,1), (1,1), (3,3), (3,2),
    (1,4), (4,2), (3,4)
  • R (1,3), (4,2), (2,4), (3,1), (2,2)

68
Thank You
Write a Comment
User Comments (0)
About PowerShow.com