M ACM 101
Relations & Functions
Page 1
M ACM 101
Invertible Functions
f
A
M ACM 101
g
Page 2
Example
1
E.g. f ,g : R " R, f (x) = 2x + 5, g(x) = (x # 5).
2
Def. 5.21 If f : A " B, then f is said to be invertible if there is a
function g : B " A such that g o f = 1A and f o g = 1B.
!
Relations & Functions
!
B
Relations & Functions
Page 3
M ACM 101
Relations & Functions
Invertible Functions
When is a function invertible?
Theorem 5.7. An invertible function of f : A " B is unique.
Theorem 5.8 A function f : A " B is invertible if and only if
it is one - to - one and onto.
(Since it is unique, we use f -1 to represent the inverse of f .)
Proof :
Page 4
Theorem 5.9 If f : A " B,g : B " C are invertible functions, then
g o f : A " C is invertible and (g o f) -1 = f #1 o g#1 .
!
E.g. is the function f: R ! R defined by f(x) = x2 invertible?
!
M ACM 101
Relations & Functions
Page 5
M ACM 101
Relations & Functions
How do we find the inverse of a
function?
Another Example
E.g. f : R " R = {(x, y) | y = mx + b}
E.g. f : R " R + , f(x) = e x
Page 6
!
Theorem 5.11 Let f : A " B for finite sets A and B, where
| A |=| B | . Then the following statements are equivalent :
(a) f is one - to - one
(b) f is onto
(c) f is invertible.
!
M ACM 101
Relations & Functions
Page 7
Section 5.7:
Computational Complexity
An algorithm is a finite sequence of unambiguous steps for
solving a problem or completing a task in a finite amount of
time.
M ACM 101
Relations & Functions
Algorithms
Some examples of problems that require algorithms:
!
Determining whether a certain real number x is present in
the list of n real numbers a1, a2, …, an.
!
Sorting a list of n words
!
Computing the value cn, where c is a constant and n is
given as input to the algorithm
An algorithm must be:
•
A correct algorithm solves the problem providing the same
(and correct) results (outputs) each time it is provided with
the same inputs.
An algorithm should be general, that is, it should not only
apply to a particular instance of a problem but to any
instance of the problem.
Page 8
M ACM 101
Relations & Functions
Page 9
M ACM 101
Algorithm Efficiency
!
!
Relations & Functions
Algorithm Efficiency
When an algorithm correctly solves a type of problem
satisfying the conditions just described, then one may be
interested in finding about its efficiency
Two ways to measure efficiency:
Space complexity:
It will also be useful to be able to compare different
algorithms to solve the same problem:
•
Involves the analysis of the memory required for an
algorithm to execute
•
Depends on the particular data structure used to
implement the algorithm
•
We won’t talk about this form of efficiency, although
you may revisit it in a future course
•
!
Page 10
How do we measure algorithm efficiency?
M ACM 101
Relations & Functions
Page 11
M ACM 101
Relations & Functions
Algorithm Efficiency
Measuring Time Efficiency
Time complexity:
!
•
Involves the analysis of the running time expressed in
terms of number of operations performed by the
algorithm as a function of the data input size
•
For example, if we want to sort n names by
alphabetical order, the running time will be expressed
as a function of n.
Some steps are designated as the most critical
•
!
!
We then count the number of times these steps are
executed
•
This generally depends on the input data
•
i.e. it is a function f(n) of the input data size n
We calculate the order of the function f
Page 12
© Copyright 2026 Paperzz