Understanding $z(a,b) \in[0,1]$ where $a=|x-y|$, $b=|y|$ and $x,y\in[-2,2]$

32 Views Asked by At

I previously asked a poorly written question that used incorrect terminology. A user @epiliam was very patient and worked me through my logic to understand what I was trying to ask. I had a question about understanding some of the details of their answer.

In particular, I was looking for a function $z(a,b)\in[0,1]$ where $a=|x-y|$, $b=|y|$, $x,y\in[-2,2]$. The desired function would have the property that an increase with $a$ corresponds with an increase in $z$ and a decrease in $b$ corresponds with an increase in $z$.

The answer from @epiliam quoted here:

Any function $z(a,b)=\frac{f(a)}{g(b)}$ where $0\le f(a) \le g(b)$ and $f$ and $g$ are monotone inreasing will have the required properties. If we set $f(a)=a=|x-y|\le |y|+|x| \le b+2$ then we see that $g(b)=b+2$ is a valid choice. So the obvious consideration is $$ z=\frac{a}{b+2}.$$ If you want disproportionate weights on changes in either $a$ or $b$ or for $z$ to favor "low" or "high" values there is a lot of wiggle room in choosing $f$ and $g$.

To give an example of an alternate option suppose you wanted $f(a)=a^2$ and you wanted $g(b)$ to be a degree lower (so that $z$ grows faster with $a$ than the correspondent decrease with $b$). We have that $$ a^2 = |x-y|^2 = x^2 + y^2 -2xy = x^2 + y(y-2x) \le 4 + > 6b.$$ Therefore $$z=\frac{a^2}{6b+4}$$ also works.

I understand why $0 \le f(a) \le g(b)$ and why $f$ and $g$ must be monotone increasing to fill these properties and to ensure $z \in[0,1]$ .

In the answer, the most simple solution was to set $f(a) = a = |x + y|$. In doing so, $g(b)$ was set to $|y| + |x| \le b + 2$.

My questions in trying to understand how $g(b)$ is calculated given $f(a)$:

  1. Why does the $g(b)$ in $0 \le f(a) \le g(b)$ turn into $|y| + |x| \le b + 2$ when $f(a) = a = |x + y|$?

$b + 2$ makes sense from $|y| + |x|$ since $b = |y|$.

  1. Is $|x| = 2$ because the maximum magnitude for $x = 2$ while the greatest value $a$ can be is 4** (e.g. $x=2, y=-2$ so $|2 - (-2)|$) and $f(a) \le g(b)$?

  2. Similarly, when $f(a) = a^2 = |x - y|^2 = (x - y)(x - y) = x^2 + y^2 - 2xy$ how would one calculate that $g(b) = 4 + 6b$?

In this case, if I fill in the maximum values for this where $x=2, y=-2$ then $f(a(2,-2)) = 2^2 + (-2)((-2) + (-2)(2)) = 4 + (-2)*(-6))$ which feels like it's getting close to the answer.

I don't entirely understand if one was to do this from the beginning, how would you come up with $g(b)$ given $f(a)$.

If this is poorly formatted or phrase, please let me know. I will make the changes immediately.

1

There are 1 best solutions below

13
On BEST ANSWER

Since $z(a,b)\in [0,1]$, then we have $z(a,b)\leq 1.$ Then $b=|y|$ and because $x\in[-2,2]$ we have that $x\leq 2$, or $|x|\leq 2$.

By the triangle inequality we have $$f(a)=a=|x-y|\color{red}{\leq}|x|+|y|\leq b+2$$

This means that $$a=f(a)\leq b+2$$

or $$\frac{a}{b+2}=\frac{f(a)}{b+2}\leq 1$$

so choosing $g(b)=b+2$ we indeed have found a function $z(a,b)$ with $$z(a,b)=\frac{f(a)}{g(b)}=\frac{a}{b+2}\leq 1$$

that also satisfies the required properties.