in Algorithms edited by
709 views
2 votes
2 votes

Assume you have two positive functions $f$ and $g$ such that $f(n)$ is in $O(g(n))$. For each of the following statements, decide which one(s) is/are always TRUE.

  1. $2^{f(n)}$ is $O\left(2^{g(n)}\right)$
  2. $f(n)^{2}$ is $O\left(g(n)^{2}\right)$
  3. $f(n)=O\left((f(n))^{2}\right)$
  4. $g(n)=\Omega(g(n))$
in Algorithms edited by
709 views

3 Comments

@GO Classes Any explanation for option C not being correct?

2
2
Take f(n) = 1/n now.  

F(n)=f(n)^2

1/n = 1/n^2

As the value of n increase the LHS function will reduce..

And it deny the property of big-oh
0
0
Can we consider a function like that one? It is strictly decreasing and I wonder if those functions come across in real-life complexity analysis.
0
0

1 Answer

1 vote
1 vote
@okntk

f(n) = 1/n and f(n)^2 = 1/n^2

f(n) will grow faster than f(n)^2

2 Comments

can you write counter example for option A, why it is not correct ?
0
0
@Mukulvyas consider f(n) = 2n  and g(n) = n

we can prove f(n) = O(g(n))  where 2n <= c n

where c(constant) is 3  and n0>1

But now to our problem 2^f(n) = O(2^g(n))

f(n) = 2n and g(n) =n

so 2^2n <= c 2^n

we can’t prove, it because 2^2n = 2^n *2^n

2^n *2^n <= c * 2^n

2^n <= c

cause c is constant it can’t be greater than variable 2^n

So,This option is incorrect.
0
0
Answer:

Related questions