Question

In: Computer Science

Derive a Θ-bound on the solution to the following recurrence. using iterative recursion and check your...

Derive a Θ-bound on the solution to the following recurrence. using iterative recursion and check your answer with master theorem result

T(n) = T (1/3 n) + log n

Solutions

Expert Solution

Hi,

------------------------------------------------------------------

T(n) = T (1/3 n) + log n

T(n) = T (n/31) + log n

=T(n/32) + log(n/31)+log(n/30)

=T(n/33) + log(n/32) + log(n/31)+log(n/30)

  =T(n/34) + log(n/32) + log(n/31)+log(n/30)

+................+

if n= 3k then n/3k =1 and k= log3n and  T(1)=1

=T(n/3k) +log(n/3k-1) +  log(n/3k-2) + ..............+ log(n/32) + log(n/31)+log(n/30)

=T(1) + log(n/3k-1) +  log(n/3k-2) + ..............+ log(n/32) + log(n/31)+log(n/30)

=1+ log(n/3k-1) +  log(n/3k-2)   + ..............+ log(n/32) + log(n/31)+log(n/30)

=1+ log(3k/3k-1) +  log(3k/3k-2)   + ..............+ log(3k/32) + log(3k/31)+log(3k/30)    n= 3k

=1+ log3 + log32 + .....+ log3k-2 + log3k-1 + log3k

=1+ log33 + 2log33 + .....+ (k-2)log33 + (k-1)log33 + (k)log33  

=1+1+2+....+(k-2)+(k-1)+k

=1+ k(k+1)/2

=1+ k2/2 + k/2

=1+( log2n)/2 +( log​​​​​​​n)/2

now we ignore the constant terms and smaller terms.

T(n) = Θ(log2n) <---Answer

----------------------------------------------------------------------------------------------

Using Master Theorem

if T(n) =aT(n/b)+f(n) then T(n) = Θ(nlogba)

-----------------------------------------------------------

given T(n) = T (n/3) + log n

so a = 1 and b = 3 and f(n) =Θ log(n) where k =1

---------------------------------------------------

then T(n) = Θ(nlogba) = Θ(nlog31) = Θ(1)

here T(n) is logarithm time smaller than f(n)

----------------------------------------------------------

using master theorem special case :

if nlogba is logarithm time smaller than f(n) then T(n) = Θ(nlogba(log)k+1)

------------------------------------------------------------------------

so T(n) = Θ(nlog31(log)1+1) log31 = 0

T(n) = Θ(n0(log)1+1) ∵ n0 = 1

T(n) = Θ(log​​​​​​​2n) <---Answer

Conclusion: Iterative and master theorem both produce same result.

----------------------------------------------------------------------------------

Still if you have any doubt or need any kind of improvement, please let me know in comment section and if you like, Please upvote.

Thank You !


Related Solutions

Use a recursion tree to determine a good asymptotic upper bound on the recurrence ?(?) =...
Use a recursion tree to determine a good asymptotic upper bound on the recurrence ?(?) = 3?(?/3) + ?. Use the substitution method to verify your answer.
1 (10 pts) Give a big-θ bound for the solutions of the following recurrence relations. Show...
1 (10 pts) Give a big-θ bound for the solutions of the following recurrence relations. Show work. (a) T(n) = 8T(n/2) + n^3 + 100n (b) T(n) = 5T(n/4) + 3n (c) T(n) = 7T(n/3) + 100n^2 (d) T(n) = 3T(n/3) + 1000√ n (e) T(n) = T(n − 1) + n^2
Use a recursion tree to determine a good asymptotic upper bound on the recurrence T(n) =...
Use a recursion tree to determine a good asymptotic upper bound on the recurrence T(n) = 2T(n/3) + 2n. Use the substitution method to verify your answer
Use the recursion tree method to determine the asymptoticupper bound of T(n).T(n) satisfies the recurrence T(n)=2T(n-1)+...
Use the recursion tree method to determine the asymptoticupper bound of T(n).T(n) satisfies the recurrence T(n)=2T(n-1)+ c, where c is a positive constant, andT(0)=0.
Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use...
Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use the substitution method to verify your answer. T(n) = 3T(n/2) + n. T(n) = T(n/2) + n2.
Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use...
Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use the substitution method to verify your answer. T(n) = 3T(n/2) + n. T(n) = T(n/2) + n2.
Solve the following recurrence relations: (find an asymptotic upper bound O(?) for each one) a. T(n)...
Solve the following recurrence relations: (find an asymptotic upper bound O(?) for each one) a. T(n) = T(2n/3)+T(n/3) + n^2 b. T(n) = √nT(√n) + n c. T(n) = T(n-1)+T(n/2) + n The base case is that constant size problems can be solved in constant time (O(1)). You can use the induction, substitution or recursion tree method
Please find a solution to the following: Δu=0, 1<r<4, 0≤θ<2π u(1,θ)=cos5*θ, 0<θ<2π u(4,θ)=sin4*θ, 0<θ<2π
Please find a solution to the following: Δu=0, 1<r<4, 0≤θ<2π u(1,θ)=cos5*θ, 0<θ<2π u(4,θ)=sin4*θ, 0<θ<2π
Find the closed formula solution to each of the following recurrence relations with the given initial...
Find the closed formula solution to each of the following recurrence relations with the given initial conditions. Use an iterative approach and show your work! What is a_100? a) a_n=a_(n-1)+2,a_0=3 b) a_n=a_(n-1)+2n+3,a_0=4 c) a_n=2a_(n-1)-1,a_0=1 d) a_n=-a_(n-1),a_0=5
Find the closed formula solution to each of the following recurrence relations with the given initial...
Find the closed formula solution to each of the following recurrence relations with the given initial conditions. Use an iterative approach and show your work! What is a100 ? an=an-1+2, a0=3 an=an-1+2n+3, a0=4 an=2an-1-1, a0=1 an=-an-1, a0=5
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT