5

I wonder if it is possible to build a $\operatorname{sign} (x)$ function which will return either $1$ for positive values of $x$, or $-1$ for negative ones - using only the four basic arithmetic operations $(+, -, \times , \div )$.

Clearly it is easy to accomplish this if using square root $\surd$ would be allowed as well, so$$\operatorname{sign} (x) = \frac{x}{\sqrt{x^2}}.$$

But is it possible using only basic arithmetics as well?

Later
  • 722
  • 2
  • 8
  • 24
  • 1
    What if you use the Taylor series for $\sqrt{x^2}$? – draks ... Mar 30 '12 at 13:09
  • 6
    Using $+, -, \times, /$ we get the so-called "rational functions". So now you ask for a proof that sign($x$) is not a rational function. Well, maybe prove that a rational function cannot have a "jump" discontinuity. – GEdgar Mar 30 '12 at 13:19

1 Answers1

14

No. First, note that you can rewrite every expression given in the arithmetic operations as a rational function: Say your expression calculates $f(x)$. Then $f(x) = p(x)/q(x)$ for two polynomials $p, q$. Suppose $f(x) = \mathrm{sign}(x)$. Then $p(x) = q(x)$ for $x > 0$ and $p(x) = -q(x)$ for $x < 0$. But if two polynomials $p, q$ agree on more than $\max \{ \deg p, \deg q\} + 1$ points, $p = q$, which is the case here, which implies $p = q$.

Of course, we must have $q(x) \neq 0$ for all $x$, since otherwise, $p(x)/q(x)$ is not defined everywhere. On the other hand, since $p(-1) = -q(-1) = -p(-1)$, $p(-1) = q(-1) = 0$, which is a contradiction.