I'm trying to determine whether it is: O(1). How can I prove it? In complexity terms, log_b(n) is log(n). So is O(log_2(n)-log_3(n))=O(0)=O(1)? that doesn't seem like a strong proof. Also, this doesn't converge asymptotically, so how can it be O(1)?
Asked
Active
Viewed 200 times
0

Yakk - Adam Nevraumont
- 262,606
- 27
- 330
- 524

Binary
- 147
- 2
- 14
-
It's not a strong proof, because that's not how big-O works. Otherwise you could say `O(x^2) == O(3.x^2) - O(2.x^2) == O(1)`. – Oliver Charlesworth Dec 18 '13 at 18:50
2 Answers
4
...your proof is wrong. O(log_2(n)-log_3(n))==O(log(n)/log(2)-log(n)/log(3))==O(log(n)*(1/log(2)-1/log(3))=O(Clog(n))=O(log(n)).

IdeaHat
- 7,641
- 1
- 22
- 53
0
Also, you might have a look at Wolfram Alpha
It gives some nice plots for log_2(n)-log_3(n)
And, even more important for you, it describes O(log_2(n)-log_3(n))

Mare Infinitus
- 8,024
- 8
- 64
- 113