1

I am trying to solve this recurrence assuming n is odd: $T(n) = T(n - 4) + \Theta n$

What I did so far was:

First, $T(n - 4) = T(n - 8) + (n - 4) $, thus we get $T(n) = T(n - 8) + (n - 4) + n$

Next, $T(n - 8) = T(n - 12) + (n - 8)$, thus we get $T(n) = T(n - 12) + (n - 8) + (n - 4) + n$

Next, $T(n - 12) = T(n - 16) + (n - 12)$, thus we get $T(n) = T(n - 16) + (n - 12) + (n - 8) + (n - 4) + n$

So know I am seeing that where this is going, I wrote the general form:

$T(n) = T(n - 4k) + [n - 4(k - 1)] + [n - 4(k - 2)] + ... + (n - 4) + n$

As mentioned, we have n is odd so I write it as $n = 2k + 1$, in which we get $k = \frac{n - 1}{2}$. So I will plug that in to get:

$T(n) = T(-n + 2) + (-n + 6) + (-n + 10) + ... + (n - 4) + n$

This is where I am stuck. I suspect that the $(n - 4) + n$ must have gone wrong - but I am not too sure but I decided to ask you guys.

Thank you so much!

DiMario
  • 11
  • 2

0 Answers0