Friday, 25 August 2017

Chapter 3 Exercise 3.1-2, Introduction to Algorithms, 3rd Edition Thomas H. Cormen

3.1-2 Show that for any real constants a and b, where
b>0,(n+a)b=Θ(nb)


Solution:
To prove this, we have to show that there exists constants c1,c2,n0>0
such that 0c1nb(n+a)bc2nb
  for all nn0

Note that, n+a2n,
when |a|n
Also note, n+a12n,
when |a|n2
 
Therefore, when n2|a|,
0n2n+a2n

As b>0, we can raise all the terms of the previous inequality to the power of b without breaking the inequality:
0(n2)b(n+a)b(2n)b012bnb(n+a)b2bnb

So,(n+a)b=Θ(nb)
because there exists c1=1/2b,c2=2b,
and  n0=2|a|

No comments :

Post a Comment