3

I am stuck on converting $0$ to $1$ and any whole number greater than Zero to $0$. Is there a mathematical way for doing so?Also how to notate it when using it in a function?

4 Answers4

4

The simple$$f(x)=\begin {cases} 1&x=0\\0 &x \gt 0 \end {cases}$$ does just what you asked. As people unreasonably do not like definitions by cases, you could also say $1-H(x)$ where $H(x)$ is the Heaviside step function. Unfortunately definitions of the step function at zero differ, so you have to make clear that you mean $H(0)=0$.

Ross Millikan
  • 374,822
1

If one doesn't mind limits, we can say $$ \lim_{n\to\infty}\left(\frac{1-x^2+x^4}{1+x^4}\right)^n =\left\{\begin{array}{} 1&\text{if }x=0\\ 0&\text{if }x\ne0\ \end{array}\right. $$

robjohn
  • 345,667
0

If $n$ is a nonnegative integer, what about:

$${1 \choose n+1}$$

If not what about,

$${1 \choose \lceil n+1 \rceil}$$

0

$$ f(x) = \frac{1+(-1)^{2^{|x|}-1}}{2} = \begin {cases} 1&x=0\\0 &x \ne 0 \end {cases} $$