i
i
i
i
i
i
i
i
2.1. Sets and Mappings 15
2.1.1 Inverse Mappings
If we have a function f : A → B, there may exist an inverse function f
−1
: B →
A, which is definedbytherulef
−1
(b)=a where b = f (a).Thisdefinition only
works if every b ∈ B is an image of some point under f (that is, the range equals
the target) and if there is only one such point (that is, there is only one a for which
f(a)=b). Such mappings or functions are called bijections. A bijection maps
every a ∈ A to a unique b ∈ B, and for every b ∈ B, there is exactly one a ∈ A
such that f(a)=b (Figure 2.1). A bijection between a group of riders and horses
indicates that everybody rides a single horse, and every horse is ridden. The two
functions would be rider(horse) and horse(rider). These are inverse functions of
each other. Functions that are not bijections have no inverse (Figure 2.2).
An example of a bijection is f : R → R,with f (x)=x
3
.Theinverse
function is f
−1
(x)=
3
√
x. This example shows that the standard notation can be
Figure 2.2. The function
g
does not have an inverse
because two elements of d
map to the same element
of E. The function
h
has no
inverse because element
T
of F has no element of d
mapped to it.
somewhat awkward because x is used as a dummy variable in both f and f
−1
.It
is sometimes more intuitive to use different dummy variables, with y = f (x) and
x = f
−1
(y). This yields the more intuitive y = x
3
and x =
3
√
y. An example of a
function that does not have an inverse is sqr : R → R,wheresqr(x)=x
2
.This
is true for two reasons: first x
2
=(−x)
2
, and second no members of the domain
map to the negative portions of the target. Note that we can define an inverse if
we restrict the domain and range to R
+
.Then
√
x is a valid inverse.
2.1.2 Intervals
Often we would like to specify that a function deals with real numbers that are
restricted in value. One such constraint is to specify an interval. An example of
an interval is the real numbers between zero and one, not including zero or one.
We denote this (0, 1). Because it does not include its endpoints, this is referred
to as an open interval. The corresponding closed interval, which does contain its
endpoints, is denoted with square brackets: [0, 1]. This notation can be mixed, i.e.,
[0, 1) includes zero but not one. When writing an interval [a, b], we assume that
a ≤ b. The three common ways to represent an interval are shown in Figure 2.3.
The Cartesian products of intervals are often used. For example, to indicate that
a point x is in the unit cube in 3D, we say x ∈ [0, 1]
3
.
a < x < b
(a, b ]
a
b
_
Figure 2.3. Three equiv-
alent ways to denote the
interval from
a
to
b
that
includes
b
but not
a
.
Intervals are particularly useful in conjunction with set operations: intersec-
tion, union,anddifference. For example, the intersection of two intervals is the
set of points they have in common. The symbol ∩ is used for intersection. For ex-
ample, [3, 5)∩[4, 6] = [4, 5). For unions, the symbol ∪ is used to denote points in
either interval. For example, [3, 5) ∪[4, 6] = [3, 6]. Unlike the first two operators,
the difference operator produces different results depending on argument order.