
Big O, Little O, and Omega Notations
Big O, Little O, and Omega Notations
In computer science and mathematics, asymptotic notations are used to describe the behavior of functions, particularly in the context of algorithms. These notations give us a way to express the efficiency of an algorithm in terms of time or space complexity as the input size grows. The three most commonly used asymptotic notations are Big O (O), Little o (o), and Omega (Ω). These notations provide different ways to classify and compare the growth rates of functions.
Big O notation is the most commonly used notation for describing the upper bound of an algorithm’s complexity. It represents the worst-case scenario, or the maximum amount of time (or space) an algorithm can take to complete as a function of the input size .
For two functions and , we say that:
In simpler terms, Big O describes an upper bound, meaning that the function will never grow faster than , up to a constant factor.
If , we can say that , because as grows large, the term dominates and the other terms become insignificant. Therefore, we can say that the growth of is bounded by in the worst case.
Little o notation is used to describe a strict upper bound, meaning that one function grows strictly slower than another function as the input size grows. In other words, Little o gives a more precise comparison where the growth rate of is strictly smaller than , as approaches infinity.
For two functions and , we say that:
This means that grows strictly slower than as becomes very large, and it will eventually be dominated by .
If and , then , because grows strictly slower than as increases. For large enough , will always be greater than , and is asymptotically insignificant compared to .
If an algorithm has complexity but the algorithm performs strictly better, such as , we would express the algorithm’s complexity as , meaning it grows strictly slower than .
Omega notation is used to describe the lower bound of an algorithm’s complexity. It represents the best-case scenario or the minimum time required by an algorithm, i.e., how fast the algorithm will perform in the best case (but not worse).
For two functions and , we say that:
In simpler terms, Omega describes a guaranteed lower bound, meaning that will always take at least as long as up to a constant factor, for large .
If and , then , because for large values of , the term dominates and will always be at least as large as , plus a constant.
| Notation | Meaning | Type of Bound | Best Use Case |
|---|---|---|---|
| Big O (O) | Upper bound (worst-case) behavior of a function. | Asymptotic Upper Bound | Worst-case performance of algorithms. |
| Little o (o) | Strictly smaller upper bound (strictly less growth). | Strict Upper Bound | To express that one function grows strictly slower than another. |
| Omega (Ω) | Lower bound (best-case) behavior of a function. | Asymptotic Lower Bound | Best-case performance of algorithms. |
Big O Example: If an algorithm's time complexity is , it means the algorithm's time will grow no faster than as the input size increases.
Little o Example: If an algorithm's time complexity is , it means the algorithm grows strictly slower than , implying its complexity is less than quadratic growth (e.g., ).
Omega Example: If an algorithm’s time complexity is , it means that, in the best case, the algorithm will require at least linear time.
These notations are essential for analyzing the efficiency of algorithms and understanding their behavior under different conditions, providing valuable insights into both the best and worst-case scenarios.
Open this section to view and download past papers
Click on Show Past Papers to load available exam papers.