0

I came across two asymptotic function proofs.

  1. f(n) = O(g(n)) implies 2^f(n) = O(2^g(n))

    Given: f(n) ≤ C1 g(n)
         So, 2^f(n) ≤ 2^C1 g(n)                        --(i)
    
    Now, 2^f(n) = O(2^g(n)) → 2^f(n) ≤ C2 2^g(n)                  --(ii)
    
    From,(i) we find that (ii) will be true.
    Hence 2^f(n) = O(2^g(n)) is TRUE.
    

Can you tell me if this proof is right? Is there any other way to solve this?

2.f(n) = O((f(n))^2)

How to prove the second example? Here I consider two cases one is if f(n)<1 and other is f(n)>1.

Note: None of them are homework questions. 
Andrew
  • 71
  • 2
  • 5

1 Answers1

0

The attempted-proof for example 1 looks well-intentioned but is flawed. First, “2^f(n) ≤ 2^C1 g(n)” means 2^f(n) ≤ (2^C1)*g(n), which in general is false. It should have been written 2^f(n) ≤ 2^(C1*g(n)). In the line beginning with “Now”, you should explicitly say C2 = 2^C1. The claim “(ii) will be true” is vacuous (there is no (ii)).

A function like f(n) = 1/n disproves the claim in example 2 because there are no constants N and C such that for all n > N, f(n) < C*(f(n))². Proof: Let some N and C be given. Choose n>N, n>C. f(n) = 1/n = n*(1/n²) > C*(1/n²) = C*(f(n))². Because N and C were arbitrarily chosen, this shows that there are no fixed values of N and C such that for all n > N, f(n) < C*(f(n))², QED.

Saying that “f(n) ≥ 1” is not enough to allow proving the second claim; but if you write “f(n) ≥ 1 for all n” or “f() ≥ 1” it is provable. For example, if f(n) = 1/n for odd n and 1+n for even n, we have f(n) > 1 for even n > 0, and less than 1 for odd n. To prove that f(n) = O((f(n))²) is false, use the same proof as in the previous paragraph but with the additional provision that n is even.

Actually, “f(n) ≥ 1 for all n” is stronger than necessary to ensure f(n) = O((f(n))²). Let ε be any fixed positive value. No matter how small ε is, “f(n) ≥ ε for all n > N'” ensures f(n) = O((f(n))²). To prove this, take C = max(1, 1/ε) and N=N'.

James Waldby - jwpat7
  • 8,593
  • 2
  • 22
  • 37