taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.11.1-13

Exercise 1.2.11.1-13

not stated yet in Lean solution written

RatingM10
MarkersM (mathematical)
KindK2, decide: say whether a claim holds from the written solution
SectionSection 1.2.11.1 of Volume 1. Companion chapter: The O-notation

The task

Decide whether g(n)=Ω(f(n))g(n)=\Omega(f(n)) holds if and only if f(n)=O(g(n))f(n)=O(g(n)).

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Write both statements with constants and compare.

Solution

Show the solution

The statement is true. By definition, g(n)=Ω(f(n))g(n)=\Omega(f(n)) means that there are L>0L>0 and n0n_0 with ∣g(n)∣≥L∣f(n)∣|g(n)|\ge L|f(n)| for n≥n0n\ge n_0. And f(n)=O(g(n))f(n)=O(g(n)) means that there are M>0M>0 and n0n_0 with ∣f(n)∣≤M∣g(n)∣|f(n)|\le M|g(n)| for n≥n0n\ge n_0.

If ∣g(n)∣≥L∣f(n)∣|g(n)|\ge L|f(n)|, then ∣f(n)∣≤1L∣g(n)∣|f(n)|\le\frac1L|g(n)|, which is the second statement with M=1/LM=1/L. If ∣f(n)∣≤M∣g(n)∣|f(n)|\le M|g(n)|, then ∣g(n)∣≥1M∣f(n)∣|g(n)|\ge\frac1M|f(n)|, which is the first statement with L=1/ML=1/M. Each constant is positive, and n0n_0 is the same.

Check

Take f(n)=nf(n)=n and g(n)=n2g(n)=n^2. Then g=Ω(f)g=\Omega(f) with L=1L=1 and f=O(g)f=O(g) with M=1M=1. For f=n2f=n^2 and g=ng=n, neither statement holds.

Remarks

So g=Θ(f)g=\Theta(f) holds if and only if both f=O(g)f=O(g) and g=O(f)g=O(f).

This solution is drafted, and a person has not reviewed it yet. The source.

In Lean

not stated yet The exercise is not stated in Lean yet.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.