# CMPSCI 311: Theory of Algorithms

### David Mix Barrington

### Fall, 2003

### Discussion Notes #2

### from Wednesday 17 Sept 2003

Here we solve some recurrence relations of various types. In each case
find the function of n that satisfies the recurrence and the initial
conditions, and prove by induction that your answer is correct. In the
case of the last three, you need only find a solution that is correct when
n is a power of two.
Please answer the questions *during the discussion period*.

**Question 1:**
A(n) = A(n-1) + 3n^{2} -3n +1; A(0) = 0
**Question 2:**
B(n) = 2B(n-1) - B(n-2); B(0) = 0, B(1) = 1
**Question 3:**
C(n) = 3C(n-1) - 2C(n-2); C(0)=0, C(1)=1
**Question 4:**
D(n) = 2D(n/2) + 3; D(1) = 1 (solve for n=2^{k})
**Question 5:**
E(n) = 2E(n/2) + n; E(1) = 0 (solve for n=2^{k})
**Question 6:**
F(n) = 2F(n/2) + n^{2}; F(1) = 2 (solve for n=2^{k})

Last modified 17 September 2003