Discrete Mathematics - Week 11
1. Which of the following statements is not necessarily true for any sequence {an } defined
by a recurrence relation?
(a) The sequence is determined by its initial term(s) and the recurrence formula.
(b) The nth term depends on at least one of its preceding terms.
(c) The sequence must be strictly increasing.
(d) Each term is real-valued if the initial terms are real and the recurrence uses real
operations.
Correct Answer: (c)
Explanation: A recurrence relation specifies how each term is obtained from one or
more previous terms (so statements (a) and (b) are typically true). If the initial terms
and the operations in the recurrence are real, then all subsequent terms remain real
(making (d) true under normal circumstances). However, a recurrence relation does
not require the sequence to be strictly increasing; the terms can increase, decrease,
or behave in more complex ways. Hence, option (c) is not necessarily true.
2. For the Tower of Hanoi puzzle with n disks, consider the following statements:
(a) The minimum number of moves required is 2n − 1.
(b) The recurrence relation for the minimum moves T (n) is given by
T (n) = 2 · T (n − 1) + 1 with T (1) = 1.
(c) The complexity (time to solve) grows on the order of 2n .
Which of the above statements is/are true?
(A) I and II
(B) I and III
(C) II and III
(D) I, II, and III
Correct Answer: (d)
Explanation:
• Statement I: It is a well-known fact that the minimal moves for n disks in the
Tower of Hanoi puzzle is 2n − 1.
• Statement II: The standard recurrence relation follows from the strategy of
moving n − 1 disks out of the way, moving the largest disk, and then moving
the n − 1 disks again.
• Statement III: Because the solution requires exponentially many moves, the
overall complexity is on the order of 2n .
Since all three statements hold true, option (D) is correct. Refer to Lecture: Tower
of Hanoi.
3. Let an denote the number of binary strings of length n that do not contain two
consecutive zeros. Which of the following formulas correctly represents an ?
(a) an = 2n
(b) an = n · 2n−1
(c) an = Fn+1 , where Fk is the kth Fibonacci number with F1 = 1, F2 = 1, . . .
(d) an = Fn+2 , where Fk is the kth Fibonacci number with F1 = 1, F2 = 1, . . .
Correct Answer: (d)
Explanation: Define an as the number of n-bit strings with no two consecutive
zeros. One can show that an satisfies the recurrence
an = an−1 + an−2 ,
with base cases a1 = 2 (the strings 0, 1) and a2 = 3 (00 is disallowed, so valid strings
are 01, 10, 11). These initial conditions and the recurrence match the Fibonacci
sequence shifted by two indices, giving an = Fn+2 .
4. Which of the following inequalities hold true for sufficiently large n?
(a) 5n3 < n5
(b) n2 < 2n3
(c) 10n3 < n4
(d) 4n2 < 100n
Options:
(A) (1) and (2) only
(B) (1), (2), and (3) only
(C) (1), (2), and (4) only
(D) (1), (2), (3), and (4)
Correct Answer: (b)
Explanation:
(1) True for large n: Since n5 grows faster than n3 , the inequality 5n3 < n5 holds
once n is sufficiently large.
(2) True for large n: Similarly, n3 eventually outgrows n2 , so n2 < 2n3 holds for
large n.
(3) True for large n: Because n4 grows faster than n3 , 10n3 < n4 also holds
beyond a certain n.
(4) Not true for large n: 4n2 grows faster than 100n as n becomes large, so
4n2 < 100n will fail beyond a certain point.
Refer to Lecture: Intuition for ‘complexity’.
5. Let {bn } be a sequence defined by the recurrence relation
bn = 7 bn−1 − 10 bn−2 ,
with initial conditions b0 = 2 and b1 = 5. Which of the following pairs (b2 , b3 ) is
correct?
(a) (15, 55)
(b) (25, 65)
(c) (35, 105)
(d) (5, 15)
Correct Answer: (a)
Explanation:
b2 = 7 b1 − 10 b0 = 7 · 5 − 10 · 2 = 35 − 20 = 15.
b3 = 7 b2 − 10 b1 = 7 · 15 − 10 · 5 = 105 − 50 = 55.
Hence, the correct pair is (b2 , b3 ) = (15, 55).
6. Consider the sequence {bn } defined by the recurrence relation
bn = bn−1 + 4n,
with the initial term b0 = 2. Which of the following is the correct closed-form expres-
sion for bn ?
(a) bn = 2 + 4n
(b) bn = 2n(n + 1) + 2
(c) bn = 2n2 + 2n + 2
4(n+1)(n+2)
(d) bn = 2
Correct Answer: (c)
Explanation:
n n
X X n(n + 1)
bn = b0 + 4k = 2+4 k = 2+4 = 2+2n(n+1) = 2+2n2 +2n = 2n2 +2n+2.
2
k=1 k=1
Refer to Lecture: Solving recurrence relation Example 2
7. Suppose you have a staircase of n steps, and you can climb either one step or two
steps at a time. Let an be the number of distinct ways to climb n steps under these
conditions. Which of the following is the correct recurrence relation for an (assuming
n ≥ 2)?
(a) an = an−1 + an−2
(b) an = 2 an−1
(c) an = an−1 + an−3
(d) an = an−1 − an−2
Correct Answer: (a)
Explanation: If you are on step n, you could have arrived there either from step
(n − 1) by taking 1 step, or from step (n − 2) by taking 2 steps. Therefore, the total
number of ways to reach step n is the sum of the ways to reach (n − 1) and (n − 2).
This gives the recurrence an = an−1 + an−2 , with typical initial conditions a0 = 1
(one way to stand still before taking any steps) and a1 = 1 (one way to climb a single
step).
Lecture 410: Number of ways of climbing steps Recursion relation.
8. Chris is looking for a specific entry in a sorted database of 2048 records. He uses
a binary search strategy, which repeatedly checks the middle record in the current
search interval and discards half of the interval when it doesn’t match. Which of the
following best represents the worst-case number of comparisons Chris might make?
(a) 2048
(b) log2 (2048)
√
(c) 2048
(d) log10 (2048)
Correct Answer: (b)
Explanation: Binary search has a worst-case time complexity on the order of
log2 (n). For n = 2048, log2 (2048) = 11, so Chris would need at most 11 comparisons
in the worst case.
Refer to Lecture: Solution for the recurrence relation of Binary search.
9. Consider the following functions:
g1 (n) = 4n3 + 5n2 + 7, g2 (n) = n2.5 , g3 (n) = 52 , g4 (n) = 3n2 + 10.
Which of the following statements is/are true for sufficiently large n?
(a) g1 (n) is an order n2 function.
(b) g2 (n) grows slower than g1 (n).
(c) g1 (n) is an order n3 function.
(d) g3 (n) grows faster than g1 (n).
Options:
(A) (1) and (2)
(B) (2) and (3)
(C) (1), (3), and (4)
(D) (2) and (4)
Correct Answers: (b)
Explanation
• g1 (n) = 4n3 + 5n2 + 7 is dominated by the n3 term for large n, so it grows on
the order of n3 . Hence, statement (3) is correct and statement (1) is not.
• g2 (n) = n2.5 grows more slowly than n3 when n becomes large, so g2 (n) grows
slower than g1 (n). Thus, statement (2) is true.
• g3 (n) = 52 = 25 is a constant and does not grow with n, so it certainly does not
outgrow a cubic polynomial. Hence, statement (4) is false.
10. Consider the Fibonacci sequence {Fn } defined by
F1 = 1, F2 = 1, and Fn = Fn−1 + Fn−2 for n ≥ 3.
Which of the following is the 10th term in this sequence?
(a) 21
(b) 34
(c) 55
(d) 89
Correct Answer: (c) 55
Explanation
F3 = 2, F4 = 3, F5 = 5, F6 = 8, F7 = 13, F8 = 21, F9 = 34, F10 = 55.
Hence, the 10th term of the sequence is 55.
Lecture 420: Solution of Fibonacci sequence.