0

I was reading CLRS book to understand solving recurrences using Substitution method and found following example:

   Recurrence, T(n) = 2T(n/2) + n
   Guess Solution, T(n) = O(nlgn)
   Proof that T(n) ≤ cnlgn

enter image description here

My questions are:

Q1: why the solving equation changes their signs between inequality & equality sign ≤ , = ?

Q2: We know that in mathematical induction, inductive step is the next value,So if current value is n then next value should be (n+1).But Why they used n/2 as the next inductive step ?

Please help me to explain these question.It will rally help me to understand Substitution Method.Thanks

user5005768Himadree
  • 1,375
  • 3
  • 23
  • 61

1 Answers1

1

Q1 : The two equalities are just rewritings of the previous line since log(a/b) = log(a) - log(b) and log(2) = 1

Q2 : For the induction step, since we write T(n) in function of T(n/2), one step is directly a 2-factor. If the recurrence formula was T(n) = f(T(n-1)), you would have the classical induction step with a 1-addition.

Note also that you assume in this proof that T(1) can be done in constant time.

Damien Prot
  • 573
  • 3
  • 7
  • Thanks @Damien Prot for ur reply, After reading your helpful reply i've 2 more questions regarding my post questions for more better understanding: **Q1. (cn lg(n/2) + n), (cn lg n - cn lg 2 + n) and (cn lg n - cn + n ) are equivalent, that's why used Equal sign.However the Inequality is still there between R.H.S and L.H.S. inequality ?** **Q2. The next value inductive step depend on how the Recurrence Relation is Evolving.Based on this, it could be Greater or Less than the previous input size ?** Thanks – user5005768Himadree Aug 05 '16 at 08:03
  • 1
    Q1 : yes, that's it. Q2 : yes, the inductive step depends on the recurrence relation. – Damien Prot Aug 05 '16 at 08:30
  • Thanks @Damien Prot .Also you said, T(1) can be done in constant time. I apply T(n) = cnlgn for T(1) = c.1. lg 1 = 0 then why it is constant time ? – user5005768Himadree Aug 05 '16 at 08:31
  • 1
    Imagine that T(1) can be done in O(n²), clearly your complexity for T(n) cannot O(n lg n). – Damien Prot Aug 05 '16 at 11:57
  • Thanks @Damien Prot. got it – user5005768Himadree Aug 05 '16 at 12:21