diff --git a/other/clrs/07/04/03.markdown b/other/clrs/07/04/03.markdown index 21435baa..0cc8ece4 100644 --- a/other/clrs/07/04/03.markdown +++ b/other/clrs/07/04/03.markdown @@ -1,13 +1,14 @@ > Show that the expression $q^2 + (n - q - 1)^2$ achieves a maximum over $q = > 0, 1, \ldots, n-1$ when $q = 0$ and $q = n - 1$. + $$ \begin{align} f(q) &= q^2 + (n - q - 1)^2 \\\\ f'(q) &= 2q - 2(n - q - 1) = 4q - 2n + 2 \\\\ f''(q) &= 4 \\\\ \end{align} $$ -$f'(q) = 0$ when $q = \frac{1}{2}n - \frac{1}{4}$. $f'(q)$ is also continious. +$f'(q) = 0$ when $q = \frac{1}{2}n - \frac{1}{2}$. $f'(q)$ is also continuous. $\forall q : f''(q) > 0$, which means that $f'(q)$ is negative left of $f'(q) = 0$ and positive right of it, which means that this is a local minima. In this case, $f(q)$ is decreasing in the beginning of the interval and increasing in