Monday 1 April 2019

UGC NET Computer Science July 2018 - II Question 21

Question 21

The solution of the recurrence relation
T(m) = T( 3m/4) + 1 is :

Options:
  1. (1) θ (lg m)
  2. (2) θ (m)
  3. (3) θ (mlg m)
  4. (4) θ (lglg m)
Answer : (1) θ (lg m)

Explanation Question 21

In this problem we use Master’s Theorem:
T(m)
= T(3m/4) + 1
= T(m/(4/3)) + 1

Now, compare above equation with below equation,
T(m) = aT(m/b) + nklogpn
then, we can get a = 1, b = 4/3, k = 0 and p = 0

Here, From above values we can conclude that we have to apply case 2 of Master's Theorem
a = 1 = b0 = bk
∴ a=bk

So, Apply case 2 of Master's Theorem
Here, p>-1,
∴ case 2 - (a) will be applicable from below master theorem.
∴ T(m) = θ( m(logba)log(p+1)m)

So, now after substituting values a=1, b=4/3, k=0 and p=0 in above equation.
∴ T(m) = θ( m(log4/31)log(0+1)m)

Now applying, log4/31 = 0
∴ T(m) = θ( m0log1m)
∴ T(m) = θ(log m)

So, Option (1) is correct answer.

Algorithms: Masters theorem
T(n) = a T(n/b) + Θ(nk logp n) where a > = 1, b > 1, k > = 0 , and p is real number

Case 1: if a > bk, Then T(n) =Θ(n^(logba))

Case 2: a = bk
a)if p > -1, Then T(n) = Θ( n(logba)log(p+1)n)
b)if p = -1, Then T(n) = Θ( n(logba)loglogn)
c) if p < -1, Then T(n) = Θ( n(logba))

Case 3: a < bk, a)if p > =0, then T(n) = Θ(nk logp n))
b) if p<0 then T(n) = Θ(nk)



Previous
Next
UGC NET CS 2018 July - II Question 20UGC NET CS 2018 July - II Question 22

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts