Probability that $\displaystyle \vert x\vert +\vert y\vert +\vert z\vert +\vert x+y+z\vert=\vert x+y\vert +\vert x+z\vert +\vert y+z\vert$

Suppose $x$ and $y$ are positive and consider the possible values of $z$. Because $|x|+|y|=|x+y|$ here, we want the equation $$ |z| + |x+y+z| = |x+z| + |y+z| $$ to hold.

Assume $x \le y$; in this case, we have $z \le x+z \le y+z \le x+y+z$, and so we can consider five possibilities based on which of these are positive.

  1. $0 \le z \le x+z \le y+z \le x+y+z$. Then the equation holds. You already know this case.
  2. $z \le 0 \le x+z \le y+z \le x+y+z$. Then the equation simplifies to $x+y=x+y+2z$, which has probability $0$.
  3. $z \le x+z \le 0 \le y+z \le x+y+z$. Then the equation simplifies to $x+y=y-x$, which has probability $0$.
  4. $z \le x+z \le y+z \le 0 \le x+y+z$. Then the equation simplifies to $x+y = -x-y-2z$, which has probability $0$.
  5. $z \le x+z \le y+z \le x+y+z \le 0$. Then the equation holds. This case is new.

The same thing happens when $x \ge y$, so that doesn't need to be considered separately.

So we see that when $x$ and $y$ are positive, we want either $z$ to be positive as well, or we want $x+y+z$ to be negative.

By symmetry, this covers all the possibilities. The equation holds when:

  • All three of $x,y,z$ are positive;
  • Two of $x,y,z$ are positive, but $x+y+z$ is negative;
  • Two of $x,y,z$ are negative, but $x+y+z$ is positive;
  • All three of $x,y,z$ are negative.

The regions inside $[-1,1]^3$ where these hold have volume respectively:

  • $1$ (it's a cube of side length $1$);
  • $\frac12$ (it's three pyramids that form a corner of a cube with $\frac16$ the volume);
  • $\frac12$;
  • $1$.

So total volume $3$ (out of $8$), so the equation holds with probability $\frac38$.


A simulation using R statistical software, for those interested, agrees with the theoretical answer.

> x<-runif(10^7,-1,1)
> y<-runif(10^7,-1,1)
> z<-runif(10^7,-1,1)
> mean(abs(x)+abs(y)+abs(z)+abs(x+y+z)==abs(x+y)+abs(x+z)+abs(y+z))
[1] 0.3749906