In programming, often the value of True is also 1, and False is 0.
This means that:
(x>5)*4
will return 4 if x is greater than 5 (because (x>5)==1
), else 0.
I need to accomplish a similar thing using mathematical operators (no piecewise functions, this has to be typed into Desmos calculator.)
Specifically, I need $$ f(x)=\begin{cases} 1&&\text{if}~ x\leq n \\ 0&&\text{otherwise} \end{cases} $$ without having to use piecewise notation. Here $n$ is a positive integer, as is $x$.
(Posted by Dave Radcliffe but then deleted):