Notice that f(x) is the sum of three non-negative functions
|x-a|,
|x-b|, |x-c|
having minimums at a,b,c respectively.
Also notice that
since a<b<c
f(a) = |a-a| + |a-b| + |a-c| = b-a+c-a =
b+c-2a
f(b) = |b-a| + |b-b| + |b-c| = b-a+c-b = c-a
f(c) = |c-a| +
|c-b| + |c-c| = c-a+c-b = 2c-a-b
Since
f(a) = b-a + c-a = b-a +
f(b)
f(c) = c-a + c-b = f(b) + c-b
Thus f(b) < f(a), and f(b)
< f(c).
We claim that x=b is the minimum of f, so
min f = f(b) =
c-a.
It remains to show that for any number x distinct from a,b,c we have
that
f(x) > f(b) = c-a.
Consider the following 4
cases:
1) If x<a<b<c, then
|x-c| > c-a, whence
f(x)= |x-a| +|x-b| + |x-c| > c-a = f(b)
2) If
a<x<b<c, then
|x-a| + |x-c| = c-a,
and
|x-b|>0,
whence
f(x)= |x-a| +|x-b| + |x-c| > c-a = f(b)
3) If a<b<x<c, then
|x-a| + |x-c| = c-a,
and
|x-b|>0,
whence
f(x)= |x-a| +|x-b| + |x-c| > c-a = f(b)
4) If a<b<c<x, then
|x-a| > c-a,
whence
f(x)= |x-a| +|x-b| + |x-c| > c-a = f(b)
Thus
min(f) =
f(b) = c-a.
Comments
Leave a comment