66 views

f(n)=O(g(n))

Which of the following is True?

1. 2^f(n)=O(2^(g(n))
2. log(f(n))=O(log(g(n))
3. f(n)=O(f(n/2))
4. f(n)=O(f(n)^2)
| 66 views
0
answer is B but can someone help me to how to solve these questions with 100% accuracy because i'm always trying to find counterexample and don't know a formal way to solve
0

@Mk Utkarsh could you please share your solution, I am a bit confused between D and B

+1
let $f(n) =\frac{1}{n}$

$(f(n))^2 = \frac{1}{n^2}$

$f(n) \neq O(\frac{1}{n^2})$

So D is incorrect and i'm not able to find counter example of B
0
B is the correct answer bro!