Math Fundamentals18 sections · 814 units
Open in Course

Manipulating Inequalities

Proving bounds

In algorithm analysis, you often need to prove that one expression is bounded by another. This requires manipulating inequalities.

For example, to show 2n+35n2n + 3 \leq 5n for n1n \geq 1, subtract 2n2n from both sides: 33n3 \leq 3n, then divide by 33: 1n1 \leq n. This is true when n1n \geq 1.

These steps justify why you can write O(2n+3)=O(n)O(2n + 3) = O(n) for large nn. The algebra proves the simplification.