Quiz Entry - updated: 2026.09.18
Show that $2n + 10$ is $O(n)$ by finding suitable constants.
Take $c = 3$ and $n_0 = 10$: then $2n + 10 \le 3n$ holds for every $n \ge 10$.
* With c = 3 the two lines meet at n = 10, and 2n + 10 stays under 3n from there on. *
Work backwards from what you need:
$$2n + 10 \le c \cdot n$$
Pick a $c$ larger than the leading coefficient 2 — say $c = 3$ — so that the inequality has room to work with. Rearranging:
$$2n + 10 \le 3n \iff 10 \le n$$
So the bound holds from $n_0 = 10$ onwards, and the pair $(c, n_0) = (3, 10)$ witnesses $2n + 10 \in O(n)$.
Two things this worked example teaches:
- The witnesses are not unique. $c = 4, n_0 = 5$ works just as well, and so does $c = 12, n_0 = 1$. You only have to produce one pair — you are not searching for the best one.
- Why $c$ must exceed the leading coefficient. With $c = 2$ the inequality becomes $2n + 10 \le 2n$, i.e. $10 \le 0$: false for every $n$. The surplus in $c$ is what eventually absorbs the $+10$, and this is the general pattern — a polynomial's lower-order terms are always absorbed by taking $c$ a little above the leading coefficient.