Optimizing the Sum of Linear Absolute Value Functions on An Interval

Journal of Informatics and Mathematical Sciences
Volume 4 (2012), Number 2, pp. 199–204
© RGN Publications
http://www.rgnpublications.com
Optimizing the Sum of Linear Absolute
Value Functions on An Interval
M.M. Khashshan
Abstract. In this paper we give a new result for solving the problem of optimizing
the sum of absolute values in the form |x − a r | over any interval.
1. Introduction
Consider the following problem
Optimize
n
X
f (x) =
|x − a r |, where a r−1 < a r for each 2 ≤ r ≤ n
r=1
Over any given interval I.
This problem has different applications in different aspects such as digital
communication and approximation techniques, see [2]. Also, Han-Lin and ChianSon [1] solved obtained minimized this sum over the set of all real numbers using
so-called goal programming. In [3], we obtained an explicit formula that gives the
minimum of this sum over the set of all real numbers. In this paper we introduce
and prove a theorem which directly gives the optimum value of f (x) over any
given interval. Our proof depends on rewriting f as a piecewise linear function.
We do so by generalizing the case when n = 2, that is; f (x) = |x − a1 | + |x − a2 |,
a1 < a2 , to the case when n is any positive integer, that is;
n
X
f (x) =
|x − a r |, where a r−1 < a r for each 2 ≤ r ≤ n.
r=1
For the case when n = 2 ; if f (x) = |x − a1 | + |x − a2 |, a1 < a2 then
¨
¨
−(x − a2 ); x ≤ a2
−(x − a1 ); x ≤ a1
+
f (x) =
x − a2 ;
x > a2
x − a1 ;
x > a1
2010 Mathematics Subject Classification. 90C05, 90C90.
Key words and phrases. Absolute value functions; Piecewise linear function; Convex function.
200
M.M. Khashshan
and hence

−(x − a1 ) − (x − a2 );
f (x) = (x − a1 ) − (x − a2 );

(x − a1 ) + (x − a2 );
x ≤ a1
a1 < x ≤ a2 .
x > a2
2. The main results
We start this section with the solution of the proposed problem when the
interval I is of the form [b1 , b2 ], where b1 < b2 .
Theorem 2.1. Consider the function f (x) =
n
P
r=1
|x − a r | over [b1 , b2 ] where
a r−1 < a r for each 2 ≤ r ≤ n, b1 , b2 ∈ R. Then
A. If n is odd, then f (x) has an absolute maximum value at
(
x = b1 if b2 ≤ a n+1 or (b1 < a n+1 < b2 and f (b1 ) ≥ f (b2 ))
2
2
if b1 ≥ a n+1 or (b1 < a n+1 < b2 and f (b1 ) ≤ f (b2 ))
x = b2
2
2
and f (x) has an absolute minimum value at

x = b1
if b1 ≥ a n+1
2

x = b2
if b2 ≤ a n+1
2

x = a n+1 if b1 < a n+1 < b2
2
2
B. If n is even, then f (x) has an absolute maximum value at

x = b1 if b2 ≤ a n or (b1 < a n and a n < b2 ≤ a n +1 )
2
2
2
2



or (b1 < a n and b2 > a n +1 and f (b1 ) ≥ f (b2 ))
2
2

x = b2 if b1 ≥ a n +1 or (a n ≤ b1 < a n +1 and b2 > a n +1 )


2
2
2
2
or (b1 < a n and b2 > a n +1 and f (b1 ) ≤ f (b2 ))
2
2
and f (x) has an absolute minimum value at

x = b1
if b1 ≥ a n +1
2



x = b2
if b2 ≤ a n

2

if b1 ≤ a n and a n < b2 ≤ a n +1
x = t ∀ t ∈ [a n , b2 ]
2
2
2
2




 x = t ∀ t ∈ [b1 , a 2n +1 ] if a 2n ≤ b1 < a 2n +1 and b2 ≥ a 2n +1
x = t ∀ t ∈ [a n , a n +1 ] if b1 ≤ a n and b2 ≥ a n +1
2
2
and f (x) is constant if a ≤ b1 < a
n
2
2
n
+1
2
2
and a < b2 ≤ a
n
2
n
+1
2
.
Proof. Our goal is to show that f is convex on R in both cases, either n is odd
or n is even, and we will see that f has an absolute minimum value at x = a n+1
2
when n is odd and it has an absolute minimum value at x = t ∀ t ∈ [a n , a n +1 ]
2
2
when n is even. After that we will restrict the natural domain of f to be the closed
bounded interval [b1 , b2 ], and then we will discuss all possible situations of b1 , b2
201
Optimizing the Sum of Linear Absolute Value Functions on An Interval
in relation with a n+1 when n is odd and in relation with a n , a n +1 when n is even.
2
2
2
First, we rewrite the function f as a piecewise linear function as follows:
 P
n
− (x − a r ) = g1 (x);
x ≤ a1



r=1

i
n
P
P
(x − a r ) −
(x − a r ) = g i+1 (x); ai < x ≤ ai+1 , i = 1, . . . , n − 1
f (x) =


r=i+1
 r=1
n

P
(x − a r ) = g n+1 (x);
x > an
r=1
Now, we consider the cases when n is odd and when n is even:
A. Let n be odd. Then the functions g1 , . . . , g n+1 are strictly decreasing linear
2
functions (each of them has x’s with negative sign more than x’s with positive
sign). On the other hand, the functions g n+3 , . . . , g n+1 are strictly increasing linear
2
functions (each of them has x’s with positive sign more than x’s with negative
sign). Since f is continuous on R (sum of continuous functions), then we can
conclude that f is strictly decreasing over (−∞, a n+1 ] and strictly increasing over
2
[a n+1 , ∞). This implies that min( f ) = f (a n+1 ), that is; f has an absolute minimum
2
2
value at x = a n+1 . We can see that f is convex on R, and the general shape of f
2
when n is odd appears in Figure 1. Now, let x ∈ [b1 , b2 ]. When b2 ≤ a n+1 then f is
2
strictly decreasing over [b1 , b2 ], implies that f has an absolute maximum value at
x = b1 and has an absolute minimum value at x = b2 . When b1 < a n+1 < b2 then
2
f is strictly decreasing over [b1 , a n+1 ], strictly increasing over [a n+1 , b2 ], which
2
2
implies that f has an absolute maximum value at x = b1 if f (b1 ) ≥ f (b2 ), and
f has an absolute maximum value at x = b2 if f (b1 ) ≤ f (b2 ), and moreover f
has an absolute minimum value at x = a n+1 . When b1 ≥ a n+1 then f is strictly
2
2
increasing over [b1 , b2 ], which implies that f has an absolute maximum value at
x = b2 and has an absolute minimum value at x = b1 .
B. Let n be even. Then the functions g1 , . . . , g n are strictly decreasing linear
2
functions, g n +1 is a constant function, and the functions g n +2 , . . . , g n+1 are strictly
2
2
increasing linear functions. Since f is continuous on R, then we can conclude that
f is strictly decreasing over (−∞, a n ], is a constant over [a n , a n +1 ], and is strictly
2
2
2
increasing over [a n +1 , ∞), this implies that min( f ) = f (t) ∀t ∈ [a n , a n +1 ]. We
2
2
2
can see that f is convex on R, and the general shape of f when n is even appears
in Figure 2. Now, let x ∈ [b1 , b2 ]. When b2 ≤ a n then f is strictly decreasing
2
over [b1 , b2 ], implies that f has an absolute maximum value at x = b1 and has an
absolute minimum value at x = b2 . When b1 ≥ a n +1 then f is strictly increasing
2
over [b1 , b2 ], which implies that f has an absolute maximum value at x = b2
and has an absolute minimum value at x = b1 . When b1 < a n , a n < b2 ≤ a n +1
2
2
2
then f is strictly decreasing over [b1 , a n ] and constant over [a n , b2 ], implies that
2
2
f has an absolute maximum value at x = b1 and has an absolute minimum
value at x = t ∀t ∈ [a n , b2 ]. When a n ≤ b1 < a n +1 , a n < b2 ≤ a n +1 then
2
2
2
2
2
202
M.M. Khashshan
b1 , b2 ∈ [a n , a n +1 ], since f is constant over [a n , a n +1 ] when x ∈ R then f is
2
2
2
2
constant when x ∈ [b1 , b2 ]. In addition, when a n ≤ b1 < a n +1 , b2 > a n +1 then
2
2
2
f is constant over [b1 , a n +1 ] and strictly increasing over [a n +1 , b2 ], implies that f
2
2
has an absolute maximum value at x = b2 and has an absolute minimum value at
x = t ∀t ∈ [b1 , a n +1 ].
¤
2
Figure 1
The general shape of f when n is odd
Figure 2
The general shape of f when n is even
Remark 2.2. The solution of the proposed problem is summarized in the following
four tables for all other forms of the interval I. The proof of each one of them is
similar to the proof of the previous theorem.
Table 1. n is odd and I is a finite interval
Interval
Conditions
Absolute max( f ) at
Absolute min( f ) at
b2 ≤ a n+1
None
x = b2
b1 < a n+1 < b2 and f (b1 ) ≤ f (b2 )
x = b2
x = a n+1
b1 < a n+1 < b2 and f (b1 ) > f (b2 )
None
x = a n+1
b1 ≥ a n+1
x = b2
None
b2 ≤ a n+1
x = b1
None
b1 < a n+1 < b2 and f (b1 ) < f (b2 )
None
x = a n+1
b1 < a n+1 < b2 and f (b1 ) ≥ f (b2 )
x = b1
x = a n+1
b1 ≥ a n+1
None
x = b1
a n+1 ∈ I
None
x = a n+1
a n+1 ∈
/I
None
None
2
x ∈ (b1 , b2 ]
2
2
2
2
x ∈ [b1 , b2 )
2
2
2
x ∈ I = (b1 , b2 )
2
2
2
2
2
2
2
203
Optimizing the Sum of Linear Absolute Value Functions on An Interval
Table 2. n is odd and I is an infinite interval
Interval
Conditions
Absolute max( f ) at
Absolute min( f ) at
None
x = a n+1
b ≤ a n+1
None
x=b
b > a n+1
None
x = a n+1
b < a n+1
None
x = a n+1
b ≥ a n+1
None
x=b
a n+1 ∈ I
None
x = a n+1
a n+1 ∈
/I
None
None
(−∞, ∞)
x ∈ (−∞, b]
2
2
x ∈ [b, ∞)
2
2
x ∈ I = (−∞, b) or (b, ∞)
2
2
2
2
2
2
Table 3. n is even and I is a finite interval
Interval
Conditions
Absolute max( f ) at
Absolute min( f ) at
None
x = b2
None
x = t ∀t ∈ [a n , b2 ]
b1 < a n , b2 > a n +1 and f (b1 ) > f (b2 )
None
x = t ∀t ∈ [a n , a n +1 ]
b1 < a n , b2 > a n +1 and f (b1 ) ≤ f (b2 )
x = b2
x = t ∀t ∈ [a n , a n +1 ]
b1 ≥ a n and b2 ≤ a n +1
x = t ∀t ∈ (b1 , b2 ]
x = t ∀t ∈ (b1 , b2 ]
a n ≤ b1 < a n +1 and b2 > a n +1
x = b2
x = t ∀t ∈ (b1 , a n +1 ]
b1 ≥ a n +1
x = b2
None
b2 ≤ a n
x = b1
None
b1 < a n and a n < b2 ≤ a n +1
x = b1
x = t ∀t ∈ [a n , b2 )
b1 < a n , b2 > a n +1 and f (b1 ) ≥ f (b2 )
x = b1
x = t ∀t ∈ [a n , a n +1 ]
b1 < a n , b2 > a n +1 and f (b1 ) < f (b2 )
None
x = t ∀t ∈ [a n , a n +1 ]
b1 ≥ a n and b2 ≤ a n +1
x = t∀t ∈ [b1 , b2 ),
x = t∀t ∈ [b1 , b2 )
b2 ≤ a
n
2
b1 < a and a < b2 ≤ a
n
2
n
2
2
x ∈ (b1 , b2 ]
n
2
+1
2
2
2
2
2
2
2
2
2
2
2
2
2
x ∈ [b1 , b2 )
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
f is constant
a n ≤ b1 < a n +1 and b2 > a n +1
None
x = t ∀t ∈ [b1 , a n +1 ]
None
x = b1
None
None
None
x = t ∀t ∈ [a n , b2 )
b1 < a n and b2 > a n +1
None
x = t∀t ∈ [a n , a n +1 ]
b1 ≥ a n and b2 ≤ a n +1
x = t∀t ∈ (b1 , b2 ),
x = t∀t ∈ (b1 , b2 )
2
2
2
b1 ≥ a
n
2
+1
b2 ≤ a n
2
b1 < a and a < b2 ≤ a
n
2
n
2
2
x ∈ (b1 , b2 )
n
2
+1
2
2
2
2
2
2
2
f is constant
a n ≤ b1 < a n +1 and b2 > a n +1
None
x = t∀t ∈ (b1 , a n +1 ]
b1 ≥ a n +1
None
None
2
2
2
2
2
204
M.M. Khashshan
Table 4. n is even and I is an infinite interval
Interval
Conditions
Absolute max( f ) at
Absolute min( f ) at
None
x = t ∀t ∈ [a n , a n +1 ]
None
x=b
a n < b ≤ a n +1
None
x = t ∀t ∈ [a n , b]
b > a n +1
None
x = t ∀t ∈ [a n , a n +1 ]
b < an
None
x = t ∀t ∈ [a n , a n +1 ]
a n ≤ b < a n +1
None
x = t ∀t ∈ [b, a n +1 ]
b ≥ a n +1
None
x=b
b ≤ an
None
None
None
x = t ∀t ∈ [a n , b)
b > a n +1
None
x = t ∀t ∈ [a n , a n +1 ]
b < an
None
x = t ∀t ∈ [a n , a n +1 ]
a n ≤ b < a n +1
None
x = t ∀t ∈ (b, a n +1 ]
b ≥ a n +1
None
None
(−∞, ∞)
b ≤ an
2
x ∈ (−∞, b]
2
2
2
2
x ∈ [b, ∞)
2
2
2
2
x ∈ [−∞, b)
a <b≤a
n
2
n
2
+1
2
2
x ∈ (b, ∞)
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
References
[1] Han-Lin Li and Chian-Son Yu, A global optimization method for nonconvex separable
programming problems, European Journal of Operational Research 117 (1999), 275–
292.
[2] R.A. El-Attar, M. Vidyasagar and S.R.K. Dutta, An algorithm for l1 -norm minimization
with application to nonlinear l1 -approximation, SIAM J. Numer. Anal. 16(1) (1979),
70–86.
[3] M.M. Khashshan, Minimizing the sum of linear absolute value functions on R,
International Journal of Computational and Applied Mathematics 5(4) (2010), 537–540.
M.M. Khashshan, Department of Mathematics, Teachers College, King Saud
University, Riyadh, Kingdom of Saudi Arabia.
E-mail: [email protected]
Received
Accepted
July 17, 2011
October 21, 2011