Graph $|x| + |y| \leq 1$

124 Views Asked by At

I need to graph the inequality in the title but I'm doing something wrong... so far I have:

$$|y| \leq -|x| + 1 \Leftrightarrow$$

$$\Leftrightarrow |y| \leq -x + 1, \space \forall \space x > 0 \space \vee |y| \leq x + 1, \space \forall \space x < 0 $$

This gives me four different conditions, depending on the value of $x$:

$$y \leq -x + 1, \space \forall \space (x > 0 \space \wedge -x + 1 < 0)$$ $$-y \leq -x + 1, \space \forall \space (x > 0 \space \wedge -x + 1 > 0)$$ $$y \leq x + 1, \space \forall \space (x < 0 \space \wedge x + 1 > 0)$$ $$-y \leq x + 1, \space \forall \space (x < 0 \space \wedge x + 1 < 0)$$

The resulting graph is not the correct one.

4

There are 4 best solutions below

2
On BEST ANSWER

Wrong approach; better to forgo all attempts at elegance and apply brute force, by considering the following 4 cases separately:

  • $x \geq 0, y\geq 0 \implies \left(|x| + |y|\right) = (x + y)$
  • $x \geq 0, y < 0 \implies \left(|x| + |y|\right) = (x - y)$
  • $x < 0, y \geq 0 \implies \left(|x| + |y|\right) = (-x + y)$
  • $x < 0, y < 0 \implies \left(|x| + |y|\right) = (-x - y).$

In $\mathbb{R^2}$, each of these cases nicely fits into one of the four quadrants. So, in each case, you want the locus of all points that satisfy the inequality and simultaneously are in the corresponding quadrant.

For example, examining Case 3 above, you would be looking for all points $(x,y)$ such that $x < 0 \leq y$ and $(-x + y) \leq 1.$

The first step in solving the Case 3 inequality would be to graph the equation $(-x + y) = 1.$

Then you would consider whether the inequality is satisfied by the region above the line or below the line. Then, having decided which region is pertinent, since Case 3 involves the second quadrant (when numbering the quadrants counterclockwise starting with the upper right quadrant as number 1), you would look for the intersection of the pertinent region with the second quadrant.

Applying this approach to all 4 cases, you would then have 4 separate regions, whose union represents all possible solutions to the problem. The fact that this union forms an (elegant) rectangle is totally irrelevant.

The approach is simply to use brute force against each of the 4 cases, and then go wherever this leads.

Addendum
Responding to the OP's comment/question:

Is there a way to present each of the four conditions as an inequality of $y$ in function of $x$?

Yes, but it takes careful consideration of each case separately. Again, you are forgoing all attempts at elegance. I emphasize that you are applying brute force to each of the four cases. Continuing Case 3, where

$(|x| + |y|) = (-x + y)$
and noting that the corresponding quadrant is the second quadrant:

First, you determine the pertinent equation:
$(-x + y) = 1.$
Then, you determine (temporarily ignoring any consideration re quadrants) which half-plane satisfies the inequality $(-x + y) \leq 1.$

Noting that the region below and to the right increases the value of $x$ and decreases the value of $y$, and noting further that as $x$ increases, $(-x)$ decreases, you are supposed to surmise that the entire half-plane below and to the right of the equation $(-x + y) = 1$ will satisfy $(-x + y) \leq 1$.

A moderate alternative approach is to note that $(-x + y) \leq 1 \iff y \leq (1 + x).$ This alternate approach (again) may be used to establish that in Case 3, the half-plane below and to the right is the desired half-plane.

Then, having identified the appropriate half-plane, you then determine the intersection between this half-plane and the second quadrant.
This then gives you a complete solution to the inequality for Case 3 only. You then rinse and repeat manually for each of the other 3 cases.

Then, you have the additional challenge of identifying the union of the 4 subsets, where each subset corresponds to the solution to the inequality for one of the four cases.

0
On

The first and fourth of your conditions are wrong.

For the first one that originates from $|y|\le -x+1$, if RHS $-x+1 < 0$ then no $|y|$ is going to be even equal or less.

$|y|\le -x+1$ should instead imply

$$\begin{align*} -(-x+1)\le y &\le -x+1\\ x-1 \le y &\le 1-x \end{align*}$$

with conditions that $x\ge0$ and $-x+1 \ge 0$, i.e. $$0\le x \le 1$$

0
On

Not repeating good analysis from other answers let me show you drawing $|x|+|y| = 1$, which gives

enter image description here

0
On

enter image description here

A little higher perspective about this graph, this is the unit ball of radius $1$ for the norm $||\cdot||_1=|x|+|y|$ it is a rotated square.

Note that for $||\cdot||_\infty=\max(|x|,|y|)$ the unit ball is a square with sides // to the coordinate axis.

This is easy to see $|x|\le 1$ is a vertical band and $|y|\le 1$ is an horizontal band, intersection of both conditions gives a square.

Now $|x|+|y|\le 1$ is either $\{x+y,x-y,-x+y,-x-y\}\le 1$ depending on signs of $x,y$

so we can also rewrite it $\begin{cases}|x+y|\le 1\\|x-y|\le 1\end{cases}\quad$ or equivalently $\max(|x+y|,|x-y|)\le 1$

If you do the change of variable $\begin{cases}u=x+y\\v=x-y\end{cases}\quad$ you'll notice $$||(x,y)||_1\le 1\iff ||(u,v)||_\infty\le 1$$

This is why you get a rotated square.

Note:

The change of variable is not a proper rotation, it needs to be normalized with a factor $\sqrt{2}$ (because for a rotation of angle $45^\circ$ both are equal to $\cos(45^\circ)=\sin(45^\circ)=\frac 1{\sqrt{2}})$