3.1.6 · D1Complexity Analysis

Foundations — Tight bounds — Θ notation; lower bounds — Ω notation

2,112 words10 min readBack to topic

This page assumes nothing. Before you meet and in the parent topic, every squiggle those definitions use gets built here from the ground up, in the order that each one depends on the last.


0. The raw picture: what is a "cost curve"?

Before any symbol, here is the object everything else talks about.

Imagine you run an algorithm on inputs of size 1, 2, 3, … and for each size you write down how much work it does (how many steps, comparisons, or operations). Plot those dots: horizontal axis = input size, vertical axis = work done. Connect them and you get a curve that climbs.

Figure — Tight bounds — Θ notation; lower bounds — Ω notation

1. Functions and the "" notation

The single most-used piece of notation is writing , , . If parentheses-after-a-letter is new, read this.


2. Reference shapes: , , ,

The yardsticks are always simple growth shapes. You must recognise them by eye.

Figure — Tight bounds — Θ notation; lower bounds — Ω notation

3. Two limiting words: and

The definitions in the parent lean on two logic symbols. Here they are, in plain speech.


4. The threshold — "eventually"

Figure — Tight bounds — Θ notation; lower bounds — Ω notation

5. The constant — "same shape, ignore the dial"


6. Now the three bounds are just three sandwiches

With , , , , , all built, the parent's definitions read cleanly. Here is what each one looks like on the axes.

Figure — Tight bounds — Θ notation; lower bounds — Ω notation
  • : your curve stays under the dashed reference — a lid.
  • : your curve stays over the dashed reference — a floor.
  • : your curve is squeezed between two dashed copies of the same reference — pinned to that shape.

That's the entire topic. Everything else (the limit shortcut, the worked examples) is machinery for finding the right and the constants.


7. The "" that isn't equals


8. How these feed the topic

input size n

cost function f of n

reference shape g of n

compare curves as n grows

constant c ignore the dial

threshold n0 ignore small n

for all quantifier

the sandwich definitions

there exists quantifier

Big-O ceiling

Omega floor

Theta tight bound

log n and n log n shapes

Each foundation on the left is a prerequisite for the sandwich definitions, which then split into , , and finally the tight . If any left-hand box is fuzzy, the parent topic will feel like magic — go back and firm it up.



Equipment checklist

What does stand for, and which axis is it?
The input size; the horizontal axis. Bigger = further right.
What is as a picture?
The height of the climbing cost curve at input size .
Why do we compare against a second function ?
We can't name a growth shape from one curve alone; is a clean yardstick (, , ) to match against.
What does count?
How many times you can halve before reaching 1.
Does the log base matter for growth class?
No — different bases differ only by a constant factor, which we ignore.
Read in plain words.
For every at least as big as .
Read in plain words.
There is at least one positive number (we get to pick it once).
Why must be chosen before the ?
A single fixed must work forever; if had to keep growing with , no such constant exists (that's how we disprove a bound).
What does let us ignore, and why?
Small- warm-up noise; the true growth shape only shows in the far-right trend.
What does the constant let us ignore, and why?
Constant factors (hardware speed, units) — they change height, not shape.
On the axes, what does look like?
Your curve staying under a dashed scaled copy of (a lid).
On the axes, what does look like?
Your curve staying over a dashed scaled copy of (a floor).
On the axes, what does look like?
Your curve squeezed between two dashed copies of — pinned.
Is the "" in real equality?
No — it means "is a member of the class"; it's one-directional. Only is symmetric.