Computing Science 162: Notes on Big-Oh

An example proof that one function is in the big-Oh of another:



Claim: 16 n2 + 5n ∈ O(n2-1)

Proof:
16 n2 + 5n ≤ 16 n2 + 5n2, ∀ n ≥ 1
⇒16 n2 + 5n ≤ 31n2, ∀ n ≥ 1
⇒16 n2 + 5n ≤ 62(n2/2), ∀ n ≥ 1
⇒16 n2 + 5n ≤ 62(n2/2 - 1 ) + 62, ∀ n ≥ 1
⇒16 n2 + 5n ≤ 62(n2/2 - 1 ) + (n2/2 - 1), ∀ n ≥ 16, since 62 ≤ 127 ≤ (n2/2 -1) when n ≥ 16
⇒16 n2 + 5n ≤ 63(n2/2 - 1 ) ∀ n ≥ 16
⇒ 16 n2 + 5n ∈ O(n2-1) as witnessed by c=63 and n0=16.