Skip to main content

DSAPath8 mincore

Big-O, Big-Omega, and Big-Theta

Big-O, Big-Omega, and Big-Theta describe upper, lower, and tight asymptotic bounds. Knowing the difference prevents loose or false runtime claims.

Why This Matters

Saying an algorithm is O(n2)O(n^2) may be true and useless if the real cost is Θ(n)\Theta(n). The notation must say whether you mean an upper bound, lower bound, or tight growth rate.

Core Idea

NotationMeaning
O(g(n))O(g(n))asymptotic upper bound
Ω(g(n))\Omega(g(n))asymptotic lower bound
Θ(g(n))\Theta(g(n))both upper and lower bound

Worked example: merge sort is O(nlogn)O(n \log n) and Ω(nlogn)\Omega(n \log n) in the comparison model, so its running time is Θ(nlogn)\Theta(n \log n).

Common Mistakes

  • Using Big-O when Big-Theta is known.
  • Saying "at least Big-O." Lower bounds use Big-Omega.
  • Treating all upper bounds as tight. nn is also O(n2)O(n^2).

Exercises

  • Explain why 3n+73n + 7 is Θ(n)\Theta(n).
  • Give a loose but true Big-O bound for binary search.
  • State why comparison sorting has an Ω(nlogn)\Omega(n \log n) lower bound.

Next Topics

References

  • Cormen, Leiserson, Rivest, Stein. Introduction to Algorithms (4th ed., 2022). Ch. 3.
  • Knuth. The Art of Computer Programming, Volume 1: Fundamental Algorithms (3rd ed.).