Recurrence Relation (asymptotic notation) The question is - Solve the recurrence: T ( n

Mara Cook

Mara Cook

Answered question

2022-06-16

Recurrence Relation (asymptotic notation)
The question is - Solve the recurrence: T ( n ) = T ( n / 2 ) + O ( n ) and T ( 1 ) = c, where c is constant.

Answer & Explanation

plodno8n

plodno8n

Beginner2022-06-17Added 17 answers

Step 1
According to the Master Theorem, your problem has the form:
T ( n ) = 1 T ( n 2 ) + f ( n ) with f ( n ) = O ( n 1 ) meaning c = 1 and the critical exponent equal to c c r i t = log 2 ( 1 ) = 0. Since c > c c r i t and we do not know f to be lower bounded this does not directly fit any of the cases in the theorem.
Let us instead do the analysis from the bottom:
Since f ( n ) = O ( n ) there exists A, N such that:
f ( n ) A n for  n N
Step 2
Furthermore, we may find an upper bound B for the earlier values of T(n):
T ( n ) B for  n < N
Thus given n N we have:
T ( n ) = T ( n 2 ) + f ( n ) B + A n 2 t + . . . + A n = B + A n ( 1 + 1 2 + . . . + 1 2 t ) B + 2 A n
This clearly shows that T ( n ) = O ( n ). The number of terms turns out to be irrelevant.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?