2

I recently was introduced to solving recurrence bounds by substitution but there's something i don't understand about it.

In standard induction proofs you prove a base case, assume it holds for n then show it holds for n+1 and therefore show it applies to integers larger than the base case.

For when you solve recurrences like T(n) = T(n/2) the proof has a base, assumes T(n/2) then proves it holds for T(n). Does this proof not only hold for the numbers that are multiples of two of the base cases? Would this not require an infinitely large number of base cases to show what it holds for?

Could someone please explain this to me?

Raphael
  • 73,212
  • 30
  • 182
  • 400

2 Answers2

1

You're entirely correct - if all you prove is $T(1)$ and $T(n/2) \Rightarrow T(n)$, then you prove that $T(n)$ holds for all powers of $2$. One way to fix that is to prove $T(n)$ for all odd $n$, but that defeats the idea of induction. Instead, usually one actually proves the stronger $T(\lfloor n/2 \rfloor) \Rightarrow T(n)$ or $T(\lceil n/2 \rceil) \Rightarrow T(n)$, and both are enough to deduce $T(n)$ for all $n$.

In many cases, if you can prove $T(n/2) \Rightarrow T(n)$ then you can also prove the stronger claims, but it's technically more awkward. So instead of dealing with this mess, you are only shown the weaker claim. The "interesting" ideas are found already there, and to prove the stronger claim requires just working harder but no new ideas (other than routine tricks used for handling floors and ceilings).

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
1

I suppose what you mean by "substitution method" is guess & proof (by induction).

Be aware that you do perform an induction proof. By strengthening the induction hypothesis to all $n' < n$, the proof can go through -- if your parameters are naturals. That where you trip since $\frac{n}{2}$ is not always natural.

There are two ways for approaching this.

  • In the context of divide & conquer recurrences we usually solve the recurrence only for $n=2^k$ (that's how we get the form at hand); that should occur somewhere in the presentation/textbook. We do that because things become less messy to deal with, technically, and because we know that (under certain conditions¹) the result carries over.

  • Solve the original recurrence which probably has the form

    $\qquad T(n) = T(\lceil n/2 \rceil) + T(\lfloor n/2 \rfloor) + f(n)$.

    Many methods for solving recurrences become messy because of the rounding, but guess & proof should be fine.


  1. It's not trivial to see when and why we get the correct result by this method, but that's probably beyond your concern right now.
Raphael
  • 73,212
  • 30
  • 182
  • 400