Minimizing Sum of Absolute Values

Click For Summary

Discussion Overview

The discussion revolves around finding the minimum of a function defined as a sum of absolute values, specifically f(x) = |1-x| + |0.5-2x|, with potential extensions to more terms. Participants explore various methods for minimizing such functions, including graphical approaches, piecewise definitions, and critical point analysis.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • Adrian seeks an efficient method to minimize a function involving absolute values and expresses difficulty with calculus due to messy derivatives.
  • Some participants suggest using piecewise definitions to analyze the function, noting that the number of segments increases with the number of linear terms.
  • Mihir proposes a graphical approach, indicating that the minimum occurs when the last absolute value term equals zero.
  • Another participant suggests expanding the function into all possible permutations of its segments, although they acknowledge this may become infeasible with many terms.
  • There is a discussion about the behavior of the function's slope around critical points, with some arguing that the minimum must occur at the smallest critical point.
  • Participants debate the validity of using the steepest slope to determine the minimum, with some expressing uncertainty about this reasoning.
  • One participant emphasizes that the minimum of a piecewise linear function will occur at points where one of the linear components equals zero.
  • There are corrections and refinements to earlier claims, particularly regarding the conditions under which minima occur and the implications of non-linear terms.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method for finding the minimum, with multiple competing views and approaches presented throughout the discussion. There is ongoing debate about the role of critical points and the feasibility of various methods.

Contextual Notes

Some participants note that the reasoning behind certain methods may not hold if the terms are arbitrary or non-linear. The discussion includes various assumptions about the behavior of the function and the conditions under which minima can be found.

Who May Find This Useful

This discussion may be of interest to individuals working on optimization problems involving piecewise linear functions, particularly in the context of programming or mathematical analysis.

  • #31
Aero51 said:
Would it be possible to find the minimum by squaring the function inside the absolute value signs then carrying out the necessary steps to find a minnima/maxima? I think this should work for any polynomial, not sure about other functions though.

The solution obtained using this method will not be the same as that in the original formulation, though it may possibly be close.
 
Physics news on Phys.org
  • #32
adoado said:
I recently encountered another problem, but it extends this topic. Instead of opening a new thread I guess this place is as good as any..

If one defines the function E=|1-x-y| + |4-2x-y| ... how can I find it's minimum now (x and y coordinates)? Can this be extended to N variables inside each absolute value? Each absolute value will be linear... I am not sure if the above answer can be generalized to suit this problem?

Any ideas? :confused:

Cheers,
Adrian
If you have access to a linear programming package, problems of this type can be solved by linear programming. In the above problem, we would reformulate the problem as follows:

minimize a + b + c + d
subject to
a - b = 1 - x - y
c - d = 4 - 2x - y
a, b, c, d >= 0

The trick is that if 1 - x - y \ge 0, then a = 1 - x - y and b = 0; otherwise a = 0 and b = - (1 - x - y). So a + b = |1 - x - y| in all cases.
You might think that other solutions are possible-- for example, if 1 - x - y = 2, then a = 3 and b = 1 seems to be an alternative solution that would mess things up. But this will never happen if you are using the Simplex Algorithm, because it is guaranteed to always find a solution at a vertex of the feasible polyhedron. At least one of a and b will always be zero.
 
Last edited:
  • #33
The solution obtained using this method will not be the same as that in the original formulation, though it may possibly be close.

Why? If you square the function and find the zeros, these points should correspond to where a derivative does not exist in the original function. Take a-x, for example, if you calculate the 0 point of (a-x)^2 you get a double root at x=a, consistent with the original formula. Squaring any higher order polynomial inside the absolute value function will still have roots at the location where the original function has no derivative. You can use this information to more quickly find the max/min of an absolute value function.
 
  • #34
Aero51 said:
Why? If you square the function and find the zeros, these points should correspond to where a derivative does not exist in the original function. Take a-x, for example, if you calculate the 0 point of (a-x)^2 you get a double root at x=a, consistent with the original formula. Squaring any higher order polynomial inside the absolute value function will still have roots at the location where the original function has no derivative. You can use this information to more quickly find the max/min of an absolute value function.

This method works if f(x) comprises of a single absolute term. If there are two or more terms, i.e. f(x,y) = |2x-y+3|+|x+3y+1| + |x-y+6|, the optimal solution which minimizes f is not the same as g(x,y) = (2x-y+3)^2+(x+3y+1)^2 +(x-y+6)^2, simply because there is no way to transform the second equation to the first.
 

Similar threads

  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 11 ·
Replies
11
Views
3K