COMP2054 Tutorial Session 4:
Recurrence Relations
Rebecca Tickle
Warren Jackson
Cas Widdershoven
Session outcomes
▪ Solve recurrence relations to provide exact solutions.
▪ Use induction to prove recurrence relation definitions.
Exact Solutions
Resolving exact solutions from
recurrence relations
3
Q1. 𝑻 𝒏 = 𝑻 𝒏 − 𝟏 + 𝟏 and 𝑻 𝟏 = 𝟏
4
Q2. 𝑻 𝒏 = 𝟐 ⋅ 𝑻 𝒏 − 𝟏 and 𝑻 𝟏 = 𝟏
5
Q3. 𝑻 𝒏 = 𝟐 ⋅ 𝑻 𝒏/𝟐 and 𝑻 𝟏 = 𝟏
6
Resolve the exact solutions for the following:
▪ Q4. 𝑇 𝑛 = 3 ⋅ 𝑇 𝑛 − 1 and 𝑇 1 = 1
▪ Q5. 𝑇 𝑛 = 3 ⋅ 𝑇 𝑛/3 and 𝑇 1 = 1
▪ Q6. 𝑇 𝑛 = 2 ⋅ 𝑇 𝑛/4 and 𝑇 1 = 1
7
Recurrence Proofs
Proving exact solutions are the same as
their recursive definitions
8
Q1. Proof
Given: 𝑇 𝑛 = 𝑇 𝑛 − 1 + 1 and 𝑇 1 = 1
Prove: 𝑇 𝑛 = 𝑛
9
Q2. Proof
Given: 𝑇(𝑛) = 2 ⋅ 𝑇(𝑛 − 1) and 𝑇 1 = 1
Prove: 𝑇 𝑛 = 2𝑛−1
10
Q3. Proof
Given: 𝑇(𝑛) = 2 ⋅ 𝑇(𝑛/2) and 𝑇 1 = 1
Prove: 𝑇 2𝑘 = 2𝑘
11
Recurrence proofs
▪ Q4. Given 𝑇 𝑛 = 3 ⋅ 𝑇 𝑛 − 1 and 𝑇 1 = 1
Prove that 𝑇 𝑛 = 3𝑛−1
▪ Q5. 𝑇 𝑛 = 3 ⋅ 𝑇 𝑛/3 and 𝑇 1 = 1
Prove that 𝑇 3𝑘 = 3𝑘
▪ Q6. 𝑇 𝑛 = 2 ⋅ 𝑇 𝑛/4 and 𝑇 1 = 1
Prove that 𝑇 4𝑘 = 2𝑘
12
Additional Practice Questions
13
For each of the following:
1. Find the exact solution Assume you are given 𝑇 1 = 1
2. Prove by induction
▪ Q7. 𝑇 𝑛 = 4 ⋅ 𝑇(𝑛Τ4)
▪ Q8. 𝑇 𝑛 = 4 ⋅ 𝑇 𝑛/2
▪ Q9. 𝑇 𝑛 = 𝑇 𝑛 − 1 + 𝑛
▪ Q10. 𝑇 𝑛 = 2 ⋅ 𝑇 𝑛/2 + 1
▪ Q11. 𝑇 𝑛 = 𝑛 ⋅ 𝑇 𝑛 − 1
14
Thank you
15