Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE 2017 MOCK II | Question 17

  • Last Updated : 28 Jun, 2021

Consider the case: f(n) = O(g(n)).

Then, following two statements are claimed to be inferred from the above case.

Statement I: 2f(n) = O(2g(n))
Statement II: 2g(n) = O(2f(n))

Choose the correct option from the given.

(A) Both statements are true
(B) Both statements are false
(C) Statement I is true and Statement II is false
(D) Statement I is false and Statement II is true

Answer: (B)

Explanation: if f(n) = n and g(n) = 2n.
then f(n) = O(g(n))
here, 2^n = O(2^(2n)) = O(4^n), but not vice versa. Hence, I is true. II is false.
Now, if f(n) = 2n and g(n) = n
then also f(n) = O(g(n)) because we can ignore constant
but, 2^(2n) != O(2^n), hence I is false, but II is true.

In both of the above cases, f(n) = O(g(n)). But both the cases are counter of each other. Hence both I and II are wrong.

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :