I need help proving that if f(n) = O(g(n)) implies 2^(f(n)) = O(2^g(n)))

前端 未结 3 765
闹比i
闹比i 2020-12-30 08:30

In a previous problem, I showed (hopefully correctly) that f(n) = O(g(n)) implies lg(f(n)) = O(lg(g(n))) with sufficient conditions (e.g., lg

3条回答
  •  忘掉有多难
    2020-12-30 08:47

    For any f,g: N->R*, if f(n) = O(g(n)) then 2^(f(n) = O(2^g(n)) (1)

    We can disprove (1) by finding a counter-example.

    Suppose (1) is true -> by Big-O definition, there exists c>0 and integer m >= 0 such that:

    2^f(n) <= c2^g(n) , for all n >= m (2)

    Select f(n) = 2n, g(n) = n, we also have f(n) = O(g(n)), apply them to (2).

    -> 2^(2n) <= c2^n -> 2^n <= c (3)

    This means: there exists c>0 and integer m >= 0 such that: 2^n <= c , for all n >= m.

    There is no such c, because if there is, we always find n > lg(c) that makes (3) not true: 2^n >= c, for all n >= lg(c).

    Therefore, (1) cannot be true.

提交回复
热议问题