Use python to solve the following and please give a detailed

Use python to solve the following and please give a detailed solution.

Solve the following recurrence relations and give a bound for each of them. T (n) = T(n - 1) + e^n, where c> 1 is some constant T(n) = T(n - 1) + n^c, where c greaterthanorequalto 1 is a constant T(n) = 49T(n/25) + n^3/2 log n

Solution

1. T(n)=T(n-1)+cn

solution - T(n-1)=T(n-2)+c(n-1) and so on..

so cn is the upper bound, every term is asymptotically smaller than cn

T(n)=(cn)

For question 2 and 3--

Master\'s theorem solves the recurrence relations of type T(n)=aT(n/b)+f(n) . In this 3 cases are formed.

Case 1: if f(n)=O(nc) and where c<logba

Case 2: f(n)=(nclogn) where c=logba

Case 3:f(n)=(nc) where c>logba

So we calculated logba and compared with c which you will get when you write f(n) as asymptotic notation then decide the case and use the master\'s theorem result.

2.T(n)=T(n-1)+nc

solution - Applying master\'s theorem logba=0 where a=1 and c> logba

so T(n)= (nc)

3.T(n)=49T(n/25)+n3/2logn

solution - Applying master\'s theorem f(n)=omega(n3/2) , c=3/2

so c>log2549

T(n)=(n3/2logn)

Use python to solve the following and please give a detailed solution. Solve the following recurrence relations and give a bound for each of them. T (n) = T(n -

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site