5

I have written a recurrence relation to describe a recursive algorithm finding the maximum element in an array. The algorthim has an overlap, meaning both of the subarrays that are recurred on contain the middle element of the array.

$T(n) = 2T((n+1)/2) + c$

However, I want to simplify this recurrence relation more.

Since you can often times omit floors and ceilings in recurrence relations, can I omit the $+ 1$?

If so, then my relation is now: $T(n) = 2T(n/2) + c$

Would this alter my big-Theta time complexity? Why or why not?

Raphael
  • 73,212
  • 30
  • 182
  • 400
leviless
  • 65
  • 1
  • 1
  • 5

2 Answers2

4

This probably does not change the asymptotic order.

From $T'(n) = 2 T'(n/2) + c$, you can obtain $T'(n) = \Theta(n)$.

Then you can try to prove that your original $T(n) = \Theta(n)$ by mathematical induction.

hengxin
  • 9,671
  • 3
  • 37
  • 75
0

We can rewrite the original recurrence as

$$T(n-1+1)=2T(\frac{n-1}2+1)+c$$ or, setting $m:=n-1$ and $S(m):=T(m+1)$,

$$S(m)=2S(\frac m2)+c,$$ which is of the simplified type.

After solving for $S(m)$,

$$T(n)=S(n-1)$$ and the solutions are virtually identical.