Functions Student Version
Functions Student Version
1
2
Reference
Rosen, H., K. (2019). Discrete Mathematics
and Its Applications, 8th edition.
3
Agenda
Definition of a Function.
Injection, Surjection, Bijection
4
Functions
Definition: Let A and B be nonempty sets. A
function f from A to B, denoted f: A → B is an
assignment of each element of A to exactly one
element of B. We write f(a) = b if b is the unique
element of B assigned by the function f to the
element a of A.
Functions are sometimes Students Grades
called mappings or A
transformations. Carlota Rodriguez
B
Sandeep Patel C
Jalen Williams D
F
Kathy Scott
5
Functions
A function f: A → B can also be defined as
a subset of A×B (a relation). This subset is
restricted to be a relation where no two
elements of the relation have the same
first element.
Specifically, a function f from A to B
contains one, and only one ordered pair
(a, b) for every element a∈ A.
6
Functions
Given a function f: A → B:
We say f maps A to B or
f is a mapping from A to B.
A is called the domain of f.
B is called the codomain of f.
If f(a) = b,
then b is called the image of a under f.
a is called the preimage of b.
The range of f is the set of all images of points in A under f.
We denote it by f(A).
Two functions are equal when they have the same domain,
the same codomain and map each element of the
domain to the same element of the codomain.
7
Representing Functions
Functions may be specified in different ways:
An explicit statement of the assignment.
Students and grades example.
A formula.
f(x) = x + 1
A computer program
A Python program
Given a communication range value
Given the number of network nodes
A connected network is generated
8
The domain of f is ? b
y
c
The codomain of f is ?
d z
The preimage of y is ?
f(A) = ?
The preimage(s) of z is (are) ?
9
If and S is a subset of A,
then
A B
f {a,b,c,} is ? a
x
b
f {c,d} is ? y
c
d z
10
Injections
Definition: A function f is said to be one-to-
one , or injective, if and only if f(a) = f(b)
implies that a = b for all a and b in the
domain of f.
A
a
B
x
v
b
y
c
z
d
w
14
Examples on Injections
Examples on Injections
Surjections
Definition: A function f from A to B is called
onto or surjective, if and only if for every
element there is an element
with .
A B
a x
b
y
c
z
d
17
Bijections
Definition: A function f is a one-to-one
correspondence, or a bijection, if it is both
one-to-one and onto (surjective and
injective).
A B
a x
b
y
c
d z
w
18
Examples