0% found this document useful (0 votes)
2 views30 pages

Functions 2025

The document provides definitions and characteristics of functions, including terms such as domain, codomain, range, and types of functions like one-to-one (injective), onto (surjective), and bijective. It explains how to determine if a function is one-to-one or onto, and discusses the composition of functions, emphasizing that function composition is not commutative but is associative. Additionally, it includes examples and exercises to illustrate these concepts.

Uploaded by

a70198818
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views30 pages

Functions 2025

The document provides definitions and characteristics of functions, including terms such as domain, codomain, range, and types of functions like one-to-one (injective), onto (surjective), and bijective. It explains how to determine if a function is one-to-one or onto, and discusses the composition of functions, emphasizing that function composition is not commutative but is associative. Additionally, it includes examples and exercises to illustrate these concepts.

Uploaded by

a70198818
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Functions

Objective
• Define and use the terms function, domain, codomain, range, image,
inverse image (preimage), and composition.
• State the definitions of one-to-one functions (injections), onto
functions (surjections), and one-to-one correspondences (bijections).
Determine which of these characteristics is associated with a given
function.
• State the definition of recurrence relation and use of recurrence
relation.
OUTCOME
• To prove that a given function is one-to-one, or give a counterexample
to show that it is not.
• To prove that a given function is onto, or give a counterexample to
show that it is not.
• To describe the connection between bijective functions and inverses.
• To find the inverse of an invertible function
• Use of recurrence relations in real time example
Functions
Definition: Let A and B be two sets. A function from A to B,
denoted f : A →B , is an assignment of exactly one element of
B to each element of A.
We write f(a) = b to denote the
assignment of b to an element a of A
by the function f.
Functions
1.
Definition: Let A and B be two
sets. A function from A to B,
denoted f : A →B , is an
assignment of exactly one
element of B to each element of
A. 2.

We write f(a) = b to denote the


assignment of b to an element a
of A by the function f.
Functions
• A function f from a set A to a set B assigns each element of A to
exactly one element of B.
• A is called domain of f , and B is called codomain of f .
• If f maps element a ∈ A to element b 2∈ B, we write f (a) = b
• If f (a) = b, b is called image of a; a is in preimage of b.
• Range of f is the set of all images of elements in A.
Definition of a function
• A function takes an element from a set and maps it to a UNIQUE
element in another set f maps R to Z
Domain R Z Co-domain
f

f(4.3)
4.3 4

Pre-image of 4 Image of 4.3


More functions
A pre-image The image
Domain Co-domain of 1 of “a”

Ayush A “a” 1
Samir B “bb“ 2
kanan C “cccc” 3
Dev D “dd” 4
mayur F “e” 5

A class grade function A string length function


Even more functions

Range

a 1 “a” 1
e 2 “bb“ 2
i 3 “cccc” 3
o 4 “dd” 4
u 5 “e” 5

Some function… Not a valid function!


Also not a valid function!
Function Examples and Non
Examples
1
2

3
4
Function arithmetic
• Let f1(x) = 2x
• Let f2(x) = x2

• f1+f2 = (f1+f2)(x) = f1(x)+f2(x) = 2x+x2

• f1*f2 = (f1*f2)(x) = f1(x)*f2(x) = 2x*x2 = 2x3


One-to-one functions
• A function f is called one-to-one if and only if f (x ) = f (y)
implies x = y for every x , y in the domain of f :
x , y. (f (x ) = f (y) → x = y)
• One-to-one functions never assign different elements in the
domain to the same element in the codomain:
• x , y. (x ≠ y → f (x ) ≠ f (y))
• A one-to-one function also called injection or injective function
One-to-one functions
• A function is one-to-one if each element in the co-domain has a
unique pre-image
• Formal definition: A function f is one-to-one if f(x) = f(y) implies x = y.
a 1 a 1
e 2 e 2
i 3 i 3
o 4 o 4
5 5

A one-to-one function A function that is


not one-to-one
One-to-one

1.Consider the function f (x ) = x 2 from set of integers to set of


integers. Is this injective?
2. What about if the domain of f is the set of non-negative integers?

Sol: 1. The function f (x) = x2 is not one-to-one because, for instance, f (1) = f
(−1) = 1,but 1 ≠ −1.
2. f (x) = x2 with its domain restricted to Z+ is one-to-one.
Example
• 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. To see this, note that if x and y are two different workers, then
• f (x) ≠ f (y) because the two workers x and y must be assigned
different jobs.
Exercise
• Determine whether each of these functions from Z to Z is one-to-one.
a) f (n) = n − 1
b) f (n) = n2 + 1
c) f (n) = n3
Onto Functions
• A function f from A to B is called onto iff for every element
• y ∈ B, there is an element x ∈ A such that f (x ) = y:
• y ∈ B. x ∈ A. f (x ) = y
• Onto functions also called surjective functions or surjections
• For onto functions, range and codomain are the same
1 2
Onto functions
• A function is onto if each element in the co-domain is an image of
some pre-image
• Formal definition: A function f is onto if for all y  C, there exists x  D
such that f(x)=y.
a 1 a 1
e 2 e 2
i 3 i 3
o 4 o 4
u 5

An onto function A function that


is not onto
Example
• 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 Fig. Note that if the codomain
were {1, 2, 3, 4}, then f would not be onto. Fig. Onto functions
Onto vs. one-to-one
• Are the following functions onto, one-to-one, both, or
neither?

a 1 a 1
a 1
b 2 b 2
b 2
c 3 c 3
c 3
4 d 4
4
1-to-1, not onto Both 1-to-1 and onto Not a valid function

a 1 a 1
b 2 b 2
c 3 c 3
d d 4
Onto, not 1-to-1 Neither 1-to-1 nor onto
Exercise
• Determine whether the function f : Z × Z → Z is onto
• If a) f (m, n) = m + n.
b) f (m, n) = m2 + n2.
c) f (m, n) = m.
d) f (m, n) = |n|.
e) f (m, n) = m − n.
Bijections
a 1
• Consider a function that is b 2
both one-to-one and onto: c 3
d 4

• Such a function is a one-to-one correspondence, or a bijection

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?

Consider the function f in above Example that assigns jobs to


workers. The function f is onto if for every job there is a worker
assigned this job. The function f is not onto when there is at
least one job that has no worker assigned it.
Exercise
• Determine whether each of these functions is a bijection
• from R to R.
• a) f (x) = 2x + 1
• b) f (x) = x2 + 1
• c) f (x) = x3
• d) f (x) = (x2 + 1)/(x2 + 2)
Composition of function
• Let g be a function from the set A to the set B and let f be a function
from the set B to the set C. The composition of the functions f and g,
denoted for all a ∈ A by f ◦ g, is defined by
• (f ◦ g)(a) = f (g(a)).
Compositions of functions:
(f ○ g)(x) = f(g(x))
f○g

A B C
g f

g(a) f(b)

a f(g(a))
b = g(a)

(f ○ g)(a)
Compositions of functions
Let f(x) = 2x+3 f○g
Let g(x) = 3x+2
R R R
g f

g(1) f(5)
f(g(1))=13
1
g(1)=5

(f ○ g)(1)

f(g(x)) = 2(3x+2)+3 = 6x+7


Compositions of functions
Does f(g(x)) = g(f(x))?

Let f(x) = 2x+3 Let g(x) = 3x+2

f(g(x)) = 2(3x+2)+3 = 6x+7


g(f(x)) = 3(2x+3)+2 = 6x+11 Not equal!

Function composition is not commutative!


Exercise
• Prove that Composition of function is associative.
• Consider three functions f:AB,g:BC and h:CD
• Then h◦(g◦f) and (h◦g)◦f are functions from AD
Example
• Let f:ZZ where f(x)=3x and g:ZZ where g(x)=x2
• What are g ◦ f (2) and f◦g(2)
• Are there any value for which g ◦ f(x) = f ◦g(x)?
• g ◦ f(2)=g(f(2))=g(3*2)=g(6)=6^2=36.
• f ◦g(2)=f(g(2) )=f(4)=3*4=12
• g ◦ f(x)=g(f(x))=g(3x)=(3x)2
• f ◦g(x)=f(g(x))=f(x2)=3x2
• g ◦ f(x) = f ◦g(x) when x=0
Exercise:
• Consider the function f(x)=2x-3 and g(x)=x2+3x+5. Find the formula for
the composition function (i) g ◦ f ii) f ◦g.

You might also like