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

前端 未结 3 752
闹比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 09:12

    If f(n) = O(g(n)),
    2^(f(n)) not equal to O(2^g(n)))

    Let, f(n) = 2log n and g(n) = log n
    (Assume log is to the base 2)

    We know, 2log n <= c(log n) therefore f(n) = O(g(n))

    2^(f(n)) = 2^log n^2 = n^2
    2^(g(n)) = 2^log n = n

    We know that
    n^2 is not O(n)

    Therefore, 2^(f(n)) not equal to O(2^g(n)))

提交回复
热议问题