5

Problem statement: What is the minimum value of $f(x)=\left|x-1\right| + \left|2x-1\right| + \left|3x-1\right| + \cdots + \left|119x - 1 \right|$?

Quoted portion of a solution I am not understanding: "If we graph each term separately, we will notice that all of the zeros occur at $\frac{1}{m}$, where $m$ is any integer from $1$ to $119$, inclusive: $|mx-1|=0\implies mx=1\implies x=\frac{1}{m}$.

The minimum value of $f(x)$ occurs where the absolute value of the sum of the slopes is at a minimum $\ge 0$, since it is easy to see that the value will be increasing on either side. That means the minimum must happen at some $\frac{1}{m}$."

Question: Is the above clearly explained? I am not understanding it. Can someone break it down for me?

Source: https://artofproblemsolving.com/wiki/index.php/2010_AMC_12A_Problems/Problem_22

Carm
  • 85
  • 1
    No, it's not clearly explained. In fact, the way it's worded, I would say that the argument is wrong. $f(x)$ is a sum of positive terms, that's true, but they appear to conclude directly from that that the minimum of $f(x)$ must be at a value of $x$ that minimizes one of the positive terms, and although that might be the case here, that's not true in general for any sum of positive terms. – Stef Jun 20 '23 at 15:48
  • Mathematica answers $\left{49,\left{x\to \frac{1}{84}\right}\right}$. – user64494 Jun 20 '23 at 16:10
  • Hint:$-x \leq |x| $ – Mostafa Jun 20 '23 at 16:39
  • Related (same problem with different discussion) https://math.stackexchange.com/q/1986115/505767 – user Jun 20 '23 at 17:02

4 Answers4

1

As presented, the argument is indeed not completely clear. What we can say, maybe more clearly, is that:

  • $f$ is countinuous (sum of countinuous functions)
  • $f$ is a piecewise linear/affine function (sum of piecewise linear/affine functions)
  • $f$ is decreasing for $x\le \frac1{119}$ and increasing for $x\ge 1$

therefore, by EVT, minimum value occurs at some breakpoints $x=\frac1{119},\frac1{118},\ldots,\frac12,1 $.

From here, we can obtain a solution in a number of different ways.

For example, we can observe that going from $x\le \frac1{119}$ to $x\ge 1$ slope progressively increases from negative to positive value, thus the minimum occurs when the slope changes from negative to positive or when it is zero.

Suppose then that exists an integer $N$ with $1\le N\le 119$ such that

$$\sum_{k=1}^N k = \sum_{k=N+1}^{119}k \iff \frac{N(N+1)}2=\frac{119(119+1)}2-\frac{N(N+1)}2 \iff N=84$$

that is for $\frac1{85}<x_0<\frac1{84}$ the slope becomes zero and the function is constant with

$$f(x_0)=\overbrace{-(x-1) -(2x-1) - \ldots - (84x-1)}^{\text{84 terms}}+ \overbrace{(85x-1)+ \ldots + (119x-1)}^{\text{35 terms}}=$$

$$\require{cancel}=\cancel{-3570 x}+84\cancel{+3570x}-35=49$$

which is the minimum value.

user
  • 154,566
  • There are a number of points where the derivative does not exist. You should account for these. – Ross Millikan Jun 20 '23 at 16:39
  • @RossMillikan Thanks for the suggestion. Here I'm trying to use just that for $x<1/85$ $f$ is decreasing and that for $x>1/84$ $f$ is increasing without any reference to derivatives. How should I have include this point? Maybe I should mention that $f$ is continuous, I've assumed this fact as a given. – user Jun 20 '23 at 16:47
  • It seems like the first sentence claims the derivative always exists. The minimum of $|x|$ occurs where the derivative does not exist and it seems quite possible that a similar condition obtains here. – Ross Millikan Jun 20 '23 at 17:58
  • @RossMillikan I’m claiming something like: $|x|$ is continuous, increasing for $x\ge0$ and decreasing for $x\le0$ therefore the minimum occurs at$x=0$. Maybe the argument is not completely discussed in detail but my idea is do not refer to derivatives. Let me know your thoughts on that. Thanks – user Jun 20 '23 at 18:16
  • not accepting this as best answer – Carm Jun 21 '23 at 06:46
  • @Carm Thanks for your advise! I’ll try to revise and improve it. – user Jun 21 '23 at 06:57
  • @Carm I've added something more at the discussion – user Jun 21 '23 at 07:42
0

Hint: $$ -x \leq |x| \implies -\sum_{m=1}^{119}({mx -1}) \leq \sum_{m=1}^{119}|mx -1|$$

Mostafa
  • 1,479
  • 14
0

Use the concept of median minimizing the mean deviation $(MD)_x$:

$f(x)=\sum_{k=1}^{119} k|x_k-x|=119*(MD)_x$, $(MD)_x$ mean deviation of $x_k=\frac{1}{k}$ with frequency $f_k=k$. The total no. of data points are $N=\sum_{k=1}^{119} k=119 \times 60=7140.$ So the median $x_m$ will be $x_m=1/84$ as $3570= \frac{84*85}{2}$. Finally, $$\text{Mon}(f(x))=f(x_m)=\sum_{k=1}^{119}|1-k x_m|=\sum_{k=1}^{119}|k/84-1]=\frac{1}{84} \sum_{k=1}^{119}|k-84|=49.$$

Z Ahmed
  • 43,235
0

With

$$ f_a(x)= |a x-1| $$

we have

$$ \frac{d}{dx}f_a(x) = -a+2a\theta\left(x-\frac 1a\right),\ \ \ \text{undefined at}\ \ \ x = \frac 1a $$

with $\theta(\cdot)$ the heaviside unit step function then

$$ \frac{d}{dx}\sum_{k=1}^n f_k(x) = -\sum_{k=1}^n k + 2\sum_{k=1}^n k\theta\left(x-\frac 1k\right) $$

so we need to determine $m$ such that

$$ -\sum_{k=1}^n k + 2\sum_{k=1}^m k \approx 0 $$

For this case we have

$$ -\sum_{k=1}^{119} k + 2\sum_{k=1}^{84} k = 0 $$

hence the minimum occurs at $x = \frac{1}{84}$

Cesareo
  • 33,252