Intuition The one-sentence picture
If O O O says "your algorithm is no slower than this," then Ω \Omega Ω says "your algorithm is no faster than this," and Θ \Theta Θ is when both agree — the growth is trapped between two copies of the same function.
Big-O O O alone is a promise of a ceiling . Saying "this sort is O ( n 2 ) O(n^2) O ( n 2 ) " forbids it from being slower, but it does NOT forbid it from secretly being faster (every O ( n ) O(n) O ( n ) algorithm is also O ( n 2 ) O(n^2) O ( n 2 ) , trivially!). So O O O can be loose . To say "this growth is exactly n 2 n^2 n 2 , no looser," we need a matching floor (Ω \Omega Ω ) plus the ceiling (O O O ). When floor and ceiling are the same shape, we have a tight bound Θ \Theta Θ .
So the family is:
O O O — upper bound (≤ kind of statement)
Ω \Omega Ω — lower bound (≥ kind of statement)
Θ \Theta Θ — tight, both at once (= kind of statement)
We compare functions f ( n ) f(n) f ( n ) (your cost) and g ( n ) g(n) g ( n ) (a clean reference like n n n , n 2 n^2 n 2 , n log n n\log n n log n ) as n → ∞ n\to\infty n → ∞ . We don't care about small n n n or constant factors — only the shape of growth .
We want "f f f grows no faster than g g g ." Growth "no faster" means that after some point , f f f stays under a scaled copy of g g g :
f ( n ) = O ( g ( n ) ) ⟺ ∃ c > 0 , n 0 > 0 : 0 ≤ f ( n ) ≤ c g ( n ) ∀ n ≥ n 0 f(n) = O(g(n)) \iff \exists\, c>0,\ n_0>0 \ :\ 0 \le f(n) \le c\,g(n)\quad \forall n\ge n_0 f ( n ) = O ( g ( n )) ⟺ ∃ c > 0 , n 0 > 0 : 0 ≤ f ( n ) ≤ c g ( n ) ∀ n ≥ n 0
Intuition WHY the constant
c c c and the threshold n 0 n_0 n 0 ?
c c c kills constant factors (a 2× slower machine shouldn't change the class). n 0 n_0 n 0 kills small-n n n noise (startup overheads, a slow first iteration). We only judge the eventual trend.
"f f f grows no slower than g g g " — flip the inequality:
Ω \Omega Ω ) — lower bound
f ( n ) = Ω ( g ( n ) ) ⟺ ∃ c > 0 , n 0 > 0 : 0 ≤ = = c g ( n ) ≤ f ( n ) = = ∀ n ≥ n 0 f(n)=\Omega(g(n)) \iff \exists\, c>0,\ n_0>0\ :\ 0 \le ==c\,g(n) \le f(n)== \quad \forall n\ge n_0 f ( n ) = Ω ( g ( n )) ⟺ ∃ c > 0 , n 0 > 0 : 0 ≤== c g ( n ) ≤ f ( n ) == ∀ n ≥ n 0
Read: eventually f f f stays above a scaled copy of g g g . So g g g is a floor on f f f 's growth.
If g g g is both a ceiling and a floor (with possibly different constants), the growth is pinned:
Θ \Theta Θ ) — tight bound
f ( n ) = Θ ( g ( n ) ) ⟺ ∃ c 1 , c 2 > 0 , n 0 > 0 : = = 0 ≤ c 1 g ( n ) ≤ f ( n ) ≤ c 2 g ( n ) = = ∀ n ≥ n 0 f(n)=\Theta(g(n)) \iff \exists\, c_1,c_2>0,\ n_0>0\ :\ ==0 \le c_1 g(n) \le f(n) \le c_2 g(n)== \quad \forall n\ge n_0 f ( n ) = Θ ( g ( n )) ⟺ ∃ c 1 , c 2 > 0 , n 0 > 0 : == 0 ≤ c 1 g ( n ) ≤ f ( n ) ≤ c 2 g ( n ) == ∀ n ≥ n 0
Equivalently: f = Θ ( g ) ⟺ f = O ( g ) AND f = Ω ( g ) f=\Theta(g) \iff f=O(g)\ \text{AND}\ f=\Omega(g) f = Θ ( g ) ⟺ f = O ( g ) AND f = Ω ( g ) .
3 n 2 + 5 n + 7 = Θ ( n 2 ) 3n^2+5n+7 = \Theta(n^2) 3 n 2 + 5 n + 7 = Θ ( n 2 )
Upper: for n ≥ 1 n\ge 1 n ≥ 1 , 3 n 2 + 5 n + 7 ≤ 3 n 2 + 5 n 2 + 7 n 2 = 15 n 2 3n^2+5n+7 \le 3n^2+5n^2+7n^2 = 15n^2 3 n 2 + 5 n + 7 ≤ 3 n 2 + 5 n 2 + 7 n 2 = 15 n 2 . So c 2 = 15 c_2=15 c 2 = 15 . Why this step? We replaced lower-order terms 5 n , 7 5n,7 5 n , 7 by bigger n 2 n^2 n 2 terms — legal because that only makes the right side larger, proving the ≤ \le ≤ .
Lower: 3 n 2 + 5 n + 7 ≥ 3 n 2 3n^2+5n+7 \ge 3n^2 3 n 2 + 5 n + 7 ≥ 3 n 2 for all n ≥ 0 n\ge 0 n ≥ 0 (extra terms are positive). So c 1 = 3 c_1=3 c 1 = 3 . Why? Dropping positive terms only shrinks the expression, giving a clean floor.
Conclude: 3 n 2 ≤ f ( n ) ≤ 15 n 2 3n^2 \le f(n)\le 15n^2 3 n 2 ≤ f ( n ) ≤ 15 n 2 for n ≥ 1 n\ge1 n ≥ 1 ⇒ f = Θ ( n 2 ) f=\Theta(n^2) f = Θ ( n 2 ) with c 1 = 3 , c 2 = 15 , n 0 = 1 c_1=3,c_2=15,n_0=1 c 1 = 3 , c 2 = 15 , n 0 = 1 . ∎
n 2 ≠ O ( n ) n^2 \ne O(n) n 2 = O ( n ) — i.e. n 2 = Ω ( n ) n^2=\Omega(n) n 2 = Ω ( n ) but not Θ ( n ) \Theta(n) Θ ( n )
Suppose n 2 ≤ c n n^2\le c\,n n 2 ≤ c n . Divide by n > 0 n>0 n > 0 : n ≤ c n\le c n ≤ c . Why this step? For it to hold for all large n n n , the constant c c c would have to exceed every n n n — impossible. So no constant works → not O ( n ) O(n) O ( n ) .
But n 2 ≥ 1 ⋅ n n^2\ge 1\cdot n n 2 ≥ 1 ⋅ n for n ≥ 1 n\ge1 n ≥ 1 , so n 2 = Ω ( n ) n^2=\Omega(n) n 2 = Ω ( n ) . Floor yes, ceiling no ⇒ not tight . ∎
Worked example 3) Lower bound of a problem vs an algorithm
Comparison-based sorting needs Ω ( n log n ) \Omega(n\log n) Ω ( n log n ) comparisons — this is a bound on every possible algorithm for the problem (proved via the decision-tree height log 2 ( n ! ) = Θ ( n log n ) \log_2(n!)=\Theta(n\log n) log 2 ( n !) = Θ ( n log n ) ). Merge sort runs in O ( n log n ) O(n\log n) O ( n log n ) . Since algorithm-upper meets problem-lower, merge sort is optimal : Θ ( n log n ) \Theta(n\log n) Θ ( n log n ) . Why this matters: Ω \Omega Ω on the problem tells you no cleverness can do better.
Ω \Omega Ω describes the best case."
Why it feels right: "lower" sounds like "fastest/easiest input." The truth: O , Ω , Θ O,\Omega,\Theta O , Ω , Θ are about how a function T ( n ) T(n) T ( n ) grows; best/worst/average is a separate axis (which input you picked). You can say "worst-case time is Ω ( n log n ) \Omega(n\log n) Ω ( n log n ) " — that's a lower bound on the worst case . Fix: decide (1) which case you analyze, then (2) bound that case's function with O O O /Ω \Omega Ω /Θ \Theta Θ .
O O O is the worst case, Big-Ω \Omega Ω the best case."
Why it feels right: worst is "highest," best is "lowest," matching the words. Fix: Same as above — bound symbols ≠ case selection. An algorithm can be Θ ( n 2 ) \Theta(n^2) Θ ( n 2 ) in the worst case and Θ ( n ) \Theta(n) Θ ( n ) in the best case simultaneously.
Common mistake "Every algorithm has a
Θ \Theta Θ ."
Why it feels right: functions usually have a clean shape. The truth: if best and worst differ in order , no single Θ \Theta Θ exists for the whole runtime. E.g. insertion sort: best Θ ( n ) \Theta(n) Θ ( n ) , worst Θ ( n 2 ) \Theta(n^2) Θ ( n 2 ) — overall runtime is O ( n 2 ) O(n^2) O ( n 2 ) and Ω ( n ) \Omega(n) Ω ( n ) , but not Θ \Theta Θ of anything single. Fix: state Θ \Theta Θ per case, or use O O O /Ω \Omega Ω for the spread.
f = O ( g ) f=O(g) f = O ( g ) means they're equal-ish, so write O ( g ) = f O(g)=f O ( g ) = f ."
Why it feels right: the "=" looks symmetric. Fix: the "=" is a one-way "is a member of." Θ \Theta Θ is the only symmetric one (f = Θ ( g ) ⟺ g = Θ ( f ) f=\Theta(g)\iff g=\Theta(f) f = Θ ( g ) ⟺ g = Θ ( f ) ).
Recall Feynman: explain to a 12-year-old
Imagine guessing how tall a kid will be. Big-O O O is the parent saying "he won't be taller than 6 feet" (a ceiling). Big-Ω \Omega Ω is "he won't be shorter than 5 feet" (a floor). Big-Θ \Theta Θ is when both squeeze together — "he'll be right around 5'6", give or take" — so you know his height pretty exactly . We ignore baby photos (small n n n ) and don't care if you measure in inches or cm (constants); we only care how tall he ends up.
Mnemonic Remember the shapes
O verhead = O = ceiling (≤). Ω looks like an upside-down cup holding things up = floor (≥). Θ has a bar through the middle = pinned th rough the middle = th eta = tight .
Definition of f = Ω ( g ) f=\Omega(g) f = Ω ( g ) ? ∃ c > 0 , n 0 > 0 : 0 ≤ c g ( n ) ≤ f ( n ) \exists c>0,n_0>0:\ 0\le c\,g(n)\le f(n) ∃ c > 0 , n 0 > 0 : 0 ≤ c g ( n ) ≤ f ( n ) for all
n ≥ n 0 n\ge n_0 n ≥ n 0 (eventual floor).
Definition of f = Θ ( g ) f=\Theta(g) f = Θ ( g ) ? ∃ c 1 , c 2 , n 0 > 0 : 0 ≤ c 1 g ( n ) ≤ f ( n ) ≤ c 2 g ( n ) \exists c_1,c_2,n_0>0:\ 0\le c_1g(n)\le f(n)\le c_2g(n) ∃ c 1 , c 2 , n 0 > 0 : 0 ≤ c 1 g ( n ) ≤ f ( n ) ≤ c 2 g ( n ) for all
n ≥ n 0 n\ge n_0 n ≥ n 0 .
Θ \Theta Θ in terms of O O O and Ω \Omega Ω ?f = Θ ( g ) ⟺ f = O ( g ) and f = Ω ( g ) f=\Theta(g) \iff f=O(g)\ \text{and}\ f=\Omega(g) f = Θ ( g ) ⟺ f = O ( g ) and f = Ω ( g ) .
Limit test: if lim f / g = 0 \lim f/g = 0 lim f / g = 0 ? f = O ( g ) f=O(g) f = O ( g ) but not
Ω ( g ) \Omega(g) Ω ( g ) → strictly smaller order (
o ( g ) o(g) o ( g ) ).
Limit test: if lim f / g = ∞ \lim f/g = \infty lim f / g = ∞ ? f = Ω ( g ) f=\Omega(g) f = Ω ( g ) but not
O ( g ) O(g) O ( g ) → strictly larger order (
ω ( g ) \omega(g) ω ( g ) ).
Limit test: if 0 < lim f / g < ∞ 0<\lim f/g<\infty 0 < lim f / g < ∞ ? f = Θ ( g ) f=\Theta(g) f = Θ ( g ) — same growth shape.
Is n 2 = O ( n ) n^2=O(n) n 2 = O ( n ) ? No;
n ≤ c n\le c n ≤ c can't hold for all large
n n n . But
n 2 = Ω ( n ) n^2=\Omega(n) n 2 = Ω ( n ) .
Why does Ω \Omega Ω ≠ "best case"? Bound symbols measure a function's growth; best/worst/average is a separate axis (which input).
Lower bound for comparison sorting, and why? Ω ( n log n ) \Omega(n\log n) Ω ( n log n ) , from decision-tree height
log 2 ( n ! ) = Θ ( n log n ) \log_2(n!)=\Theta(n\log n) log 2 ( n !) = Θ ( n log n ) .
Which Big-notation relation is symmetric? Θ \Theta Θ :
f = Θ ( g ) ⟺ g = Θ ( f ) f=\Theta(g)\iff g=\Theta(f) f = Θ ( g ) ⟺ g = Θ ( f ) .
Insertion sort: single Θ \Theta Θ for runtime? No — best
Θ ( n ) \Theta(n) Θ ( n ) , worst
Θ ( n 2 ) \Theta(n^2) Θ ( n 2 ) , so overall only
O ( n 2 ) O(n^2) O ( n 2 ) ,
Ω ( n ) \Omega(n) Ω ( n ) .
Roles of c c c and n 0 n_0 n 0 ? c c c ignores constant factors;
n 0 n_0 n 0 ignores small-
n n n behavior.
kills constants and small-n noise
f n cost vs g n reference
constant c and threshold n0
Intuition Hinglish mein samjho
Dekho, complexity me teen bhai hote hain: Big-O, Big-Omega aur Big-Theta. Big-O bolta hai "isse zyada slow nahi hoga" — yani upar ki ceiling. Big-Omega (Ω \Omega Ω ) ulta hai: "isse zyada fast nahi hoga" — yani niche ka floor. Aur jab dono ek hi shape (jaise n 2 n^2 n 2 ) ke nikal aaye, tab Theta (Θ \Theta Θ ) milta hai — matlab growth bilkul pin ho gayi, na upar na niche. Isiliye Theta ko tight bound kehte hain.
Formula ka asli jadoo do cheezon me hai: constant c c c aur threshold n 0 n_0 n 0 . c c c constant factors ko ignore karta hai (2x slow machine se class nahi badalti), aur n 0 n_0 n 0 chhote n n n ke jhamele ignore karta hai (sirf bade n n n ka trend dekho). Ek fast trick: ratio f / g f/g f / g ka limit lo — agar 0 0 0 aaya to f f f chhota order, agar infinity aaya to bada order, aur agar koi finite non-zero number aaya, to Θ \Theta Θ confirmed, kyunki constant ratio ka matlab same shape.
Sabse bada confusion: log sochte hain "Ω \Omega Ω matlab best case." Galat! Best/worst/average alag axis hai (kaun sa input chuna). O , Ω , Θ O,\Omega,\Theta O , Ω , Θ to sirf function ki growth naapte hain. Tum keh sakte ho "worst case time Ω ( n log n ) \Omega(n\log n) Ω ( n log n ) hai" — yani worst case ka bhi floor.
Yeh matter kyun karta hai? Kyunki Ω \Omega Ω se hum problem ki limit jaante hain. Jaise comparison sorting kabhi n log n n\log n n log n se fast nahi ho sakti (Ω ( n log n ) \Omega(n\log n) Ω ( n log n ) ). Merge sort O ( n log n ) O(n\log n) O ( n log n ) deta hai — dono mil gaye, to merge sort optimal hai. Isi tarah Ω \Omega Ω batata hai ki "ab isse aage smart hone ka fayda nahi."