Prove the bound of T(n) = 2T(n/3) + O(n) using the guess-and-verification method.
Step 1: Guess T(n) =
Step 2: Prove the guess.
Step a: Assume that the bound holds for all for an appropriate choice of constant.
By definition,
Step b: In particular, let
, yielding
Step c: Substitute the inequality in the original recurrence, yielding The (part of inequality) is trivially satisfied.
Step d:
>(w)I
(simplified) <
(the target inequality) for
(show appropriate constant)
Step e: Prove that holds for boundary cases. Assume T(1) = O(1) = 1.
Then T0
and 1
Let n= , plug n in hypothesis yields does not hold true) for
. The hypothesis holds true (or
Let n=
, plug n in hypothesis yields The hypothesis holds true (or does not hold true) for (If the previous boundary case holds, no need to
show this one.)
Step f: The inductive hypothesis holds true for boundary cases for
Conclude: