Professional Documents
Culture Documents
that 0 <= c1*g(n) <= f(n) <= c2*g(n) for all n >= n0}
Given:
Then
f(n)+g(n)= n2 + n
3. f (n) = O(g(n)) implies lg(f (n)) = O(lg(g(n))), where lg(g(n)) ≥ 1 and f (n) ≥ 1 for
all sufficiently large n
given:
n0 such that 0 <= f(n) <= c*g(n) for all n >= n0}
Hence,
0≤lg(f(n))≤lgc+lg(g(n))≤k⋅lg(g(n))
Therefore,
lg(f(n))=O(lg(g(n)))
Let f(n)=2n and g(n)=n
Hence, f(n)=O(g(n)) but 22n=4n≠O(2n)
i.e. f(n)=O((f(n))2).
from the first, we know that 0 ≤f(n) ≤cg(n) and we need to prove that 0≤df(n)≤g(n), which is
absolutely correct with d=1/c
Let f(n)=4n
4n ≠ Θ(4n/2)= Θ(2n)
So this is false.
We know that,
f(n)≤f(n)+O(f(n))≤2f(n)
Therefore,
f(n)+o(f(n))=Θ(f(n))
so this is true