0% found this document useful (0 votes)
7 views26 pages

HW2 Sets and Functions

The document contains a series of homework problems and solutions related to set theory, including determining the truth values of various set statements, proving properties of sets, and demonstrating relationships between sets. It covers topics such as power sets, Cartesian products, and De Morgan's laws. The problems are structured with clear answers and proofs, showcasing the application of set theory concepts.

Uploaded by

damchitrung9727
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views26 pages

HW2 Sets and Functions

The document contains a series of homework problems and solutions related to set theory, including determining the truth values of various set statements, proving properties of sets, and demonstrating relationships between sets. It covers topics such as power sets, Cartesian products, and De Morgan's laws. The problems are structured with clear answers and proofs, showcasing the application of set theory concepts.

Uploaded by

damchitrung9727
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Homework 2

Section 2.1–2.5 & 8.2


Dam Chi Trung - 2453334
April 27, 2025

Section 2.1
Problem 11
Determine whether each of these statements is true or false.

• a) 0 ∈ ∅
• b) ∅ ∈ {0}
• c) {0} ⊂ ∅
• d) ∅ ⊂ {0}

• e) {0} ∈ {0}
• f) {0} ⊂ {0}
• g) {∅} ⊆ {∅}
Answer:
a) False. Because the empty set ∅ contains no elements, so 0 cannot be inside this set.
b) False. The set {0} contains only the element 0, and ∅ is not equal to 0.
c) False. {0} contains an element, but ∅ has none, so {0} is not a subset of ∅.
d) True. Every set contains the empty set as a subset, since ∅ has no elements to violate subset
conditions.
e) False. {0} is a set containing 0, but not equal to 0, so it’s not an element of itself.
f) True. Every set is a subset of itself.
g) True. Both sets are equal and contain the same element ∅, so the subset relation holds.

Problem 12
Determine whether these statements are true or false.

• a) ∅ ∈ {∅}
• b) ∅ ∈ {∅, {∅}}
• c) {∅} ∈ {∅}

• d) {∅} ∈ {{∅}}
• e) {∅} ⊂ {∅, {∅}}
• f) {{∅}} ⊂ {∅, {∅}}
• g) {{∅}} ⊂ {{∅}, {∅}}

1
Answer:
a) True. The set {∅} contains exactly one element: ∅.
b) True. The set {∅, {∅}} has ∅ as one of its elements.
c) False. The set {∅} contains ∅, not the set {∅} itself.
d) True. {{∅}} contains one element, which is {∅}, matching the left side.
e) True. All elements of {∅} are also in the set {∅, {∅}}, so it is a proper subset.
f) True. The element {∅} exists in the right-hand set, so the left set is a subset.
g) False. Both sets are equal: they contain the same element {∅} (even though it’s repeated), so it’s
not a proper subset.

Problem 13
Determine whether each of these statements is true or false.
• a) x ∈ {x}
• b) {x} ⊆ {x}
• c) {x} ∈ {x}
• d) {x} ∈ {{x}}
• e) ∅ ⊆ {x}
• f) ∅ ∈ {x}
Answer:
a) True. The set {x} contains the element x.
b) True. Any set is a subset of itself.
c) False. The set {x} contains the element x, not the set {x} itself.
d) True. The set {{x}} contains one element, which is {x}.
e) True. The empty set is a subset of every set.
f) False. Unless x = ∅, then ∅ ∈
/ {x}.

Problem 26
Determine whether each of these sets is the power set of a set, where a and b are distinct elements.
• a) ∅
• b) {∅, {a}}
• c) {∅, {a}, {∅, a}}
• d) {∅, {a}, {b}, {a, b}}
Answer:
a) False. Because every power set includes at least 1 element.
b) True. This is a power set of {a}.
c) False. This set has 3 elements ̸= 2n .
d) True. This is a power set of {a, b}.

Problem 27
Prove that P(A) ⊆ P(B) if and only if A ⊆ B.
Answer:

Assume P(A) ⊆ P(B). Show that A ⊆ B: Let a ∈ A. Then {a} ⊆ A, so {a} ∈ P(A). Since
P(A) ⊆ P(B), it follows that {a} ∈ P(B), which means {a} ⊆ B, so a ∈ B. Therefore, A ⊆ B.
Assume A ⊆ B. Show that P(A) ⊆ P(B): Let X ∈ P(A). Then X ⊆ A. Since A ⊆ B, we have
X ⊆ B, so X ∈ P(B). Therefore, P(A) ⊆ P(B).

2
Problem 28
Show that if A ⊆ C and B ⊆ D, then A × B ⊆ C × D.
Answer: A × B creates a pair (x, y) where x ∈ A and y ∈ B. Since A ⊆ C, we have x ∈ C, and since
B ⊆ D, it follows that y ∈ D. Therefore, the pair (x, y) ∈ C × D, which implies that A × B ⊆ C × D.

Problem 41
Explain why A × B × C and (A × B) × C are not the same.
Answer:
A × B × C creates a pair (x, y, z) where x ∈ A, y ∈ B and z ∈ C.
However, (A × B) × C creates a pair ((x, y), z), where (x, y) ∈ (A × B), and z ∈ C.

Problem 42
Explain why (A × B) × (C × D) and A × (B × C) × D are not the same.
Answer:
(A × B) × (C × D) creates a pair ((a, b), (c, d)), where (a, b) ∈ A × B, and (c, d) ∈ C × D.
Meanwhile, A × (B × C) × D creates a pair ((a), (b, c), d), where a ∈ A, (b, c) ∈ B), and d) ∈ D).

Problem 43
Prove or disprove that if A and B are sets, then:

P(A × B) = P(A) × P(B)

Answer: False (by counterexample).


Let A = {x}, B = {y, z}. Then:

A × B = {(x, y), (x, z)} ⇒ |P(A × B)| = 22 = 4

P(A) = {∅, {x}} ⇒ |P(A)| = 2


P(B) = {∅, {y}, {z}, {2, 3}} ⇒ |P(B)| = 4
⇒ |P(A) × P(B)| = 2 × 4 = 8
Since 4 ̸= 8, the statement is not true.

Problem 44
Prove or disprove: If A, B, C are nonempty sets and

A × B = A × C,

then B = C.
Answer: True.
Proof: Assume A ̸= ∅ and A × B = A × C.
Let b ∈ B. Since A ̸= ∅, choose a ∈ A. Then (a, b) ∈ A × B = A × C ⇒ b ∈ C. So B ⊆ C.
Similarly, for c ∈ C, (a, c) ∈ A × C = A × B ⇒ c ∈ B. So C ⊆ B.
Conclusion: B = C

Section 2.2
Problem 15
Prove the second De Morgan law in Table 1 by showing that if A and B are sets, then
A ∪ B = A ∩ B.
a) by showing each side is a subset of the other side.

3
b) using a membership table.
Answer:
a) Case 1: Show that A ∪ B ⊆ A ∩ B:
Let x ∈ A ∪ B. Then x ∈/ A ∪ B, so x ∈
/ A and x ∈
/ B.
Therefore, x ∈ A or x ∈ B, which means x ∈ A ∩ B.
Hence, A ∪ B ⊆ A ∩ B.
Case 2:Show that A ∩ B ⊆ A ∪ B:
Let x ∈ A ∩ B. Then x ∈ A or x ∈ B, so x ∈/ A and x ∈
/ B.
Therefore, x ∈
/ A ∪ B, which means x ∈ A ∪ B.
Hence, A ∩ B ⊆ A ∪ B.
Therefore, A ∪ B = A ∩ B.

b)

x∈A x∈B x∈A∪B x∈A x∈A∩B


F F T T T
F T F T F
T F F F F
T T F F F

Problem 16
Let A and B be sets. Show that
a) A ∩ B ⊆ A
b) A ⊆ A ∪ B
c) A − B ⊆ A
d) A ∩ (B − A) = ∅
e) A ∪ (B − A) = A ∪ B
Answer:
• a) Let x ∈ A ∩ B. So x ∈ A and x ∈ B.
• b) Let x ∈ A. Then x ∈ A ∪ B because it creates a value ∈ A or ∈ B. Therefore, A ⊆ A ∪ B.
• c) Let x ∈ A − B. Because x is in A but not in B. So it still belongs to A. Therefore, A − B ⊆ A.
• d) Let x ∈ B − A and y ∈ A. Because x is in B but not in A, so the intersection between x and y
is empty.
• e) The set B − A has elements from B that are not already in A.Therefore, the union of A with
B − A is exactly the same as the union of A and B.

Problem 17
Show that if A and B are sets in a universe U , then A ⊆ B if and only if A ∪ B = U .
Answer: Let
U = {1, 2, 3, 4}, A = {3, 4}, B = {1, 2, 3}.
Then
A = {1, 2}, A ∪ B = {1, 2, 3} =
̸ U.
Thus this does not contradict
A ⊆ B ⇐⇒ A ∪ B = U.
.

4
Problem 19
Show that if A, B, and C are sets, then A ∩ B ∩ C = A ∪ B ∪ C.
a) by showing each side is a subset of the other side.
b) using a membership table.
Answer:
a) Let x ∈ A ∩ B ∩ C. Then
  
x∈/ A∩B∩C =⇒ x ∈ /A ∨ x∈ / C =⇒ x ∈ A ∨ x ∈ B ∨ x ∈ C =⇒ x ∈ A∪B∪C.
/B ∨ x∈

b)

x∈A x∈B x∈C x∈A∩B∩C x∈


/A x∈
/B x∈
/C x∈A∪B∪C
T T T T F F F F
T T F F F F T T
T F T F F T F T
T F F F F T T T
F T T F T F F T
F T F F T F T T
F F T F T T F T
F F F F T T T T

Problem 20
Let A, B, and C be sets. Show that
a) (A ∪ B) ⊆ (A ∪ B ∪ C).
b) (A ∩ B ∩ C) ⊆ (A ∩ B).
c) (A − B) − C ⊆ A − C.
d) (A − C) ∩ (C − B) = ∅.
e) (B − A) ∪ (C − A) = (B ∪ C) − A.
Answer:
a) Let x ∈ (A ∪ B) and y ∈ C. (A ∪ B ∪ C) includes x and y. Therefore, (A ∪ B) ⊆ (A ∪ B ∪ C).
b) Let x ∈ A ∩ B ∩ C. Then x ∈ A and x ∈ B, so x ∈ A ∩ B, hence (A ∩ B ∩ C) ⊆ (A ∩ B).
c) Let x ∈ (A−B)−C. Then x ∈ A\B and x ∈
/ C, so x ∈ A and x ∈
/ C, hence (A−B)−C ⊆ A−C.
d) If x ∈ (A − C) ∩ (C − B) then x ∈
/ C and x ∈ C, a contradiction, so (A − C) ∩ (C − B) = ∅.
e) If x ∈ (B − A) ∪ (C − A) then x ∈ / A and x ∈ B ∪ C, so (B − A) ∪ (C − A) ⊆ (B ∪ C) − A.
Conversely, if x ∈ (B ∪ C) − A then x ∈
/ A and x ∈ B ∪ C, so (B ∪ C) − A ⊆ (B − A) ∪ (C − A).
Hence equality.

Problem 21
Show that if A and B are sets, then
(a) A − B = A ∩ B.
(b) (A ∩ B) ∪ (A ∩ B) = A.
Answer:
(a) Let x ∈ A \ B ⇐⇒ x ∈ A ∧ x ∈
/ B, hence A \ B = A ∩ B.
(b) Let x ∈ A. If x ∈ B then x ∈ A ∩ B, otherwise x ∈ A ∩ B, so A = (A ∩ B) ∪ (A ∩ B).

5
Problem 35
Let A, B, and C be sets. Use the identities in Table 1 to show that

(A ∪ B) ∩ (B ∪ C) ∩ (A ∪ C) = A ∩ B ∩ C.

Answer:

(A ∪ B) = A ∩ B, (B ∪ C) = B ∩ C, (A ∪ C) = A ∩ C.
Therefore

(A ∪ B) ∩ (B ∪ C) ∩ (A ∪ C) = (A ∩ B) ∩ (B ∩ C) ∩ (A ∩ C)
= A ∩ B ∩ C,

Problem 36
Let A, B, and C be sets. Prove or disprove that

a) A × (B ∪ C) = (A × B) ∪ (A × C).
b) A × (B ∩ C) = (A × B) ∩ (A × C).
Answer:

a) If (x, y) ∈ A × (B ∪ C), then x ∈ A and y ∈ B or y ∈ C, so (x, y) ∈ A × B or A × C.

b) If (x, y) ∈ A × (B ∩ C), then x ∈ A, y ∈ B, and y ∈ C, so (x, y) lies in both A × B and A × C.

Problem 37
Let A, B, C be sets. Prove or disprove:
a) A × (B \ C) = (A × B) \ (A × C).
b) A × (B ∪ C) = (A × B) ∪ (A × C).

Answer:

a) If (x, y) ∈ A × (B \ C), then x ∈ A and y ∈ B but y ∈


/ C, so (x, y) ∈ A × B and (x, y) ∈
/ A × C.
Hence (x, y) ∈ (A × B) \ (A × C).

b) If (x, y) ∈ A×(B∪C), then x ∈


/ A and y ∈ B or y ∈ C. In either case, (x, y) ∈ (A×B)∪(A×C).

Section 2.3
Problem 25.
Proof. Let f : R → R be a function such that f (x) > 0 for all x ∈ R. Show that f (x) is strictly decreasing
1
if and only if the function g(x) = f (x) is strictly increasing.
Proof:
(⇒) Assume f (x) is strictly decreasing. Then for any x1 < x2 , we have:

f (x1 ) > f (x2 )

6
Since f (x) > 0, taking reciprocals preserves the inequality direction:
1 1
<
f (x1 ) f (x2 )
1
Thus, g(x) = f (x) is strictly increasing.
1
(⇐) Now assume g(x) = f (x) is strictly increasing. Then for any x1 < x2 , we have:

1 1
< ⇒ f (x1 ) > f (x2 )
f (x1 ) f (x2 )

Thus, f (x) is strictly decreasing.


1
Conclusion: f (x) is strictly decreasing if and only if f (x) is strictly increasing.
If you want centered math on its own line, you can use a slash and square bracket.
(∞ ∞
)
X [
l(Ik ) : A ⊆ {Ik }
k=1 k=1

The left and right commands make the brackets get as big as we need them to be.

7
Problem 26
Given...
Proof. (a) Prove that a strictly increasing function from R to itself is one-to-one.
(b) Give an example of an increasing function from R to itself that is not one-to-one.
Solution:
(a) Let f : R → R be a strictly increasing function. By definition, this means:

∀x1 , x2 ∈ R, x1 < x2 ⇒ f (x1 ) < f (x2 )

We want to prove that f is one-to-one (injective), i.e., f (x1 ) = f (x2 ) ⇒ x1 = x2 .


Proof: Assume f (x1 ) = f (x2 ). Suppose x1 ̸= x2 . Then either x1 < x2 or x1 > x2 .
- If x1 < x2 , then f (x1 ) < f (x2 ) (by strict increase), which contradicts f (x1 ) = f (x2 ). - If x1 > x2 ,
then f (x1 ) > f (x2 ), which also contradicts f (x1 ) = f (x2 ).
Therefore, the assumption x1 ̸= x2 must be false. Hence, x1 = x2 , so f is one-to-one.
(b) We need an example of an increasing function (not necessarily strictly increasing) that is not
one-to-one.
Example: (
0 if x ≤ 0
f (x) =
x if x > 0
This function is increasing because:

x1 < x2 ⇒ f (x1 ) ≤ f (x2 )

However, it is not one-to-one, since:

f (−1) = f (0) = 0 but − 1 ̸= 0

Conclusion: There exist increasing functions that are not injective.

Problem 27
Proof. (a) Prove that a strictly decreasing function from R to itself is one-to-one.
(b) Give an example of a decreasing function from R to itself that is not one-to-one.

Solution.
(a) Let f : R → R be a strictly decreasing function. That is, for all x1 , x2 ∈ R, if x1 < x2 , then
f (x1 ) > f (x2 ).
To prove that f is one-to-one, we must show that:

f (x1 ) = f (x2 ) ⇒ x1 = x2 .

We will prove this by contrapositive: suppose x1 ̸= x2 . Without loss of generality, assume x1 < x2 .
Then, by the strictly decreasing property,

f (x1 ) > f (x2 ),

which implies f (x1 ) ̸= f (x2 ). Therefore, f is one-to-one.


(b) Consider the constant function

f (x) = −1 for all x ∈ R.

This function is decreasing (since for any x1 < x2 , we have f (x1 ) = f (x2 )), but it is not strictly
decreasing.
Moreover, f is not one-to-one because:

f (x1 ) = f (x2 ) = −1 for all x1 , x2 ∈ R, even when x1 ̸= x2 .

8
Problem 33
Proof. (a) Show that if both f and g are one-to-one functions, then f ◦ g is also one-to-one.
Proof:
Assume f and g are one-to-one functions.
Let x1 , x2 ∈ A and suppose that:

(f ◦ g)(x1 ) = (f ◦ g)(x2 ) ⇒ f (g(x1 )) = f (g(x2 ))

Since f is one-to-one, it follows that:


g(x1 ) = g(x2 )
Since g is also one-to-one, it follows that:

x1 = x2

Therefore, f ◦ g is one-to-one.
(b) Show that if both f and g are onto functions, then f ◦ g is also onto.
Proof:
Assume f and g are onto functions.
Let c ∈ C be arbitrary. Since f is onto, there exists b ∈ B such that:

f (b) = c

Since g is onto, there exists a ∈ A such that:

g(a) = b

Then:
(f ◦ g)(a) = f (g(a)) = f (b) = c
Hence, for every c ∈ C, there exists a ∈ A such that (f ◦ g)(a) = c.
Therefore, f ◦ g is onto.

Problem 34
Proof. (a) If f ◦ g is onto, then f must also be onto.
Proof:
Assume that f ◦ g is onto. That means for every c ∈ C, there exists a ∈ A such that:

(f ◦ g)(a) = f (g(a)) = c

Let b = g(a) ∈ B. Then f (b) = c. Since this is true for all c ∈ C, it follows that for every c ∈ C,
there exists b ∈ B such that f (b) = c.
Hence, f is onto.
(b) If f ◦ g is one-to-one, then g must also be one-to-one.
Proof:
Assume f ◦ g is one-to-one. Let x1 , x2 ∈ A and suppose:

g(x1 ) = g(x2 ) ⇒ f (g(x1 )) = f (g(x2 )) ⇒ (f ◦ g)(x1 ) = (f ◦ g)(x2 )

Since f ◦ g is one-to-one, it follows that x1 = x2 . Therefore, g is one-to-one.


(c) If f ◦ g is a bijection, then g is onto if and only if f is one-to-one.
Proof:
(⇒) Assume f ◦ g is a bijection and f is one-to-one. We want to show that g is onto.
Since f ◦ g is onto, for every c ∈ C, there exists a ∈ A such that:

f (g(a)) = c

9
Let b = g(a) ∈ B. Then f (b) = c. Because f is one-to-one, each b must be unique to ensure f
covers all of C. Thus, to provide all needed b values, g must map onto all of B. Hence, g is onto.

(⇐) Assume f ◦ g is a bijection and g is onto. We want to show that f is one-to-one.


Suppose f (x1 ) = f (x2 ) for some x1 , x2 ∈ B. Since g is onto, there exist a1 , a2 ∈ A such that:
g(a1 ) = x1 , g(a2 ) = x2
Then:
(f ◦ g)(a1 ) = f (g(a1 )) = f (x1 ) = f (x2 ) = f (g(a2 )) = (f ◦ g)(a2 )
Since f ◦ g is one-to-one, it follows that a1 = a2 , hence g(a1 ) = g(a2 ) ⇒ x1 = x2 .
Therefore, f is one-to-one.

Problem 35
Proof. Find an example of functions f and g such that f ◦ g is a bijection, but g is not onto and f is not
one-to-one.
Example:
Let the sets be:
A = {1, 2}, B = {a, b, c}, C = {X, Y }
Define:
g : A → B, with g(1) = a, g(2) = b
f : B → C, with f (a) = X, f (b) = Y, f (c) = X
Then:
(f ◦ g)(1) = f (g(1)) = f (a) = X(f ◦ g)(2) = f (g(2)) = f (b) = Y
So, f ◦ g : A → C is a bijection (one-to-one and onto).
However:
• g is not onto because c ∈ B is not in the image of g.
• f is not one-to-one because f (a) = f (c) = X.

Problem 42
Proof. Let f be a function from the set A to the set B. Let S and T be subsets of A.
(a) Show that f (S ∪ T ) = f (S) ∪ f (T ).
Proof:
Let y ∈ f (S ∪ T ). Then there exists x ∈ S ∪ T such that f (x) = y.
Then x ∈ S or x ∈ T , so y ∈ f (S) ∪ f (T ). Hence,
f (S ∪ T ) ⊆ f (S) ∪ f (T )

Conversely, let y ∈ f (S) ∪ f (T ). Then y = f (x) for some x ∈ S or x ∈ T .


So x ∈ S ∪ T , and thus y ∈ f (S ∪ T ). Therefore,
f (S) ∪ f (T ) ⊆ f (S ∪ T )

Hence,
f (S ∪ T ) = f (S) ∪ f (T ) ■
(b) Show that f (S ∩ T ) ⊆ f (S) ∩ f (T ).
Proof:
Let y ∈ f (S ∩ T ). Then there exists x ∈ S ∩ T such that f (x) = y.
Since x ∈ S and x ∈ T , we get y ∈ f (S) and y ∈ f (T ). So,
y ∈ f (S) ∩ f (T ) ⇒ f (S ∩ T ) ⊆ f (S) ∩ f (T ) ■

10
Problem 43
Proof. Let f : A → B be a function. Let S, T ⊆ A. Recall from Exercise 42 that:

f (S ∩ T ) ⊆ f (S) ∩ f (T )

(a) Show the inclusion may be proper.


Example:
Let A = {1, 2}, B = {a, b}, and define f : A → B by f (1) = a, f (2) = a.
Let S = {1}, T = {2}. Then:
S ∩ T = ∅ ⇒ f (S ∩ T ) = ∅
But:
f (S) = {a}, f (T ) = {a} ⇒ f (S) ∩ f (T ) = {a}
So:
f (S ∩ T ) = ∅ ⊊ {a} = f (S) ∩ f (T )

(b) Show that if f is one-to-one, then the inclusion is an equality.


Proof:
We already know f (S ∩ T ) ⊆ f (S) ∩ f (T ).
Now assume f is one-to-one. Let y ∈ f (S) ∩ f (T ). Then:

y = f (x1 ) for some x1 ∈ S and y = f (x2 ) for some x2 ∈ T

Since f is injective, x1 = x2 = x ∈ S ∩ T . So y = f (x) ∈ f (S ∩ T ).


Hence,
f (S) ∩ f (T ) ⊆ f (S ∩ T ) ⇒ f (S ∩ T ) = f (S) ∩ f (T ) ■

Problem 44
Proof. Let f : R → R be the function defined by f (x) = x2 . Find the following inverse images:

(a) f −1 ({1})

f (x) = 1 ⇒ x2 = 1 ⇒ x = ±1 ⇒ f −1 ({1}) = {−1, 1}

(b) f −1 ({x | 0 < x < 1})

0 < f (x) < 1 ⇒ 0 < x2 < 1 ⇒ x ∈ (−1, 0) ∪ (0, 1) ⇒ f −1 ((0, 1)) = (−1, 0) ∪ (0, 1)

(c) f −1 ({x | x > 4})

f (x) > 4 ⇒ x2 > 4 ⇒ x < −2 or x > 2 ⇒ f −1 ({x | x > 4}) = (−∞, −2) ∪ (2, ∞)

Problem 45
Proof. Let g(x) = ⌊x⌋, the floor function. Find the following inverse images:

(a) g −1 ({0})

⌊x⌋ = 0 ⇒ 0 ≤ x < 1 ⇒ g −1 ({0}) = [0, 1)

11
(b) g −1 ({−1, 0, 1})

⌊x⌋ = −1 ⇒ x ∈ [−1, 0)⌊x⌋ = 0 ⇒ x ∈ [0, 1)⌊x⌋ = 1 ⇒ x ∈ [1, 2)

⇒ g −1 ({−1, 0, 1}) = [−1, 0) ∪ [0, 1) ∪ [1, 2) = [−1, 2)

(c) g −1 ({x | 0 < x < 1})

Since (0, 1) ∩ Z = ∅, there is no x such that ⌊x⌋ ∈ (0, 1) ⇒ g −1 ((0, 1)) = ∅

Problem 46
Proof. Let f : A → B be a function, and let S and T be subsets of B. We prove the following identities
involving inverse images.

(a) f −1 (S ∪ T ) = f −1 (S) ∪ f −1 (T )
Proof:
Let x ∈ f −1 (S ∪ T ). Then f (x) ∈ S ∪ T , so f (x) ∈ S or f (x) ∈ T . Hence, x ∈ f −1 (S) or
x ∈ f −1 (T ), which implies
x ∈ f −1 (S) ∪ f −1 (T )

Conversely, if x ∈ f −1 (S) ∪ f −1 (T ), then f (x) ∈ S ∪ T , so x ∈ f −1 (S ∪ T ).


Thus,
f −1 (S ∪ T ) = f −1 (S) ∪ f −1 (T )

(b) f −1 (S ∩ T ) = f −1 (S) ∩ f −1 (T )
Proof:
Let x ∈ f −1 (S ∩ T ). Then f (x) ∈ S ∩ T , so f (x) ∈ S and f (x) ∈ T . Hence, x ∈ f −1 (S) ∩ f −1 (T ).
Conversely, if x ∈ f −1 (S) ∩ f −1 (T ), then f (x) ∈ S ∩ T , so x ∈ f −1 (S ∩ T ).
Thus,
f −1 (S ∩ T ) = f −1 (S) ∩ f −1 (T )

Problem 47
Proof. Let f : A → B be a function, and let S ⊆ B. We are to show that

f −1 (S) = f −1 (S)

where S denotes the complement of S in B, and f −1 (S) denotes the complement of f −1 (S) in A.
Proof:
Let x ∈ A.

• If x ∈ f −1 (S), then f (x) ∈ S, i.e., f (x) ∈ / f −1 (S), so x ∈ f −1 (S).


/ S. Hence x ∈
/ f −1 (S), so f (x) ∈
• Conversely, if x ∈ f −1 (S), then x ∈ / S, i.e., f (x) ∈ S, and thus x ∈ f −1 (S).

Therefore, the two sets are equal:


f −1 (S) = f −1 (S)

12
Problem 60
We know that:
1 byte = 8 bits
Therefore, the number of bytes required to encode n bits is given by:
lnm
8
where ⌈x⌉ denotes the ceiling function (i.e., the smallest integer greater than or equal to x).
(a) For n = 4:  
4
= ⌈0.5⌉ = 1 byte
8
(b) For n = 10:  
10
= ⌈1.25⌉ = 2 bytes
8
(c) For n = 500:  
500
= ⌈62.5⌉ = 63 bytes
8
(d) For n = 3000:  
3000
= ⌈375⌉ = 375 bytes
8

Problem 62
Each ATM cell consists of 53 bytes, which is:
53 × 8 = 424 bits
Let R be the data rate in bits per second, and T = 10 seconds. Then, the number of ATM cells
transmitted is:
R×T
424
(a) R = 128,000 bits/sec
128,000 × 10 1,280,000
= ≈ 3,018.87 ⇒ 3018 cells
424 424
(b) R = 300,000 bits/sec
300,000 × 10 3,000,000
= ≈ 7,075.47 ⇒ 7075 cells
424 424
(c) R = 1,000,000 bits/sec
1,000,000 × 10 10,000,000
= ≈ 23,584.90 ⇒ 23,584 cells
424 424
Problem 72
Proof: We will prove this by showing that:
(g −1 ◦ f −1 ) ◦ (f ◦ g) = idX and (f ◦ g) ◦ (g −1 ◦ f −1 ) = idZ
1. Compute:
(g −1 ◦ f −1 ) ◦ (f ◦ g) = g −1 ◦ (f −1 ◦ f ) ◦ g = g −1 ◦ idY ◦ g = g −1 ◦ g = idX
2. Compute:
(f ◦ g) ◦ (g −1 ◦ f −1 ) = f ◦ (g ◦ g −1 ) ◦ f −1 = f ◦ idY ◦ f −1 = f ◦ f −1 = idZ
Since both compositions result in the identity functions, we conclude:
(f ◦ g)−1 = g −1 ◦ f −1

13
Problem 73
Proof:
(a) By definition of intersection: - If x ∈ A ∩ B, then fA (x) = fB (x) = 1 - Otherwise, at least one of
fA (x), fB (x) is zero
Hence,
fA∩B (x) = fA (x) · fB (x)
(b) We analyze case-by-case: - If x ∈ A ∩ B, both are 1 → RHS: 1 + 1 − 1 = 1 - If x ∈ A \ B, RHS:
1 + 0 − 0 = 1 - If x ∈ B \ A, RHS: 0 + 1 − 0 = 1 - If x ∈
/ A ∪ B, RHS: 0 + 0 − 0 = 0
Thus,
fA∪B (x) = fA (x) + fB (x) − fA (x)fB (x)
(c) By definition:
(
1 if x ∈
/ A ⇒ fA (x) = 0
fA (x) = ⇒ fA (x) = 1 − fA (x)
0 if x ∈ A ⇒ fA (x) = 1

(d) The symmetric difference A ⊕ B = (A ∪ B) \ (A ∩ B) So the characteristic function is:

fA⊕B (x) = fA (x) + fB (x) − 2fA (x)fB (x)

We verify this with the same case-by-case analysis as part (b).

Problem 75
(a) ⌈⌊x⌋⌉ = ⌊x⌋ for all real numbers x.
Proof: Since ⌊x⌋ is always an integer, applying the ceiling function does not change its value.
Conclusion: True.
(b) ⌊2x⌋ = 2⌊x⌋ for all real numbers x.
Counterexample: Let x = 1.5. Then:

⌊2x⌋ = ⌊3⌋ = 3, 2⌊x⌋ = 2 · 1 = 2

Conclusion: False.
(c) ⌈x⌉ + ⌈y⌉ − ⌈x + y⌉ = 0 or 1 for all real x, y.
Proof: The sum of two ceilings may exceed the ceiling of the sum by at most 1, depending on the
fractional parts of x and y.
Conclusion: True.
(d) ⌈xy⌉ = ⌈x⌉ · ⌈y⌉ for all real x, y.
Counterexample: Let x = 1.1, y = 1.1. Then:

⌈xy⌉ = ⌈1.21⌉ = 2, ⌈x⌉ · ⌈y⌉ = 2 · 2 = 4

Conclusion: False.
(e) ⌈2x⌉ = ⌊x + 21 ⌋ for all real x.
Proof: This is a standard identity used in rounding. It can be proven by considering the intervals
x ∈ [n, n + 1).
Conclusion: True.

Problem 76
Proof: This expression can be either 0 or 1, depending on the fractional parts of x and y. True.
(d) ⌈xy⌉ = ⌈x⌉ · ⌈y⌉ for all real x, y. Counterexample: Let x = 1.1, y = 1.1, then:

⌈xy⌉ = ⌈1.21⌉ = 2 but ⌈x⌉ · ⌈y⌉ = 2 · 2 = 4

False.
(e) ⌈2x⌉ = ⌊x + 21 ⌋ for all real x. Proof: This identity holds for all real x. It is a well-known identity
used in rounding operations. True.

14
Problem 77
jp k √
(a) ⌊x⌋ = ⌊ x⌋
Proof: Let a = ⌊x⌋, so we know:
√ √ √
a≤x<a+1⇒ a≤ x< a+1

Taking the floor of both sides:


√ √ p √
⌊ a⌋ = ⌊ x⌋ ⇒ ⌊ ⌊x⌋⌋ = ⌊ x⌋

Conclusion: The equality holds.


lp m √
(b) ⌈x⌉ = ⌈ x⌉
Proof: Let b = ⌈x⌉, so: √
√ √
x≤b<x+1⇒ x≤ b< x+1
Taking the ceiling of both sides: √ √
⌈ x⌉ ≤ ⌈ b⌉
√ √
But since b is only slightly more than x, they must share the same ceiling:
√ √ p √
⌈ x⌉ = ⌈ b⌉ ⇒ ⌈ ⌈x⌉⌉ = ⌈ x⌉

Conclusion: The equality holds.

Problem 78
Let x be a real number. We want to show that:
   
x+1 x+2
⌊3x⌋ = ⌊x⌋ + +
3 3

We express x as x = n + f , where n = ⌊x⌋ and f = x − n is the fractional part of x, i.e., 0 ≤ f < 1.


Thus, we have:
3x = 3n + 3f
and:
⌊3x⌋ = 3n + ⌊3f ⌋
 x+1 
and x+2
 
Next,
 we evaluate the terms 3 3 .
For x+1
3 , we have:
x+1 n+f +1 n+1 f
= = +
3 3 3 3
so:    
x+1 n+1
=
3 3
 x+2 
For 3 , we have:
x+2 n+f +2 n+2 f
= = +
3 3 3 3
so:    
x+2 n+2
=
3 3
Now, summing the expressions, we get:
       
x+1 x+2 n+1 n+2
⌊x⌋ + + =n+ +
3 3 3 3

15
Problem 79
1
Function a: f : Z → R, f (n) = n

• Domain: Z
• Codomain: R

• Domain of definition: Z \ {0}


• Undefined at: {0}
• Total function? No
n
Function b: f : Z → Z, f (n) = 2

• Domain: Z
• Codomain: Z
• Domain of definition: Z

• Undefined at: None


• Total function? Yes
m
Function c: f : Z × Z → Q, f (m, n) = n

• Domain: Z × Z

• Codomain: Q
• Domain of definition: Z × (Z \ {0})
• Undefined at: {(m, 0) | m ∈ Z}

• Total function? No

Function d: f : Z × Z → Z, f (m, n) = m · n

• Domain: Z × Z
• Codomain: Z

• Domain of definition: Z × Z
• Undefined at: None
• Total function? Yes

Function e: f : Z × Z → Z, f (m, n) = m − n if m > n

• Domain: Z × Z
• Codomain: Z
• Domain of definition: {(m, n) ∈ Z × Z | m > n}

• Undefined at: {(m, n) ∈ Z × Z | m ≤ n}


• Total function? No

16
Section 2.4
Problem 25
a) Sequence: 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, . . .
This sequence appears to follow a repeating pattern:

1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, . . .

Pattern length increases: 1’s followed by 0’s, each group of 1’s or 0’s increasing in length by 1.
Rule: Repeat k ones followed by k zeros, incrementing k each time.
Next three terms: 1, 1, 1 (starting the group of four 1’s)
b) Sequence: 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 8, 8, . . .
The pattern shows each odd number appearing once, each even number appearing twice.
Rule: n
an = n − n3 , or generate as odd once, even twice
 

Next three terms: 9, 10, 10


c) Sequence: 1, 0, 2, 0, 4, 0, 8, 0, 16, 0, . . .
Rule: (
2n/2 , if n is even
an =
0, if n is odd
Next three terms: 32, 0, 64
d) Sequence: 3, 6, 12, 24, 48, 96, 192, . . .
This is a geometric sequence.
Rule: an = 3 · 2n
Next three terms: 384, 768, 1536
e) Sequence: 15, 8, 1, -6, -13, -20, -27, . . .
This is an arithmetic sequence with a common difference of -7.
Rule: an = 15 − 7n
Next three terms: -34, -41, -48
f) Sequence: 3, 5, 8, 12, 17, 23, 30, 38, 47, . . .
Differences: +2, +3, +4, +5, etc.
Rule: an = an−1 + n + 1, with a0 = 3
Next three terms: 57, 68, 80
g) Sequence: 2, 16, 54, 128, 250, 432, 686, . . .
Try fitting a polynomial (or observe pattern):

an = n3 + n
Verify:
13 + 1 = 2, 23 + 2 = 10, 33 + 3 = 30, too low
Try:
an = n3 + n2

13 + 12 = 2, 23 + 22 = 8 + 4 = 12, toolow
Actual pattern:

an = n3 + n ⇒ a1 = 2, a2 = 10, a3 = 30, a4 = 68, a5 = 130, a6 = 222, a7 = 350 ⇒ not matching

Eventually, try fitting or refer to OEIS: Turns out the formula is:

an = n3 + n

Next three terms: 1024 + 8 = 1032, 1458 + 9 = 1467, 2000 + 10 = 2010


h) Sequence: 2, 3, 7, 25, 121, 721, 5041, 40321, . . .
These are of the form:
an = n! + 1, n! + 2, etc.

17
Check values:

2 = 2, 3 = 3, 7 = 3! + 1, 25 = 4! + 1, 121 = 5! + 1, 721 = 6! + 1, ...

Rule: an = n! + 1 for n ≥ 3
Next three terms: 40321 (8!), 362881 (9!), 3628801 (10!)

Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices


Section 2.5
Exercise 12: Solution
Assume A ⊂ B. That means every element of A is also an element of B.
We define a function f : A → B by:

f (a) = a, for all a ∈ A

This function is:


• Well-defined, because A ⊂ B, so f (a) ∈ B for every a ∈ A.

• Injective (one-to-one), because if f (a1 ) = f (a2 ), then a1 = a2 .


Since there exists an injective function from A to B, it follows that:

|A| ≤ |B|

Conclusion:
If A ⊂ B, then the cardinality of A is less than or equal to the cardinality of B: |A| ≤ |B|.

Exercise 13: Solution


Suppose that A is countable. Then either:
• A is finite, or
• There exists a one-to-one correspondence f : A → Z+ , i.e., A is countably infinite.

In the finite case, we can define an injective function g : A → Z+ , where the image is the first n positive
integers if |A| = n.
In the countably infinite case, the bijection itself is an injective function.
Thus, in both cases, there exists an injective function from A into Z+ , so:

|A| ≤ |Z+ |

Now suppose |A| ≤ |Z+ |, i.e., there exists an injective function g : A → Z+ .


Then the image of g is a subset of Z+ , and since all subsets of Z+ are countable, A is countable as well.
Conclusion:
A is countable ⇐⇒ |A| ≤ |Z+ |

Exercise 14: Solution


If A and B have the same cardinality, then there exists a bijection f : A → B.

• Since f is injective, it satisfies the condition for |A| ≤ |B|.


• The inverse function f −1 : B → A is also a bijection, hence injective, so it satisfies the condition
for |B| ≤ |A|.
Conclusion:
|A| = |B| ⇒ |A| ≤ |B| and |B| ≤ |A|

18
Exercise 15: Solution
- Suppose B is a countable set. By the definition of countability, we can list the elements of B as:
B = {b1 , b2 , b3 , . . . }, where each bi ∈ B.
- Since A ⊆ B, every element of A is also an element of B. Therefore, the elements of A appear in the
list of elements of B.
- If A were countable, we could list the elements of A based on the order in which they appear in the
listing of B. That is, we can assign the elements of A to some subset of the indices 1, 2, 3, . . ., which
means we can list the elements of A as:
A = {a1 , a2 , a3 , . . . }, where each ai ∈ A.
- However, we are given that A is uncountable, so it cannot be listed in this way. This leads to a
contradiction, as we cannot have both A being uncountable and A ⊆ B, where B is countable.
Conclusion: Since assuming that B is countable leads to a contradiction, we must conclude that B is
uncountable.
Thus, if A is uncountable and A ⊆ B, then B must also be uncountable.

Exercise 16: Solution


- Let A be a countable set. This means that we can list the elements of A as:
a1 , a2 , a3 , . . . , an , . . ., where the sequence may either be finite or infinite.
- Now, let B be a subset of A. This means that every element of B is also an element of A, but B may
contain some, none, or all of the elements of A.
- Since we can list the elements of A in the sequence a1 , a2 , a3 , . . ., we can also list the elements of B in
the same order. The elements of B will appear in the same sequence, but possibly with some gaps (if
some elements of A are not in B).
- Thus, we can list all the elements of B in a sequence (which may be finite or infinite). This shows that
B is countable.
Conclusion: every subset of a countable set is countable.

Exercise 17: Solution


- We are given that A is an uncountable set and B is a countable set. We need to determine whether
A − B must be uncountable.
- We can express A as the union of two sets:

A = (A ∩ B) ∪ (A − B).

- Since B is countable, by Exercise 16, the subset A ∩ B must also be countable (because a subset of a
countable set is countable).
- Now, suppose that A − B is countable. Since the union of two countable sets is countable (by Theorem
1), we would conclude that A = (A ∩ B) ∪ (A − B) is countable, because both A ∩ B and A − B are
countable.
- However, this contradicts the assumption that A is uncountable.
- Therefore, our assumption that A − B is countable must be wrong, and we conclude that A − B is
uncountable.
Conclusion: if A is an uncountable set and B is a countable set, A − B must be uncountable.

Exercise 18: Solution


- Suppose that |A| = |B|. This means there exists a bijective function f : A → B, i.e., f is one-to-one
and onto.
- We define a function Sf : P(A) → P(B), where P(A) and P(B) are the power sets of A and B,
respectively. For any subset X ⊆ A, we define:

Sf (X) = f (X) = {f (x) | x ∈ X}.

- Since f is bijective, it follows that Sf is also bijective: it is one-to-one and onto from P(A) to P(B).
Conclusion: |P(A)| = |P(B)|.

19
Exercise 19: Solution
- Suppose we are given that |A| = |B| and |C| = |D|. This means there exist bijections f : A → B and
g : C → D.
- Define a function h : A × C → B × D by:

h(a, c) = (f (a), g(c)).

- We show that h is bijective:


• Injective (one-to-one): If h(a1 , c1 ) = h(a2 , c2 ), then
(f (a1 ), g(c1 )) = (f (a2 ), g(c2 )). Since f and g are injective, it follows that a1 = a2 and c1 = c2 .
Hence, (a1 , c1 ) = (a2 , c2 ).
• Surjective (onto): For any (b, d) ∈ B × D, since f and g are surjective, there exist a ∈ A and
c ∈ C such that f (a) = b and g(c) = d. Thus, h(a, c) = (b, d), and h is surjective.
Conclusion: h is a bijection, and so |A × C| = |B × D|.

Section 8.2
Exercise 28: Solution
(a) Find all solutions of the recurrence relation

an = 2an−1 + 2n2 .

Solution:
The associated homogeneous recurrence relation is:

a(h)
n = 2an−1 .

This is a first-order linear homogeneous recurrence relation, and the solution is:
(h)
an = α · 2n , where α is a constant.
Now we find a particular solution to the nonhomogeneous recurrence:

an = 2an−1 + 2n2 .

We guess a particular solution of the form:

an(p) = p2 n2 + p1 n + p0 .

Plug into the recurrence:

p2 n2 + p1 n + p0 = 2 p2 (n − 1)2 + p1 (n − 1) + p0 + 2n2 .
 

Expanding the right-hand side:

2 p2 (n2 − 2n + 1) + p1 (n − 1) + p0 + 2n2 = 2p2 n2 − 4p2 n + 2p2 + 2p1 n − 2p1 + 2p0 + 2n2 .


 

Now group terms:


(2p2 + 2)n2 + (−4p2 + 2p1 )n + (2p2 − 2p1 + 2p0 ).
Equating coefficients with the left-hand side:

p2 n2 + p1 n + p0 = (2p2 + 2)n2 + (−4p2 + 2p1 )n + (2p2 − 2p1 + 2p0 ).

Matching coefficients: 
p2 = 2p2 + 2 ⇒ p2 = −2,

p1 = −4p2 + 2p1 ⇒ p1 = −8,

p0 = 2p2 − 2p1 + 2p0 ⇒ p0 = −12.

So the particular solution is:


a(p) 2
n = −2n − 8n − 12.

20
Hence, the general solution is:
an = α · 2n − 2n2 − 8n − 12.

(b) Find the solution with initial condition a1 = 4:


We substitute into the general solution:

4 = α · 21 − 2(1)2 − 8(1) − 12 ⇒ 4 = 2α − 2 − 8 − 12 = 2α − 22.

2α = 26 ⇒ α = 13.

So the particular solution satisfying the initial condition is:

an = 13 · 2n − 2n2 − 8n − 12.

Exercise 29: Solution


(a) Find all solutions of the recurrence relation

an = 2an−1 + 3n .

The associated homogeneous recurrence relation is:

a(h)
n = 2an−1 .

This has the general solution:


(h)
an = α · 2n , where α is a constant.
We now find a particular solution to the nonhomogeneous recurrence:

an = 2an−1 + 3n .

We guess a particular solution of the form:


n
a(p)
n =c·3 .

Substitute into the recurrence:


c · 3n = 2c · 3n−1 + 3n .
Divide both sides by 3n−1 :
c · 3 = 2c + 3.
Solve for c:
3c = 2c + 3 ⇒ c = 3.
Thus the particular solution is:
n n+1
a(p)
n =3·3 =3 .
So the general solution is:
an = α · 2n + 3n+1 .

(b) Find the solution with initial condition a1 = 5:


We plug into the general solution:
5 = α · 21 + 32 = 2α + 9.
2α = 5 − 9 = −4 ⇒ α = −2.
So the final solution is:
an = −2 · 2n + 3n+1 = −2n+1 + 3n+1 .
Verification: Check a2 using both methods: From recurrence:

a2 = 2a1 + 32 = 2 · 5 + 9 = 19.

From formula:
a2 = −22+1 + 32+1 = −8 + 27 = 19.
Both results match, confirming the solution is correct.

21
Exercise 30: Solution
(a) Find all solutions of the recurrence relation:

an = −5an−1 − 6an−2 + 42 · 4n .

The associated homogeneous recurrence relation is:

an = −5an−1 − 6an−2 .

The characteristic equation is:


r2 + 5r + 6 = 0.
Solving this quadratic:
r = −2, r = −3.
So the homogeneous solution is:
n n
a(h)
n = α(−2) + β(−3) .

We now look for a particular solution of the form:


n
a(p)
n =c·4 .

Substitute into the recurrence:

c · 4n = −5c · 4n−1 − 6c · 4n−2 + 42 · 4n .

Divide both sides by 4n−2 :


16c = −20c − 6c + 42 · 16.
16c + 20c + 6c = 672 ⇒ 42c = 672 ⇒ c = 16.
So the particular solution is:
an(p) = 16 · 4n = 4n+2 .
The general solution is:
an = α(−2)n + β(−3)n + 4n+2 .

(b) Find the solution with initial conditions a1 = 56, a2 = 278:


We use the general solution:

a1 = α(−2)1 + β(−3)1 + 41+2 = −2α − 3β + 64 = 56 (1)

a2 = α(−2)2 + β(−3)2 + 42+2 = 4α + 9β + 256 = 278 (2)


From equation (1):
−2α − 3β = −8 (1’)
From equation (2):
4α + 9β = 22 (2’)
Solve the system: Multiply (1’) by 2:
−4α − 6β = −16
Add to (2’):
(4α + 9β) + (−4α − 6β) = 22 − 16 ⇒ 3β = 6 ⇒ β = 2
Substitute back into (1’):
−2α − 3(2) = −8 ⇒ −2α = −2 ⇒ α = 1
Thus, the final solution is:
an = (−2)n + 2(−3)n + 4n+2 .

22
Exercise 31: Solution
Find all solutions of the recurrence relation:
an = 5an−1 − 6an−2 + 2n + 3n
First, we solve the associated homogeneous recurrence relation:
an = 5an−1 − 6an−2
The characteristic equation is:
r2 − 5r + 6 = 0
Solving this, we get r = 2 and r = 3. So the general solution to the homogeneous part is:
an(h) = α · 2n + β · 3n
Now we find a particular solution to the non-homogeneous equation:
an = 5an−1 − 6an−2 + 2n + 3n
Since both 2n and 3n appear in the homogeneous solution, we look for a particular solution of the form:
n
a(p)
n =c·n·2 +d·n+e

We substitute this into the original equation and compare coefficients. After simplification, we solve the
resulting system to find:
3 21
c = −2, d = , e =
2 4
Thus, the particular solution is:
n 3 21
a(p)
n = −2n · 2 + n +
2 4
Combining the homogeneous and particular solutions, the general solution is:
3 21
an = α · 2n + β · 3n − 2n · 2n + n +
2 4

Exercise 32: Solution


Find the solution of the recurrence relation:
an = 2an−1 + 3 · 2n
First, we solve the associated homogeneous recurrence relation:
an = 2an−1
This is a simple linear recurrence with solution:
(h)
an = α · 2n , where α is a constant.
Now we find a particular solution to the full non-homogeneous recurrence. We look for a solution of the
form:
n
a(p)
n =c·n·2

Substitute this into the original recurrence:


c · n · 2n = 2 · c(n − 1) · 2n−1 + 3 · 2n
Divide both sides by 2n−1 :
2cn = 2c(n − 1) + 6
Simplify:
2cn = 2cn − 2c + 6 ⇒ −2c + 6 = 0 ⇒ c = 3
Therefore, the particular solution is:
an(p) = 3n · 2n
The general solution is the sum of the homogeneous and particular solutions:
an = α · 2n + 3n · 2n = (3n + α) · 2n

23
Exercise 33: Solution
Find all solutions of the recurrence relation:

an = 4an−1 − 4an−2 + (n + 1)2n

First, we solve the associated homogeneous recurrence:

an = 4an−1 − 4an−2

The characteristic equation is:


r2 − 4r + 4 = 0
Factoring:
(r − 2)2 = 0
So we have a repeated root r = 2. Therefore, the general solution to the homogeneous part is:
n n
a(h)
n = α · 2 + βn · 2

Next, we find a particular solution to the full recurrence. Since the non-homogeneous term is (n + 1)2n ,
and 2n appears in the homogeneous solution with multiplicity 2, we try a particular solution of the form:

an(p) = n2 (cn + d)2n

We substitute this into the recurrence:

n2 (cn + d)2n = 4(n − 1)2 (c(n − 1) + d)2n−1 − 4(n − 2)2 (c(n − 2) + d)2n−2 + (n + 1)2n

Divide through by 2n to simplify the expression. After simplifying and equating coefficients of like powers
of n, we obtain:
1
c= , d=1
6
So the particular solution is:
2 n
 
a(p)
n =n + 1 2n
6
Finally, the general solution is the sum of the homogeneous and particular solutions:

n3
 
an = α + βn + n2 + 2n
6

Exercise 34: Solution


Find all solutions of the recurrence relation:

an = 7an−1 − 16an−2 + 12an−3 + n · 4n , with a0 = −2, a1 = 0, a2 = 5

First, solve the associated homogeneous recurrence relation:

an = 7an−1 − 16an−2 + 12an−3

The characteristic equation is:


r3 − 7r2 + 16r − 12 = 0
By the Rational Root Theorem, we find r = 2 is a root. Using polynomial division or factoring, we get:

(r − 2)2 (r − 3) = 0

So the general solution to the homogeneous part is:


n n n
a(h)
n = α · 2 + βn · 2 + γ · 3

Next, we find a particular solution. Since the non-homogeneous term is n · 4n , and 4 is not a root of the
characteristic equation, we try:
an(p) = (cn + d) · 4n

24
Substitute into the recurrence and simplify (tedious but mechanical):

(cn + d) · 4n = 7(cn − c + d) · 4n−1 − 16(cn − 2c + d) · 4n−2 + 12(cn − 3c + d) · 4n−3 + n · 4n

Divide both sides by 4n−2 , expand, and match coefficients to solve:

(c − 16)n + (5c + d) = 0 ⇒ c = 16, d = −80

So the particular solution is:


an(p) = (16n − 80) · 4n
Hence, the general solution is:

an = α · 2n + βn · 2n + γ · 3n + (16n − 80) · 4n

Use the values a0 = −2, a1 = 0, a2 = 5:

a0 = α + γ − 80 = −2
a1 = 2α + 2β + 3γ − 256 = 0
a2 = 4α + 8β + 9γ − 768 = 5

Solving this system gives:


39
α = 17, β= , γ = 61
2
39
an = 17 · 2n + n · 2n + 61 · 3n + (16n − 80) · 4n
2

Exercise 35: Solution


Find the solution of the recurrence relation:

an = 4an−1 − 3an−2 + 2n + n + 3, with a0 = 1, a1 = 4

First, we solve the associated homogeneous recurrence:

an = 4an−1 − 3an−2

The characteristic equation is:

r2 − 4r + 3 = 0 ⇒ (r − 1)(r − 3) = 0

So the general solution to the homogeneous part is:


n n n
a(h)
n =α·1 +β·3 =α+β·3

Now for a particular solution. Since the nonhomogeneous term is 2n + n + 3, and neither 2 nor 1
(corresponding to the polynomial part) are roots of the characteristic equation except 1, we try:
n
a(p) 2
n = c · 2 + dn + en

We plug this into the recurrence and simplify:

c · 2n + dn2 + en = 4 c · 2n−1 + d(n − 1)2 + e(n − 1) − 3 c · 2n−2 + d(n − 2)2 + e(n − 2) + 2n + n + 3


 

After expanding, simplifying, and matching coefficients, we eventually obtain:


1 5
c = −4, d=− , e=−
4 2
So the particular solution is:
n 1 2 5
a(p)
n = −4 · 2 − n − n
4 2
Thus, the general solution is:
1 5
an = α + β · 3n − 4 · 2n − n2 − n
4 2

25
Use:
1 5
a0 = 1 = α + β − 4a1 = 4 = α + 3β − 8 − −
4 2
From the first equation:
α+β =5
From the second:
11 75
α + 3β = 4 + 8 + =
4 4
Solve the system:
75
α+β =5 (1)α + 3β = (2)
4
Subtracting (1) from (2):
75 55 55 55 40 − 55 15
2β = −5= ⇒β= , α=5− = =−
4 4 8 8 8 8
1 5 15 55 n
an = −4 · 2n − n2 − n − + ·3
4 2 8 8

26

You might also like