JEEAdvanced

Find the minimum value of f(x) = 1·|x - 1| + 2·|x - 2| + 3·|x - 3| +…

Question

Find the minimum value of f(x) = 1·|x - 1| + 2·|x - 2| + 3·|x - 3| + 4·|x - 4| + 5·|x - 5| over all real x.

✓ Verified answer: 15checked by our engine — not a guess

Step-by-step solution

f is piecewise linear and convex; its minimum occurs at a weighted median of the points {1,2,3,4,5} with weights {1,2,3,4,5} (total weight 15).

The slope of f just to the right of x = k changes by jumps; moving x left/right, the minimizer is the point where the cumulative weight first reaches half of 15 = 7.5.

Cumulative weights from the left: at 1→1, 2→3, 3→6, 4→10 — the cumulative passes 7.5 at the point 4.
So the minimum is at x = 4: f(4) = 1·3 + 2·2 + 3·1 + 4·0 + 5·1 = 3 + 4 + 3 + 0 + 5 = 15.

Final answer15

Stuck on a problem like this?

Paste any JEE or NEET question — verified working, a confidence %, and an honest “not sure” instead of a bluff.

Solve my doubt →

More Maxima Minima solutions