5
$\begingroup$

What is the correct definition of the absolute value of $x$, $|x|$?

Option A

$ |x|= \begin{cases} -x&\text{if } x < 0\\ 0& \text{if } x=0\\ x&\text{if } x>0 \end{cases} $

Option B

$ |x|= \begin{cases} -x&\text{if } x \leq 0\\ x&\text{if } x>0 \end{cases} $

Option C

$ |x|= \begin{cases} -x&\text{if } x < 0\\ x&\text{if } x\geq 0 \end{cases} $

  • 0
    From a computer science viewpoint, you'd understand the bitwise representation o$f$ numbers and take advantage of that. If a sign-magnitude representation is used, then you would simply produce a copy of the number in which the sign bit has been cleared, and you are done. Sign-magnitude is rare for integers at the machine level, but nearly ubiquitous for floating point, and common in implementations of bignum integers.2012-10-05

4 Answers 4

12

What about Option D? That is:

$|x|=\begin{cases}-x & x<0\\ x^2 & x=0,x=1\\ x & \text{otherwise}.\end{cases}$

In all seriousness, there are infinitely-many (seemingly) distinct ways to define $|x|$ piecewise, but in the end, they are precisely the same. All you've got to do is pick one.

  • 0
    To me, this question looks like it is about about how a function is expressed in formulas, not only about the function as an abstract relation between sets. It is even tagged with the `notation` tag.2012-10-05
11

There are many equivalent ways describing $|x|$ as a function of $x$, what about: $\max\{x,-x\}$?

It is important to remember that the way to describe a set is not important, what important is the set itself.

I can tell you to take three rights; or I could just tell you to take one left. The input is the same and the output is the same, and that is what matters.

In the context of the real numbers there are several ways to describe the absolute value, and they are all the same.

2

A function is both a rule and a domain on which that rule takes place. If, for two functions, the rule and the domain are the same, then the two functions are the same. Just to be clear, you gave several different rules, but they are all equivalent, i.e., they all agree for any $x$ you insert. And all of them have the same domain. So, they are all the same function. Which definition is best only depends on what you are working on.

For example, when you want to find the $\lim\limits_{x \to 0^-} \frac{|x|}{x}$, then any of your definitions will do just fine, and all work better than say $|x| = \max\{x, -x\}$ or $\sqrt{x^2}$.

$\lim_{x \to 0^-} \frac{|x|}{x} = \lim_{x \to 0^-} \frac{-x}{x} = \lim_{x \to 0^-} -1 = -1$

But, in other situations, maybe you'd prefer $\sqrt{x^2}$ for some reason.

0

Form C is the most elegant, because it breaks the problem into exactly the right cases: the subdomain of $x$ for which something has to be done to produce the absolute value, and a subdomain which is already identical to its absolute value. Only if $x$ is negative do we have to negate it, otherwise we leave it as is.

Option B is simply silly. Why include 0 in the domain that requires negating?

Option A is verbose, but it has a certain symmetry. In any case, it is better than B because at least it regards 0 as special (which it generally is, even if not specifically in this situation), rather than clumping it with the negatives.