Without seeing the general solution in Chapter 3 yet, but having seen the solution for problem (a) and the hint, a good guess is T(n) < cn3log n + bn3
Particularly n3log n + n3
Prove using induction:
PROOF:
Base:
Induction hypothesis:
Induction step: Choose n = n' + 1
T(n) = 8T(n/2) + n3 (is the definition of T(n))
since n/2 < n', by induction hypothesis T(n/2)< c(n/2)3log(n/2) +(n/2)3 ,
< 8[(cn3/8) log(n/2) + n3/8] + n3
is O(n3log n)
Proof
Base: Assumption: Proof
Order:
n-1   <   n/log n   <   2log2n   <   nlog n   <   n2 Def. f(n) = O(g(n)) iff there exists positive constants c and no such that
f(n) < cg(n) for all n , n > no
Show that the following inequalities are correct:
T(1) = 1 by definition
T(1) < c*13log 1 + b*1 (assume logs are always base 2) implies
1 < 0 + b implies let
b = 1
Assume THM is true: T(n) = 8T(n/2) + n3 <
cn3log n + n3 for all n < n'.
T(n) = 8T(n/2) + n3 and substituting in for T(n/2) we see
T(n) < 8[c(n/2)3 log(n/2) + (n/2)3] + n3
< cn3(log n - log 2) + n3 + n3
< cn3log n - cn3 + 2n3
with c=1,
< n3log n + n3
= 1+ 2 + 4 + 8 + ...+ 2n
n Summation exponentially 0 20 = 1 21-1
1 20 + 21 = 3 22-1
2 20 + 21+22= 7 23-1
3 20 + 21+22+23=15 24-1
= 2n+1 - 1
2n+1 - 1 = 20+1 - 1 = 2-1 = 1
SHOW true for n + 1, i.e.,
= 1+ 2 + 4 + 8 + ...+ 2n + 2n+1
=(
by inductive assumption
= (2n+1 - 1) + 2n+1
= 2(2n+1) - 1
= 2n+2 - 1
iff there exists positive constants c1, c2 and no
such that c1g(n) < f(n) < c2g(n) for all n , n > no
(n2)
Let c1 = 3, c2 = 5, no = 3
3n2 < 5n2 - 6n < 5n2
-2n2 < - 6n < 0 divide by negative changes direction of inequality
0 < 3 < n for all n , n > 3 DONE
n! = n*(n-1)*(n-2)* ... *(n-(n-1)). Choose c,no = 1
n*(n-1)*(n-2)* ... *(n-(n-1))< nn
n/n*(n-1)/n*(n-2)/n*...*1/n < 1
for all n , n > 1 each of these multiplicands will be < 1 and hence will have a product < 1 DONE
(n22n)
Let c1 = 2, c2 = 4, no = 1
2n22n < 2n22n + nlogn < 4n22n
1 < 1 + logn/2n2n < 2
0 < logn/2n2n < 1 since log n < n << 2n for all n , n > 1 we know that this term is always a fraction between 0 (inclusive) and 1. DONE
Note that for proving inequalities do not hold, it is not sufficient simply to find specific c's and n's that do not work since I may be able to find a c or n that does. Hence, you need to show that sooner or later any choice of c will have a problem. This is usually done by considering the fact that the statement must be true "for all n, n > n0"
Specifically, that n approaches infinity.
Suppose there is a c and no such that
10n2 + 9 < cn for all n , n > no
This would imply that 10n+9/n < c for all n , n > no
Or, more specifically, that n < (c-9/n)/10 for all n , n > no
But no matter what c or no one chooses, I can always find an n > no to show this statement is incorrect since c will be bound but n can grow infinitely and 9/n will approach 0.
Specifically, for any c, I could choose n = (c/10) + 1 and we have a contradiction
(n2)
Suppose there are c1, c2 and no such that
c1n2 < n2log n < c2n2 For all n , n > no
then c1 < log n < c2 For all n , n > no
As n increases, log n increases, hence the right since of the inequality cannot be satisfied since no matter what c2 is we can always find a large enough n.
consider log n < c2. This would mean that 2 log n < 2c2 (hard to read - this is 2 to the power c2) or
n < 2c2. Hence, again, the right side is bound but n can grow infinitely.
For any c, choose n = 2c2 + 1 and we have a contradiction.