You are on page 1of 8

EECS 203: Discrete Mathematics

Fall 2019
Discussion 4 Notes
1 Definitions
• Function f : A → B:

• Onto:

• One-to-One:

• Bijection:

• f −1 :

• f ◦ g:

• Recurrence relation

• Countably Infinite

• Uncountably Infinite

• Schroder-Bernstein Theorem

Solution:

• Function f : A → B: A function f is a relation between two sets, say A and B,


such that it associates each element of set A to exactly one element from the set
B. The set A and set B are respectively called the domain and codomain of f . If
f (a) = b, b is called the image of a under f . The range of f is the set of images of
all elements in the domain A.

• Onto: A function f from A to B is called onto, or a surjection, if and only if for


every element b ∈ B, there is an element a ∈ A with f (a) = b. A function f is
called surjective if it is onto.

• One-to-One: A function f is said to be one-to-one, or an injunction, if and only


if f (a) = f (b) implies that a = b for all a and b in the domain of f . A function is
said to be injective if it is one-to-one.

1
• Bijection: A function f is called a bijection (or one-to-one correspondence) if it
is both one-to-one and onto.

• f −1 : Let f be a bijection from the set A to the set B. The inverse function of f is
the function that assigns to an element b belonging to B the unique element a in A
such that f (a) = b. The inverse function of f is denoted by f −1 . Hence, f −1 (b) = a
when f (a) = b.

• f ◦ g: Let g be a function from the set A to the set B and let f be a function from
the set B to the set C. The composition of the functions f and g, denoted for all
a ∈ A by f ◦ g, is defined by (f ◦ g)(a) = f (g(a)).

• Recurrence relation: A recurrence relation for the sequence {an } is an equation


that expresses {an } in terms of one or more of the previous terms of the sequence.
A sequence is called a solution of a recurrence relation if its terms satisfy the
recurrence relation.

• Countably Infinite: A set is countably infinite if it has the same cardinality as


the natural numbers. This can be proven for a set by finding a one-to-one corre-
spondence between it and the natural numbers (because of the Schroder-Berstein
Theorem, as defined below). N, Z, and Q are common examples of sets that are
countably infinite.

• Uncountably Infinite: A set is said to be uncountably infinite if its cardinality


is larger than that of the set of all natural numbers. R is one example of a set that
is uncountably infinite.

• Schroder-Bernstein Theorem: For two sets A and B, if |A| ≤ |B| and |B| ≤ |A|,
then |A| = |B|. Note that finding an one-to-one function from A to B shows that
|A| ≥ |B|, and finding a one-to-one function from A to B shows that |A| ≤ |B|.

1. Exercise 2.3.21
Give an explicit formula for a function from the set of integers to the set of positive integers
f : Z → Z+ that is:

a) one-to-one, but not onto

b) onto, but not one-to-one

c) one-to-one and onto

d) neither one-to-one nor onto

2
Solution:

a) The function f (x) with f (x) = 3x + 1 when x ≥ 0 and f (x) = −3x + 2 when x < 0.

b) f (x) = |x| + 1

c) f (x) = −2x when x < 0 and f (x) = 2x + 1 when x ≥ 0

d) f (x) = x2 + 1

2. Exercise 2.3.37
If f and f ◦ g are onto, does it follow that g is onto? Justify your answer.

Solution: No. For example, suppose that A = {a}, B = {b, c}, and C = {d}. Let
g(a) = b, f (b) = d, and f (c) = d. Then f and f ◦ g are onto, but g is not.

3. Exercise 2.3.72
Suppose that f is an invertible function from Y to Z and g is an invertible function from X
to Y . Show that the inverse of the composition f ◦ g is given by (f ◦ g)−1 = g −1 ◦ f −1 .

Solution:
We want to show that (g −1 ◦f −1 )◦(f ◦g)(x) = x for all x ∈ X and (f ◦g)◦(g −1 ◦f −1 )(z) = z
for all z ∈ Z. We can apply the definition of the composition function to prove this. So,
for every x ∈ X, we have:

(g −1 ◦ f −1 ) ◦ (f ◦ g)(x) = (g −1 ◦ f −1 )((f ◦ g)(x))


= (g −1 ◦ f −1 )(f (g(x)))
= g −1 (f −1 (f (g(x))))
= g −1 (g(x))
=x

Similarly for every z ∈ Z, we have:

(f ◦ g) ◦ (g −1 ◦ f −1 )(z) = (f ◦ g)((g −1 ◦ f −1 )(z))


= (f ◦ g)(g −1 (f −1 (z)))
= f (g(g −1 (f −1 (z))))
= f (f −1 (z))
=z

3
We have shown that (f ◦ g)−1 = g −1 ◦ f −1 .

4. Not in Book - One-to-one and Onto


Prove or disprove the following.
1
a) f : R −→ R, f (x) = x2 +1
is onto
b) f : R −→ R, f (x) = |3x + 1| is one-to-one

Solution:
a) To disprove this, we can provide a counterexample. There is no value that will make
1
x2 +1
= 2.
1
=2
x2 + 1
2x2 + 2 = 1
It is easy to see that 2x2 + 2 will never be less than 2, and therefore never equal to 1.
There are many other possible counterexamples as well; any value that is not in the
range of (0, 1] will not get mapped to.

b) To disprove this, we can give a counterexample to show two values from the domain
that are not equal and map to the same value in the codomain. There are many
possible counterexamples here, but we will show that inputs of x = 1 and x = − 53
map to the same value.
x=1
f (1) = |3(1) + 1|
f (1) = |4|
f (1) = 4

x = −5/3
f (−5/3) = |3(−5/3) + 1|
f (−5/3) = | − 5 + 1|
f (−5/3) = | − 4|
f (−5/3) = 4
We can see that both x=1 and x=-5/3 map to the same value, 4. Therefore, f(x) is
not one-to-one.

4
5. Exercise 2.4.13 (b,d,f )
Is the sequence {an } a solution of the recurrence relation an = 8an−1 − 16an−2 if

b) an = 1

d) an = 4n

f) an = 2 · 4n + 3n4n

Solution:

b) 8an−1 −16an−2 = 8−16 = −8 6= an , so it is not a solution of the recurrence relation.

d) 8an−1 − 16an−2 = 8 · 4n−1 − 16 · 4n−2 = 4n = an , so it is a solution of the recurrence


relation.

f)

8an−1 − 16an−2 = 8 · 2 · 4n−1 + 8 · 3(n − 1)4n−1 − 16 · 2 · 4n−2 − 16 · 3(n − 2)4n−2


= 4n−2 (8 · 2 · 4 + 8 · 3(n − 1)4 − 16 · 2 − 16 · 3(n − 2))
= (32 + 48n)4n−2
= 2 · 4n + 3n4n = an

Thus an is a solution of the recurrence relation.

6. Exercise 2.4.17 (a,c)


Find the solution to each of these recurrence relations and initial conditions. Use an iterative
approach such as that used in Example 10.

a) an = 3an−1 , a0 = 2

c) an = an−1 + n, a0 = 1

Solution:

a) an = 3an−1 = 32 an−2 = · · · = 3n a0 = 2 · 3n

c) an = an−1 + n = an−2 + n − 1 + n = · · · = a0 + 1 + 2 + · · · + n = 1 + n(n + 1)/2

5
7. Exercise 2.4.35
Show that nj=1 (aj − aj−1 ) = an − a0 , where a0 , a1 , ..., an is a sequence of real numbers.
P
This type of sum is called telescoping.

Solution:

n
X
(aj − aj−1 ) = a1 − a0 + a2 − a1 + ... + an − an−1
j=1

= an − a0

8. Not in Book
Find the value of each of these sums.
6
((−1)k − 1k )
P
a)
k=0

6
(1281/k − 1281/(k+1) )
P
b)
k=1

n
(3k 2 + k + 2)
P
c)
k=1

Solution:

a) When k is even, (−1)k − 1k = 0, and when k is odd, (−1)k − 1k = −2. Thus the sum
can be rewritten as 0 + (−2) + 0 + (−2) + 0 + (−2) + 0 = −6.

b) This is a telescoping series. Every term other than the first and last term cancel out.
(1281/1 − 1281/2 ) + (1281/2 − 1281/3 ) + ... + (1281/5 − 1281/6 ) + (1281/6 − 1281/7 ) =
128 − 1281/7 . We know that 27 = 128, so 1281/7 = 2. The sum will evaluate to
128 − 1281/7 = 128 − 2 = 126.

6
c)
n
X n
X n
X n
X
(3k 2 + k + 2) = 3 k2 + k+ 2
k=1 k=1 k=1 k=1
n(n + 1)(2n + 1) n(n + 1)
=3 + + 2n
6 2
n(n + 1)(2n + 1) n(n + 1)
= + + 2n
2 2
2n3 + 3n2 + n n2 + n
= + + 2n
2 2
= n3 + 2n2 + 3n

9. Exercise 2.5.2 (a,c,d,e)


Determine whether each of these sets is finite, countably infinite, or uncountable. For those
that are countably infinite, exhibit a one-to-one correspondence between the set of positive
integers and that set.
a) the integers greater than 10
c) the integers with absolute value less than 1,000,000
d) the real numbers between 0 and 2
e) the set A × Z+ where A = {2, 3}

Solution:
For each part, we will denote the set in question as S.
a) This is countably infinite. The function f : Z+ → S, f (x) = x + 10 is a one-to-one
correspondence between S and Z+ .
c) This is finite. It is the integers in the range
{−999, 999, −999, 998, ..., −1, 0, 1, ..., 999, 998, 999, 999}
d) This is uncountable. We proved in lecture that (0, 1) is uncountable, which is a subset
of this set.
e) This is countably infinite. The function
g : Z+ → S, g(x) =
(2, x+12
) if x is odd
(3, x2 ) if x is even
is a one-to-one correspondence between S and Z+ .

7
10. Exercise 2.5.11
Give an example of two uncountable sets A and B such that A ∩ B is
a) finite
b) countably infinite
c) uncountably infinite

Solution:
There are a lot of possible answers, but here are a few:
a) A = [0, 1) and B = (−1, 0]. A ∩ B = {0}
b) A = R+ and B = R− ∪ Z+ . A ∩ B = Z+
c) A = [0, 2] and B = [1, 3]. A ∩ B = [1, 2]

You might also like