Exercise 1,192
Solution
- $f(x)=\sum_{k=1}^{20}k\left|x-\frac1k\right|$ is piecewise linear, with slope (weight of the points $\frac1k$ left of $x$) minus (weight of those to the right), where $\frac1k$ has weight $k$. So $f$ is smallest where the weights strictly to the left and strictly to the right of $x$ are each at most half of the total weight $210$, that is, at most $105$.
- Since $15+16+\cdots+20=105$ and $1+2+\cdots+14=105$, the slope is $0$ on $\left[\frac1{15},\frac1{14}\right]$, so $f$ is constant and minimal there; in particular the minimum is attained at $x=\frac1{15}$.
- $f\left(\frac1{15}\right)=\sum_{k=1}^{15}\left(1-\frac k{15}\right)+\sum_{k=16}^{20}\left(\frac k{15}-1\right)=(15-8)+(6-5)=\boxed{8}$.