Mathematics

(a) Consider the function f : R → R given by f (x) = dxe2 for all x ∈ R.
(The ceiling of the real number x, denoted by dxe, is the smallest integer greater or equal to x.)
(i) Determine the range of f .
(ii) Determine the pre-image of A = {−1, 1} under f .
(iii) Determine the pre-image of B under f where B = 2Z, the set of even integers.
(iv) Is f injective? If not, determine a domain X ⊆ R such that f : X → R with f (x) = dxe2 is
injective.
(v) Is f surjective? If not, determine a co-domain Y ⊆ R such that f : R → Y with f (x) = dxe2
is surjective.
(b) Consider the function g : X → Y and sets A and B which are subsets of Y .
(i) Show that if A ⊆ B, then g −1 (A) ⊆ g −1 (B).
(ii) Is the converse of the statement in (i) true in general? Explain why.
Solution:
(a)

(i) The range of f are the perfect squares, i.e. any natural number that is the square of an
integer. Let C denote the set of perfect squares.
We first show that C ⊆ range(f ). Let z ∈ C, then z = k 2 for some k ∈ Z. But then
f (k) = k 2 = z and so z ∈ range(f ). It follows that C ⊆ range(f ).
Next we show that range(f ) ⊆ C. By definition, for real x we have dxe ∈ Z and so
f (x) = dxe2 ∈ C. Therefore, range(f ) ⊆ C and thus range(f ) = C.
(ii) Tip: Plot the function before determining the pre-images. Considering the graph of the
function will make more formal derivations much more amenable.
Note that dxe2 ≥ 0, so there is no x ∈ R such that f (x) = −1. Furthermore,
dxe2 = 1

⇐⇒
⇐⇒

dxe ∈ {−1, 1} ⇐⇒ −2 < x ≤ −1 or 0 < x ≤ 1
x ∈ (−2, −1] ∪ (0, 1].

READ ALSO :   UG Project Proposal Template 19.8.2013

Hence, f −1 (A) = (−2, −1] ∪ (0, 1].
(iii) The range of f are perfect squares, so for any x ∈ R we have f (x) = k 2 for some k ∈ Z.
Furthermore note that a perfect square number is even if and only if its square root is even.
Thus, in order for x to lie in the pre-image of B we need dxe = |k| to be even and so
dxe = 2n for some n ∈ Z. Now, dxe = 2n if and only if 2n − 1 < x ≤ 2n. Therefore,
f −1 (B) = ∪n∈Z (2n − 1, 2n].

1

(b) The function f is not injective, as {−1, 1} ⊆ R and f (−1) = 1 = f (1). If we choose X = N, then
f : X → R with f (x) = dxe2 becomes injective which can be shown as follows. For x1 , x2 ∈ N,
dx1 e2 = dx2 e2
⇐⇒
dx1 e = dx2 e
⇐⇒
x 1 = x2

as x ∈ N implies that dxe ≥ 0
as x ∈ N implies that dxe = x.

(c) The function f is not surjective, as x2 ≥ 0 for all x ∈ R and so range(f ) ⊆ [0, ∞). Choose
y = −1 ∈ R, then there is no x ∈ R such that f (x) = y. To make f surjective choose Y to be the
range of f , that is the set of perfect square numbers as shown in part (i).
(d)

(i) If x ∈ g −1 (A) then g(x) ∈ A ⊆ B and so g(x) ∈ B. It follows that x ∈ g −1 (B). Hence
g −1 (A) ⊆ g −1 (B).
(ii) The converse is not true in general. Consider g : R → R with g(x) = x2 . Let A = [− 21 , 1]
and B = [0, 1] ∪ {−1}. Then g −1 (A) = [−1, 1] = g −1 (B) and so g −1 (A) ⊆ g −1 (B). However,
A is not a subset of B and B is not a subset of A. Note that we can show for A ⊆ range(f ),
if g −1 (A) ⊆ g −1 (B), then A ⊆ B. Can you work out how?
B: Warm up Questions

READ ALSO :   Academic help online

(a) For each of the following categories give an example of a function f : N → N that is neither the
identity map nor constant everywhere. For each example explain why f has the stated properties.
(i) f is neither injective nor surjective,
(ii) f is injective but not surjective,
(iii) f is surjective but not injective,
(iv) f is both injective and surjective.
(b) Let X, Y, W and Z be non-empty sets such that Y ⊆ W . Consider two functions f : X → Y and
g : W → Z. The composition of f with g is the function g ◦ f from X to Z such that
g ◦ f (x)

=

g(f (x))

for all x ∈ X.

2
+ 1 for all x ∈ N. Let g : R → R+
0 with g(x) = x

2
x
for all x ∈ R. Then g ◦ f : N → R+
+ 1 . (Here R+ = (0, ∞) denotes the
0 with g ◦ f (x) =
2

Example: Let f : N → R+ with f (x) =

x
2

positive real numbers and R+
0 = [0, ∞) denotes the non-negative real numbers.)
(i) Let f : R → R such that f (x) = 2(x + 1) for all x ∈ R. Let g : R → R+ with g(x) = x2 + 1
for all x ∈ R. Determine f ◦ g, g ◦ f , f ◦ f and g ◦ g.
(ii) For two functions h1 : R → R and h2 : R → R, show that in general h1 ◦ h2 6= h2 ◦ h1 .
(c) Decide whether the proof below is a valid argument. If not, explain what went wrong.
2
I will show
√ that the range of f : [−1, 1] → R with f (x) = x + 1 is given by [1, 2]. Let y ∈ [1, 2],
then x = y − 1 ∈ [0, 1] and we have f (x) = y. Hence range(f ) ⊆ [1, 2]. Furthermore,
0 ≤ x2 + 1 ≤ 2

=⇒

0 ≤ x2 ≤ 1

=⇒

Hence [1, 2] ⊆ range(f ) and it follows that range(f ) = [1, 2].
2

READ ALSO :   Psychology

x ∈ [−1, 1].

C: Question to hand in

(a) Let A be a non-empty subset of the natural numbers. Let X = P(A)\{∅}, that is the power set
of A excluding the empty set. Consider f : X → A which pairs B ⊆ A with the smallest element
in B.
(i) Show that f is a function.
(ii) Is f injective? Explain why.
(iii) Is f surjective? Explain why.
(Hint: you may use without proof that any subset of the natural numbers has a unique least
element.)
(b) Consider a function g : A → B and sets C and D which are subsets of B. Show that
g −1 (C ∪ D)

=

g −1 (C) ∪ g −1 (D).

(c) Assume that two functions f : R → R and g : R → R are both injective. Is the composition g ◦ f
injective? If only g is injective, must g ◦ f be injective? Explain why.
(Hint: for a definition of a composition of functions see part (c) of the warm up questions.)

D: Further question
Let X = {−2, −1, 0, 1, 2} and let Y = {− 12 , 0, 1}.
(a) Consider the set of all functions g : X → Y . Suppose we randomly pick a function from this set
such that each function has equal probability of being picked. What is the probability of picking
a function that is not surjective?
(b) Consider the set of all functions f : Y → X. Suppose we randomly pick a function from this set
such that each function has equal probability of being picked. What is the probability of picking
a function that is injective?
(c) Let the function f : Y → X be given by f (y) = d2ye. Which distinct elements does the following
set contain?
n
o
Z =
f −1 (A) | A ∈ P(X) .
Explain why.