Solving an Equation for a Variable with $\max()$ and $\min()$ Functions

410 Views Asked by At

I came across an expression in 3 variables involving the max and min functions:

$$x = y - \max(x,z) + \min(x,y,z).$$ I need to solve this expression for $y$. Is there any way we can do this? Reading somewhat related answers here such as this and this led me to try splitting this into several cases, but I got lost with both max() and min() functions and three variables. Can anyone give me some insight on the problem (or better yet, a more general method for this procedure?)

Thanks.

1

There are 1 best solutions below

1
On BEST ANSWER

First, separate $3$ cases:

  • $\min(x,y,z)=x$
  • $\min(x,y,z)=y$
  • $\min(x,y,z)=z$

In the first case, it is obvious that $\max(x,z)=z$, and in the third, $\max(x,z)=x$. Only in the second case, you have to separate the cases $\max(x,z)=x$ and $\max(x,z)=z$ separately.