Functions 2025
Functions 2025
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.
f(4.3)
4.3 4
Ayush A “a” 1
Samir B “bb“ 2
kanan C “cccc” 3
Dev D “dd” 4
mayur F “e” 5
Range
a 1 “a” 1
e 2 “bb“ 2
i 3 “cccc” 3
o 4 “dd” 4
u 5 “e” 5
3
4
Function arithmetic
• Let f1(x) = 2x
• Let f2(x) = x2
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
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
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)