Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
25 views

Lecture 2 Functions

The document defines and provides examples of functions, their domains and ranges, and different types of functions including one-to-one, onto, and bijective functions. It explains that a function relates an input to an output, and defines a function as an assignment of exactly one element from the codomain to each element of the domain. It then discusses one-to-one functions where each domain element maps to a unique range element, onto functions where each range element has a pre-image, and bijective functions which are both one-to-one and onto. Examples are provided to illustrate these different types of functions.

Uploaded by

Ayesha Shafiq
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Lecture 2 Functions

The document defines and provides examples of functions, their domains and ranges, and different types of functions including one-to-one, onto, and bijective functions. It explains that a function relates an input to an output, and defines a function as an assignment of exactly one element from the codomain to each element of the domain. It then discusses one-to-one functions where each domain element maps to a unique range element, onto functions where each range element has a pre-image, and bijective functions which are both one-to-one and onto. Examples are provided to illustrate these different types of functions.

Uploaded by

Ayesha Shafiq
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Functions

FUNCTIONS, DOMAIN AND RANGE, ONE TO ONE, ONTO AND


BIJECTIVE FUNCTIONS
Introduction

 A function relates an input to an output.


 In many instances we assign to each element of a set a particular element of a
second set (which may be the same as the first).
 For example, suppose that each student in a discrete mathematics
class is assigned a letter grade from the set {A,B,C,D, F}. And suppose that the
grades are A for Adams, C for Chou, B for Goodfriend, A for Rodriguez, and F for
Stevens. This assignment of grades is illustrated in Figure 1.This assignment is an
example of
Applications:

 The concept of a function is extremely important in mathematics and computer


science.
 For example, in discrete mathematics functions are used in the definition of such
discrete structures as sequences and strings.
 Functions are also used to represent how long it takes a computer to solve
problems of a given size.
 Many computer programs and subroutines are designed to calculate values of
functions. Recursive functions
Definition:

 Let A and B be nonempty 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.
 Remark:
Functions are sometimes also called mappings or transformations.
 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 preimage of b. The range, or
image, 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.
Examples of function
x2 (squaring) is a function

x3+1 is also a function

Sine, Cosine and Tangent are functions used in


trigonometry
 y = 2x + 1
 y = 3x – 2
 y = 4y
 y = 5/x
Domain, Co domain and Range:

 What are the domain, codomain, and range of the function that assigns
grades to students described in the first slide?
Solution:
 Let G be the function that assigns a grade to a student in our discrete mathematics
class.
 Note that G(Adams) = A, for instance. The domain of G is the set {Adams, Chou,
Goodfriend, Rodriguez, Stevens}, and the codomain is the set {A,B,C,D, F}.
 The range of G is the set{A,B,C, F}, because each grade except D is assigned to
some student.
 Set of Ordered Pairs, A function can then be defined as a set of ordered pairs:
 Example: {(2,4), (3,5), (7,3)} is a function that says "2 is related to 4", "3 is
related to 5" and "7 is related 3".
 Also, notice that:
the domain is {2,3,7} (the input values) and the range is {4,5,3} (the output values)
Example:

 Let R be the relation with ordered pairs (Abdul, 22), (Brenda, 24), (Carla,
21), (Desire, 22), (Eddie, 24), and (Felicia, 22). Here each pair consists of a
graduate student and this student’s age.
 Specify a function determined by this relation.
Solution:
 If f is a function specified by R, then f (Abdul ) = 22, f (Brenda) = 24,
f (Carla) = 21, f (Desire) = 22, f (Eddie) = 24, and f (Felicia) = 22.
 For the domain, we take the set {Abdul, Brenda, Carla, Desire, Eddie, Felicia}.
 For codomain, which needs to contain all possible ages
 of students.
 Because it is highly likely that all students are less than 100 years old, we can take the
set of positive integers less than 100 as the codomain. (Note that we could choose a
different codomain, such as the set of all positive integers or the set of positive
integers between 10 and
 90.
 The range of the function is
Set of different ages of these students, which is the set {21, 22, 24}.
Types of function:

 The types of functions are defined on the basis of the domain, range, of function.


1. One to One Function
2. Many to One Function
3. Onto Function
4. One to One and Onto Function (Bijection)
5. Into Function
One-to-one or injective function

 A one-to-one function is defined by f: A → B such that every element of set A is


connected to a distinct element in set B.
 The one-to-one function is also called an injective function.
 Here every element of the domain has a distinct image or co-domain element for
the given function.
 Suppose that each worker in a group of employees is assigned a job from a set of
possible jobs, each to be done by a single worker. In this situation, the function f
that assigns a job to each worker is one-to-one.
 Determine whether the function f from {a, b, c, d} to {1, 2, 3, 4, 5}
f (a) = 4, f (b) = 5,
f (c) = 1, and f (d) = 3 is one-to-one.
Solution:
The function f is one-to-one because f takes on different values at the four elements
of its domain illustrated in above figure.
 Determine whether the function f (x) = x2 from the set of integers to the set of
integers is one-to-one.
 Solution:

 The function f (x) = x2 is not one-to-one, Because every input will have single and
different image.
 Determine whether the function f (x) = x + 1 from the set of real numbers to
itself is one-to-one.
Onto function or Surjective

 In an, onto function, every codomain element is related to the domain element.


For a function defined by f: A → B, such that every element in set B has a pre-
image in set A. The onto function is also called a subject
 A function f from A to B is called onto, or a surjection, if and only if for every
element b ∈ B there is an element a ∈ A with f (a) = b. A function f is called
surjective if it is onto function.
 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:

Because all three elements of the codomain are images of elements in the domain, we
see that f is onto. This is illustrated in Figure 4. Note that if the codomain were {1, 2,
3, 4}, then f would not be onto.
 Is the function f (x) = x2 from the set of integers to the set of integers onto?

 Solution:
The function f is not onto because there is no integer x with x2 = −1, for instance.
One to One and Onto Function
(Bijection)
 A function that is both a one and onto function is called a bijective function.
 Here every element of the domain is connected to a distinct element in the
codomain and every element of the codomain has a pre-image.
 Also in other words every element of set A is connected to a distinct element in
set B, and there is not a single element in set B which has been left out.
 The function f is a one-to-one correspondence, or a bijection, if it is both one-to-
one and onto such a function is bijective.
 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:
 The function f is one-to-one and onto. It is one-to-one because no two values in
the domain are assigned the same function value. It is onto because all four
elements of the codomain are images of elements in the domain. Hence, f is a
bijection.

You might also like