Related Articles
Difference between Big Oh, Big Omega and Big Theta
• Difficulty Level : Easy
• Last Updated : 26 Feb, 2021

Prerequisite – Asymptotic Notations, Properties of Asymptotic Notations
1. Big Oh notation (O) :
Big oh notation is used to describe asymptotic upper bound.

Mathematically, if f(n) describe running time of an algorithm; f(n) is O(g(n)) if there exist positive constant C and no such that

`0 <=f(n) <= c g(n) for all n>=n0`

n = used to give upper bound an a function.
If a function is O(n), it is automatically O(n-square) as well !

Graphic example for Big oh (O) : 2. Big Omega notation (Ω) :
Just like O notation provide an asymptotic upper bound, Ω notation provides asymptotic lower bound.
Let f(n) define running time of an algorithm;

f(n) is said to be Ω(g (n)) if there exists positive constant C and (n 0 ) such that

`O<= C g(n) <= f(n) for all n>=n 0`

n= used to given lower bound on a function
If a function is O(n-square ) it is automatically O(n) as well.

Graphical example for Big Omega (Ω) : 3. Big Theta notation (Θ) :
Let f(n) define running time of an algorithm.

f(n) is said to be Θ(g(n)) if f(n) is O(g(n)) and f(n) is Ω(g(n))

Mathematically,

```O<=f(n)<=C 1 g(n) for n>=n 0

O<= C 2 g(n)<=f(n) for n >=n 0```

Merging both the equation, we get :

`O<=C 2 g(n)<=f(n)<=C 1 g(n) for n>=n 0`

The equation simply means there exist positive constants C 1 and C 2 such that f(n) is sandwich between C 2 g(n) and C 1 g(n).

Graphic example of Big Theta (Θ) : Difference Between Big oh, Big Omega and Big Theta :

My Personal Notes arrow_drop_up