in Algorithms retagged by
841 views
0 votes
0 votes

Which of the following is true? (GATE CS 2000)

formula
(a) h(n) is 0(f(n))
(b) h(n) is 0(g(n))
(c) g(n) is not 0(f(n))
(d) f(n) is 0(g(n))

in Algorithms retagged by
841 views

2 Answers

1 vote
1 vote

Answer: Option (D)

Here g(n) = 2*n$^{\sqrt{n}}$ .  

(Just Simplify it)

So, we can say that f(n) $\equiv$ g(n) .

And thus first two options are Wrong as h(n) = nn    (Just represented in different Form)

This means option D is right Only.

2 Comments

not a very clear explanation
0
0

See, f(n) = 3nn√n .

and   g(n) = 2nn√n .

So  we can say that f(n) and g(n) both will rise on the same rate. And we can represent them as f(n) =g(n) = k*nn√n . where k is Const.  

And h(n) = n! that is nearly equal to nn . For such a big n. 

Now , see only Option D satisfies the Relations.

Tell me If you are getting this or not!!!

0
0
0 votes
0 votes
Answer is D.

Solution:. Simplify the functions by taking logarithm of each function:

log(f(n)) = ( sqrt n) log (base 3) n

log(g(n)) = (sqrt n) log (base 2) n

log(h(n)) = log (n!). But according to Stirling's approximation n! = O(n^n)

So, log(h(n)) = n log n

 

Hence, we can see that log(f(n))= log(g(n)) < log(h(n)). (asymptotically)

It implies f(n) = g(n) < h(n)

The only option that satisfies this is option D which says f(n) = O(g(n)) which is true because f(n) = Theta( g(n))
Answer:

Related questions