-1

Having trouble with this homework question,

Determine if $f(x) = -|x + 2| \forall x ∈ [-2, 0]$ is convex using the below definition of convexity.

A function $f: X -\to\mathbb{R}^n$ is convex for every $x_1, x_2 ∈ X$ and every $λ ∈ [0,1]:$

$$f((1−λ)x_1 + λx_2) ≥ (1 − λ) f(x_1) + λ f (x_2).$$

I have looked at a simpler example like proving $f(x) = x^2$ is convex but I have no idea where to start with the above formula when dealing with an absolute value.

Any help would be appreciated.

Bumblebee
  • 18,220
  • 5
  • 47
  • 87
John
  • 3
  • Where are you stuck? If $x_1,x_2$ are in $[-2,0]$, what is $-|x+2|$? –  Mar 30 '15 at 05:52
  • I can see that F(x) is going to be between 0 and -2, I am struggling to apply this to the definition formula. – John Mar 30 '15 at 05:56
  • You need to show some effort. We will not help you unless you show effort. What is $f(x)$ if $x \in [-2,0]$? –  Mar 30 '15 at 05:58
  • -2<= f(x) <= 0 Thanks for the reply, I am struggling to put my thoughts into equations so excuse me if it seems like I am showing no effort. Give me a minute or two more and I will have what I am thinking in words. – John Mar 30 '15 at 06:20
  • And I just realised the above equation is used for concavity not convexity, the greater than or equal sign in the middle should face the other way. – John Mar 30 '15 at 06:22

1 Answers1

0

Observe that $f(x) = -(x+2) = -x - 2$ since $x \geq -2$. We can use the definition to check. Thus let $\lambda \in [0,1]$, and compute: $f((1-\lambda)x_1+ \lambda x_2)= - ((1-\lambda)x_1 + \lambda x_2)-2=(\lambda - 1)x_1 - \lambda x_2 - 2.$, and $(1-\lambda)f(x_1) + \lambda f(x_2) = (1-\lambda)(-x_1-2) + \lambda (-x_2-2)= (\lambda -1)x_1 - \lambda x_2 - 2$. Thus the definition is satisfied since both sides turn out to be equal. Thus $f$ is convex on $X = [-2,0]$.

DeepSea
  • 77,651
  • Thank you, my brain got caught up on the absolute value of f(x) and I just couldn't find a way to turn it into something I could use with the definition. – John Mar 30 '15 at 06:30