0

Find the value of $x$ so that $|x-1|+|2x-1|+|3x-1|+\dotsb +|119x-1|$ is minimum. Based on my trial-and-error method in Desmos, I am getting $x=\frac{1}{118}$; how do I get the correct answer?

1 Answers1

2

At $x=\frac1n$ for an integer $n$ with $1\leq n\leq119$, the slope of $f$ increases by $2n$. For negative $x$, the slope is equal to $-1-2-\cdots-119=-7140$, and for $x>1$, the slope is $1+2+\cdots+119=7140$. We have to check for which $n$ the slope changes from negative to positive.

So we want to find the greatest $n$ such that $2\cdot119+2\cdot118+\cdots+2n\geq 7140$. The left-hand side is equal to $$ \frac{(2\cdot119+2n)(120-n)}{2}=14280+n-n^2 $$ and now we can just solve: $$ 14280+n-n^2\geq 7140\\ n^2-n-7140\leq 0\\ n\leq85 $$ So at $n=85$ the direction of the slope changes, so $x=\frac1{85}$ gives the minimum. The fact that we actually get an exact integer solution to the inequality means we can also choose $n=84$, as between those two points the slope is actually horizontal.

Arthur
  • 199,419