0

I need to get Sign of an integer nonnegative number using 4 basic math operations (summation, subtraction, multiplication, division). Abs or other functions are not allowed. How can I do this?

Ali Tor
  • 180

1 Answers1

2

Any such function would be, by definition, the restriction to the natural numbers of some rational function $f:\Bbb R\setminus\{\text{a few points}\}\to \Bbb R$, and it ought to be $1$ on all natural numbers except $0$, and be $0$ in $0$. This cannot be the case, because the constant $1$ is a rational function and two distinct rational functions can only coincide on finitely many points.

  • This assumes a procedure independent of such number, no? As in, the rational function is fixed beforehand. – qualcuno Jan 27 '21 at 09:15
  • @guidoar I mean, that seems to be the case, no? It strikes me as obvious that the OP wants a rational function that works for all natural numbers, because if you could make cases, then take $0$ in $0$ and $1$ elsewhere. –  Jan 27 '21 at 09:17
  • Agreed, haha. +1 – qualcuno Jan 27 '21 at 09:17