How would you prove that constant is a subset of logarithmic?

AI Thread Summary
Constant time complexity O(1) can be proven as a subset of logarithmic time complexity O(log n) by leveraging the definition of Big-Oh. For any function f in O(1), there exist constants x_0 and M such that f(x) is bounded above by M for all x greater than x_0. By choosing x_1 as the maximum of x_0 and n, it can be shown that f(x) remains less than or equal to M, which is also less than or equal to M log n for sufficiently large n. This demonstrates that O(1) is indeed a subset of O(log n), supporting the broader classification of time complexities. The discussion emphasizes the importance of understanding these relationships within the context of algorithm analysis.
aaa59
Messages
8
Reaction score
0
O(1) is constant
O(log n to the base 2) is logarithmic
O(n) linear

how would you prove that constant is a subset of logartihmic?
 
Mathematics news on Phys.org
O(1) = O(log_2 1) = O(0)
 
I should have been clearer.

given "Big-Oh" sets
O(1): constant
O(log2(n)): logarithmic
O(n): linear
O(nlog2(n)): n log n
O(n^2): quadratic
O(n^3): cubic
O(n^m), m>1: polynomial of order m
O(c^n), c>1: exponential
O(n!): factorial

Prove
Constant is a subset of logarithmic
logarithmic is a subset of linear
n log n is a subset of polynomial
exponential is a subset of factorial

Thank you
 
aaa59 said:
I should have been clearer.

given "Big-Oh" sets
O(1): constant
O(log2(n)): logarithmic
O(n): linear
O(nlog2(n)): n log n
O(n^2): quadratic
O(n^3): cubic
O(n^m), m>1: polynomial of order m
O(c^n), c>1: exponential
O(n!): factorial

Prove
Constant is a subset of logarithmic
logarithmic is a subset of linear
n log n is a subset of polynomial
exponential is a subset of factorial

Thank you
Most follow fairly easily from the definition of Big-Oh. For instance let f be an arbitrary function in O(1). We now wish to show that f is in O(\log_n(n)). Because of the definition of O(1) there exist some x_0 and M such that f(x) \leq M for all x > x_0. Now let x_1 = \max(x_0,n) then f(x) \leq M \leq M\log_n(x) for all x > x_1 so f(x) = O(\log_n(n)). Here we took advantage of the fact that the logarithm is increasing and \log_n(x) \geq 1 when x \geq n.

If you have problems with any specific steps you should post the specific problem you're having.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...

Similar threads

Replies
2
Views
989
Replies
2
Views
13K
Replies
1
Views
575
Replies
10
Views
2K
Replies
20
Views
4K
Back
Top