Given the three absolute value functions:
f1 (x) = − |x − 1|, f2 (x) = − |x − 2|, f3 (x) = |x − 3|
How do I maximize the sum of these three functions?
Given the three absolute value functions:
f1 (x) = − |x − 1|, f2 (x) = − |x − 2|, f3 (x) = |x − 3|
How do I maximize the sum of these three functions?
On
First, let's look at $f_2 + f_3$.
Clearly, the contributions of $f_2$ and $f_3$ cannot cause a maximum or minimum to be distinguishable on $(-\infty, 2]$ or on $[3,\infty]$. Since the maximum of $f_1$ occurs at $1$, and this is in the interval for the maximum of $f_2 + f_3$, themaximum is at $x = 1$.
How else could we get this?
Consequently, the total slope is $1$ on $(-\infty,1)$, $-1$ on $(1,2)$, $-3$ on $(2,3)$, and $-1$ on $(3, \infty)$. The only transition from rising to falling slopes is at $1$, so the objective function has a local maximum at $x=1$. Since the value of the objective function only increases as $x$ increases to $1$ (from the left) and only decreases as $x$ increases from $1$ (to the right), $x = 1$ is the location of the global maximum.
Direct method
Plot of -|x-1|-|x-2|+|x-3|