Bunuel
If x is an integer and \(f(x) = |x| + |x + 3| + |x + 6| + |x + 9| + |x + 12| + |x + 15| + |x + 18| + |x + 21|\), then for how many values of x, f(x) will be minimum?
A. 1
B. 2
C. 3
D. 4
E. 5
|x| means distance of x from 0
|x+3| means distance of x from -3
|x+21| means distance of x from -21.
\(f(x) = |x| + |x + 3| + |x + 6| + |x + 9| + |x + 12| + |x + 15| + |x + 18| + |x + 21|\)
So, we have points
1) -21….-18….-15….-12….-9….-6….-3….0(x)
Say x=0, so distance from each point is 3,6,9,12…,18,21 and the sum will be 3+6+9+….+18+21
2) -21….-18….-15….-12..(x)..-9….-6….-3….0
Say x is right at the middle, that is (0+21)/2 or 10.5, so distance from pair of equidistant points will be:
a) (-21,0): -21 to x to 0 =|-21-0|= 21
b) (-18,-3): -18 to x to -3=|-18-(-3)|=15
c) (-15,-6) : -15 to x to -6=|-15-(-6)|=9
d) (-12,-9) : -12 to x to -9=|-12-(-9)|=3
and the sum will be 21+15+9+3=48
3) Whenever x is in between -9 and -12, both inclusive, all the above cases a, b, c and d will remain same and we will get the sum as 48, the minimum possible.
So integer values are -9, -10, -11 and -12.
4) What happens when x shifts away from middle range 9-12, say x=
-21….-18….-15..(x)..-12....-9….-6….-3….0
a) (-21,0): -21 to x to 0 =|-21-0|= 21….SAME
b) (-18,-3): -18 to x to -3=|-18-(-3)|=15….SAME
c) (-15,-6) : -15 to x to -6=|-15-(-6)|=9…..SAME
d) (-12,-9) : (x or -13 to -12) + ( x or -13 to -9)=1+4=5….Different and more by 2(x-(-12)) or 2*1 here.
and the sum will be 21+15+9+5=50
5) As we move further, the sum will keep going up.
Total 4 values from -9 to -12.
RamseyGoonerTherefore the reason is that when x is from -9 to -12, sum of |x+9| and |x+12| will be constant 3.
However, the moment we move away, say make x as -14, |x+9|+|x+12| becomes 5+3 or 8, while it’s minimum value is 3.