2^{17}-2 ?
$Let $x_{i}=2^i$ and $i=1,2,3...........16$\\\\ Then find Min. of the function $f(x) = \sum_{i=1}^{16}|x-x_{i}|$
-
UP 0 DOWN 0 0 6
6 Answers
modulus inequalities might help.
hint: sum ( -1i * (x-xi))<= sum (/(x-xi)/)
I made a mistake in the final expression: It should be 2^{17}+2-2^{10} = 130050
We have from the triangle inequality, |x-a|+|b-x| ≥ (b-a) for all x in [a,b]
Applying this
|x-2|+\left|2^{16}-x\right| \ge 2^{16}-2 \\ \\ \left|x-2^2\right| + \left|2^{15}-x\right|\ge 2^{15}-4 \\ \\ .\\ .\\ .\\ \left|x-2^8\right| + \left|2^{9}-x\right|\ge 2^{9}-2^8
Thus LHS \ge 2^{16}-2 + 2^{15}-4+...+2^{9}-2^8 = 130050
The minimum will occur at the intersection of the intervals
\left[2,2^{16}\right], \left[2^2, 2^{15}\right],...,\left[2^8, 2^{9}\right]
which is obviously the interval \left[2^8, 2^{9}\right]
f is max at x = infinity
so f wil be minimum wen f'(x)= 0 , i.e wen f is independent of x
f is independent of x for all x in ( 28, 29) as first 8 of the mods will giv x-2k and other 8 wil giv 2m-x
so x gets cancelled and hence f is independent of x
so f min = - ( 2+22+23+..28) + (29+ 210+...216)
= 29(28-1) - 2(28-1)=2(28-1)2