Asymptotic Order of Growth
Go through the O, Ω, and Θ notations and asymptotic bounds in this lesson.
Introduction
In the asymptotic analysis, we want to estimate the running time of an algorithm when it runs on very large inputs of length . The most common way to do this is analyzing the worst-case running time , where we want to estimate a bound on the largest possible running time of the algorithm, depending on the input size , and examine how grows with . According to Sipser (2012), this happens “by considering only the highest order term of the expression for the running time of the algorithm, disregarding both the coefficient of that term and any lower order terms, because the highest order term dominates the other terms on large inputs” (
Example 1
Let be an algorithm that takes at most steps. In asymptotic analysis, we say grows like .
, and notations
Asymptotic upper bounds
When we want to describe the worst-case running time of a certain algorithm on an input size , we determine its asymptotic upper bound. We use the big- notation to give an upper bound on a function.
Big- notation
Let be a function and its input size. We say if there exist constants and such that for all , or formally:
When , we say that is an asymptotic upper bound for (
The idea behind the Big- notation is shown in this figure.
Example
We generalize the case of this example by considering an algorithm whose running time is for positive constants and . This example claims that we can say this function is . This is true because for all , it holds that and . Thus, we can conclude that
for all . This fulfils the equation of the definition () because , with .
Figure 1:
Get hands-on with 1200+ tech skills courses.