How do you perform operations involving absolute values? I want to avoid squaring them, is there any way to work around that?

Suppose I want to solve $\frac{|x-120|\cdot|y-39|}{2}$, what should be the expressions equivalent?

EDIT: apologies, suppose I want to simplify the expression above?

Additionally, suppose $z(x,y)=\frac{|x-120|\cdot|y-39|}{2} +\frac{|x-23|\cdot|y-11|}{2}$ and I want to find the optimal values for $(x,y)$. How do I go about it?

  • $\begingroup$ $|a| \cdot |b|=|a \cdot b|$. I don't know what you are solving though. $\endgroup$ – randomgirl Mar 8 '18 at 1:50
  • $\begingroup$ What do you mean, you want to "solve" this? Is there an equation somewhere? Also, why do you want to avoid squaring absolute values? $\endgroup$ – saulspatz Mar 8 '18 at 1:51
  • $\begingroup$ @randomgirl edited the question $\endgroup$ – John Glenn Mar 8 '18 at 1:55
  • $\begingroup$ @saulspatz to avoid the problem from being too computationally intensive $\endgroup$ – John Glenn Mar 8 '18 at 1:57
  • $\begingroup$ you can always get rid of the absolute value bars by specifying constraints on $x$ and $y$. For example, $|x-120|=x-120$ if $x\ge 120$ $\endgroup$ – Vasya Mar 8 '18 at 2:05

$z(120,11) = 0+0 = 0,$ which is clearly a minimum.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.