0% found this document useful (0 votes)
454 views2 pages

Asymptotic Notation Cheat Sheet

The document provides a cheat sheet on asymptotic notation, defining six symbols used to describe the growth rates of functions, including Θ, O, Ω, o, ω, and ∼. It explains the relationships between these notations and how limits can reveal asymptotic relationships between functions. Additionally, it includes a theorem demonstrating that logarithms grow slower than polynomials, which in turn grow slower than exponentials, supported by proofs using limits.

Uploaded by

nakbeta4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
454 views2 pages

Asymptotic Notation Cheat Sheet

The document provides a cheat sheet on asymptotic notation, defining six symbols used to describe the growth rates of functions, including Θ, O, Ω, o, ω, and ∼. It explains the relationships between these notations and how limits can reveal asymptotic relationships between functions. Additionally, it includes a theorem demonstrating that logarithms grow slower than polynomials, which in turn grow slower than exponentials, supported by proofs using limits.

Uploaded by

nakbeta4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

6.042/18.

062J Mathematics for Computer Science October 19, 2004


Tom Leighton and Ronitt Rubinfeld

The Asymptotic Cheat Sheet


Asymptotic notation consists of six funny symbols used to describe the relative growth
rates of functions. These six symbols are defined in the table below.

f = Θ(g) f grows at the same rate as g There exists an n0 and constants c1 , c2 > 0 such
that for all n > n0 , c1 g(n) ≤ |f (n)| ≤ c2 g(n).

f = O(g) f grows no faster than g There exists an n0 and a constant c > 0 such that
for all n > n0 , |f (n)| ≤ cg(n).

f = Ω(g) f grows at least as fast as g There exists an n0 and a constant c > 0 such that
for all n > n0 , cg(n) ≤ |f (n)|.

f = o(g) f grows slower than g For all c > 0, there exists an n0 such that for all
n > n0 , |f (n)| ≤ cg(n).

f = ω(g) f grows faster than g For all c > 0, there exists an n0 such that for all
n > n0 , cg(n) ≤ |f (n)|.

f ∼g f /g approaches 1 limn→∞ f (n)/g(n) = 1

The ∼ and Θ notations are confusingly similar; qualitatively, functions related by ∼


must be even more nearly alike then functions related by Θ. The ω notation makes the
table nice and symmetric, but is almost never used in practice. Some asymptotic relation-
ships between functions imply other relationships. Some examples are listed below.

f = O(g) and f = Ω(g) ⇔ f = Θ(g) f = o(g) ⇒ f = O(g)


f = O(g) ⇔ g = Ω(f ) f = ω(g) ⇒ f = Ω(g)
f = o(g) ⇔ g = ω(f ) f ∼ g ⇒ f = Θ(g)
12 The Asymptotic Cheat Sheet

Limits
The definitions of the various asymptotic notations are closely related to the definition
of a limit. As a result, limn→∞ f (n)/g(n) reveals a lot about the asymptotic relationship
between f and g, provided the limit exists. The table below translates facts about the limit
of f /g into facts about the asymptotic relationship between f and g.

limn→∞ f (n)/g(n) $= 0, ∞ ⇒ f = Θ(g) limn→∞ f (n)/g(n) = 1 ⇒ f ∼ g


limn→∞ f (n)/g(n) $= ∞ ⇒ f = O(g) limn→∞ f (n)/g(n) = 0 ⇒ f = o(g)
limn→∞ f (n)/g(n) $= 0 ⇒ f = Ω(g) limn→∞ f (n)/g(n) = ∞ ⇒ f = ω(g)

Therefore, skill with limits can be helpful in working out asymptotic relationships. In
particular, recall L’Hospital’s Rule:

f (n) f # (n)
If lim f (n) = ∞ and lim g(n) = ∞, then lim = lim # .
n→∞ n→∞ n→∞ g(n) n→∞ g (n)

Every computer scientist knows two rules of thumb about asymptotics: logarithms
grow more slowly than polynomials and polynomials grow more slowly than exponen-
tials. We’ll prove these facts using limits.

Theorem. For all α, k > 0:

(ln n)k = o(nα ) (1)


k
n = o((1 + α) ) n
(2)

Proof.
! "k ! "k ! "k
(ln n)k ln n ∗ 1/n 1
lim = lim α/k = lim = lim =0
n→∞ nα n→∞ n n→∞ (α/k)nα/k−1 n→∞ (α/k)nα/k

! "k ! "k
nk n ∗ 1
lim = lim = lim =0
n→∞ (1 + α)n n→∞ (1 + α)n/k n→∞ (n/k) · (1 + α)n/k−1

The starred equalities follow from L’Hospital’s Rule.

You might also like