1.8 Functions
1.8 Functions
Module #4:
Functions
Graphical Representations
• Functions can be represented graphically in
several ways:
f A B
• •
f • •
a• •
b
•
•
y
•
• •
x
A Bipartite Graph
B Plot
Like Venn diagrams
A Neat Trick
• Sometimes we write YX to denote the set F
of all possible functions f:XY.
• This notation is especially appropriate,
because for finite X, Y, we have |F| = |Y||X|.
• If we use representations F0, T1,
2:{0,1}={F,T}, then a subset TS is just
a function from S to 2, so the power set of S
(set of all such fns.) is 2S in this notation.
05/05/25 (c)2001-2003, Michael P. Frank 8
Module #4 - Functions
One-to-One Functions
• A function is one-to-one (1-1), or injective, or an injection,
iff every element of its range has only 1 pre-image.
– Formally: given f:AB,
“x is injective” : (x,y: xy f(x)f(y)).
• Only one element of the domain is mapped to any given
one element of the range.
– Domain & range have same cardinality. What about codomain?
• Memory jogger: Each element of the domain is injected
into a different element of the range.
– Compare “each dose of vaccine is injected into a different patient.”
One-to-One Illustration
• Bipartite (2-part) graph representations of
functions that are (or not) one-to-one:
• • • •
• • • • •
• • • •
• • • •
• • • • •
• •
• • •
Not one-to-one Not even a
One-to-one function!
Illustration of Onto
• Some functions that are, or are not, onto
their codomains:
•
• • • • • • • •
• • • • • • • •
• • • • • •
• • • •
• • • • • •
• •
Onto Not Onto Both 1-1 1-1 but
(but not 1-1) (or 1-1) and onto not onto
Bijections
• A function f is said to be a one-to-one
correspondence, or a bijection, or
reversible, or invertible, iff it is
both one-to-one and onto.
• For bijections f:AB, there exists an
inverse of f, written f 1:BA, which is the
unique function such that f 1 f I A
– (where IA is the identity function on A)
05/05/25 (c)2001-2003, Michael P. Frank 22
Module #4 - Functions
•
• • y y = I(x) = x
• •
• •
• •
Graphs of Functions
• We can represent a function f:AB as a set of
ordered pairs {(a,f(a)) | aA}. ← The function’s graph.
• Note that a, there is only 1 pair (a,b).
– Later (ch.6): relations loosen this restriction.
• For functions over numbers, we can represent
an ordered pair (x,y) as a point on a plane.
– A function is then drawn as a curve (set of points),
with only one y for each x.
1 .
x x & 1.6=1
0
x x . 1.4= 1
1 .
• Note that if xZ, 2 .
1.4
1.4= 2
x = x = x . 3 .. . 3
3=3= 3
3 +3 x
2