[ACCEPTED]-O-notation, O(∞) = O(1)?-big-o
Infinity is not a number, or at least not 7 a real number, so the expression is malformed. The 6 correct way to express this is to simply 5 state that a program doesn't terminate. Note: program, not 4 algorithm, as an algorithm is guaranteed to terminate.
(If 3 you wanted, you might be able to define 2 big-O notation on transfinite numbers. I'm 1 not sure if that would be of any use, though.)
Your argument is not quite correct.
Big O 6 notation disregards constant multiples; there's 5 no difference between O(1)
and O(42)
, or between 4 O(log(n))
and O(3π log(n))
.
Standard convention is to not use 3 any constant multiples.
However, O(∞)
would mean 2 an “algorithm” that never terminates, as opposed 1 to O(1)
which will terminate at some point.
To answer the question :
O-notation, O(∞) = O(1)?
No
The 11 main difference is that O(1) will end at 10 some point, while O(∞) never ends.
They 9 both don't include a variable, but have 8 both different meanings :
O(1)
(or O(121) or 7 O(whatever but not infinity) : independendent 6 of the functions arguments, but ending
O(∞)
: independendent 5 of the functions arguments, and non ending
As 4 pointed out in another answer, infinity 3 isn't really in the domain of the big-O 2 notation, but the simple 'no' than remains 1 of course, O(1) and O(∞) are not the same.
Big-Oh is a measure of how something the 3 resources required scales as N increases. O(5 2 hours) and O(5 seconds) are both O(1) since 1 no extra resources are needed as N increases.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.