Raven
Raven

Reputation: 1

How to prove this using the formal definition of big-O?

I would like to prove that n^1000000 = O(1.000001^n) using the formal definition of big-O. I was wondering if I could do this using a proof by induction or a proof by contradiction. I would also like to do this without using limits.

Upvotes: 0

Views: 381

Answers (2)

Yuhang Liu
Yuhang Liu

Reputation: 11

The formal definition of big-O is: f(n) is O(g(n)) if and only if there exists a positive real number B and a non-negative real number b such that

|f(n)| <= B|g(n)| for all real number n > b

So we want to write the relationship between n^1000000 and 1.000001^n in such a way:

n^1000000 <= B * (1.000001^n) for all n > b


Notation: here we use log(n) for the natural log of n, so n = e^log(n)

n^1000000 = (e^log(n))^1000000 = e^(1000000 * log(n))

1.000001^n = (e^log(1.000001))^n = e^(log(1.000001) * n)

We know that n grows faster than log(n), so even though 1000000 > log(1.000001), log(1.000001) * n > 1000000 * log(n) if n is large enough. That is the same as saying n^1000000 < 1.000001^n if n is larger than some number b (extremely large).

Therefore we can write

n^1000000 <= B * (1.000001^n) for all n > b

where B = 1 and b = some large number that can be calculated by solving 1.000001^b = b^1000000 and log(1.000001) * b > 1000000 * log(b).

Finally, we conclude that n^1000000 = O(1.000001^n).

Upvotes: 1

xenteros
xenteros

Reputation: 15842

You won't prove it because n^1000000 is a function and O(1.000001^n) is a set thus they can't be equal.

Quod erat demonstrandum

Upvotes: 0

Related Questions