Chapter 9Complexity Analysisslides.en.pdf:205; notes.en.pdf:141-144

Landau Sets (Big-O, Θ, Ω)

Asymptotic notation done right

Def 0.4Landau sets
Concept

Landau sets (named after Edmund Landau) are classes of functions that
capture asymptotic growth. Three flavours:

Big-O O(g)O(g) — the upper bound:

O(g):={fc>0,n0. nn0. f(n)cg(n)}O(g) := \{f \mid \exists c > 0, n_0.\ \forall n \geq n_0.\ f(n) \leq c \cdot g(n)\}

"ff grows no faster than gg, up to a constant".

Big-Ω Ω(g)\Omega(g) — the lower bound:

Ω(g):={fc>0,n0. nn0. f(n)cg(n)}\Omega(g) := \{f \mid \exists c > 0, n_0.\ \forall n \geq n_0.\ f(n) \geq c \cdot g(n)\}

"ff grows at least as fast as gg, up to a constant".

Big-Θ Θ(g)\Theta(g) — both bounds:

Θ(g):=O(g)Ω(g)\Theta(g) := O(g) \cap \Omega(g)

"ff grows at the same rate as gg, up to a constant".

The constants cc and n0n_0 absorb multiplicative and finite-input noise —
we only care about behavior "in the limit".

Examples:
- 3n+5O(n)3n + 5 \in O(n): take c=4,n0=5c = 4, n_0 = 5. For n5n \geq 5, 3n+54n3n+5 \leq 4n.
- 5n2+100nΘ(n2)5n^2 + 100n \in \Theta(n^2): bounded above and below by cn2cn^2.
- n3O(n2)n^3 \notin O(n^2): any cn2cn^2 is eventually beaten by n3n^3.
- sin(n)O(1)\sin(n) \in O(1): bounded by 11.

The notation f(n)=O(g(n))f(n) = O(g(n)) (with ==) is abuse but extremely common. Strictly
f(n)O(g(n))f(n) \in O(g(n)) — but everyone writes "==".

Induction proofs of Landau-set inclusions

Some Landau-set inclusions are proved by induction on a natural number. The classic: aN.naO(2n)\forall a \in \mathbb{N}.\, n^a \in O(2^n).

Theorem. For every a0a \geq 0, nac2nn^a \leq c \cdot 2^n for all sufficiently large nn (i.e. naO(2n)n^a \in O(2^n)).

Proof by induction on aa.
- Base a=0a = 0: n0=12nn^0 = 1 \leq 2^n for all n0n \geq 0. So c=1c = 1 works. ✓
- Base a=1a = 1: n1=nn^1 = n. We need nc2nn \leq c \cdot 2^n for large nn. For n1n \geq 1, 2nn2^n \geq n, so c=1c = 1 works. ✓
- Step a+1a + 1 (with a1a \geq 1): Assume nac2nn^a \leq c \cdot 2^n for large nn (IH). Then na+1=nnanc2nn^{a+1} = n \cdot n^a \leq n \cdot c \cdot 2^n. We need n2nc2nn \cdot 2^n \leq c' \cdot 2^n, i.e. ncn \leq c'. For ncn \geq c', this holds. So c=ccc' = c \cdot c works (or just nn is bounded by some constant past the threshold).

Wait — that's not quite right. Let me redo more carefully:

na+1=nnan(c2n)n^{a+1} = n \cdot n^a \leq n \cdot (c \cdot 2^n) by IH.

For n2n \geq 2: n2nn \leq 2^n (since 2n2^n grows faster than nn). So na+12nc2n=c2n+1=2c2nn^{a+1} \leq 2^n \cdot c \cdot 2^n = c \cdot 2^{n+1} = 2c \cdot 2^n.

So na+1(2c)2nn^{a+1} \leq (2c) \cdot 2^n for nmax(c,2)n \geq \max(c, 2). This is in O(2n)O(2^n). ✓

Reading. The trick: use n2nn \leq 2^n as a separate bound, then combine. This is a general technique: when proving polynomial vs exponential, isolate the 'extra' polynomial factor and bound it by another exponential.

Generalisation. The same proof technique shows naO(bn)n^a \in O(b^n) for any b>1b > 1.

Practice — score 100% to advance
Multiple choice
Q1
Big-O O(g)O(g) gives a(n)…
Q2
Big-Θ Θ(g)\Theta(g) means…
Q3
3n+5O(n)3n + 5 \in O(n)?
Q4
n3O(n2)n^3 \in O(n^2)?
Q5
Why do Landau sets use nn0n \geq n_0 instead of all nn?
Q6
Is f(n)=O(g(n))f(n) = O(g(n)) strict notation?
Q7
If fΘ(g)f \in \Theta(g), then fO(g)f \in O(g)?
Q8
To prove naO(2n)n^a \in O(2^n), we induct on:
Fill in the blank
Q1
Big-O is an ___ bound; Big-Ω is a ___ bound; Big-Θ is both.
Q2
O(g):={fc,n0. nn0. f(n)cg(n)}O(g) := \{f \mid \exists c, n_0.\ \forall n \geq n_0.\ f(n) \leq c \cdot g(n)\} — here cc absorbs ___ factors and n0n_0 handles ___ inputs.
Q3
The bound n2nn \leq 2^n holds for all nn \geq .
Loading…