Consider a piecewise function . I want a general way to rewrite it , into the single expression . I know that for sign function there is a single expression but I'm looking for solve it generally.
Asked
Active
Viewed 1,483 times
2 Answers
2
It is not always possible, and many of the times it is possible, it's only because we're hiding the piecewise definition behind a dedicated piece of notation. For instance, the function $f(x)=|x|$ is really the function $$ f(x)=\cases{x&if $x\geq0$\\-x&if $x<0$} $$It's just that this particular piecewise function is so common that we have established a specific piece of notation to make writing the function easier.

Arthur
- 199,419
-
For example what about this ? $x \lt 0 \to y = 0$ and $x \gt 0 \to y =1$ – S.H.W Apr 12 '17 at 11:52
-
1Normally write this $f(x) = \chi_{{x>0}}(x)$ – Jack Apr 12 '17 at 11:54
-
$$y = \frac{1}{2}\left(\frac{x}{|x|}+1\right)$$ – quasi Apr 12 '17 at 11:55
-
@Jack Can you explain what is this ? $f(x) = \xi_{x>0}(x)$ – S.H.W Apr 12 '17 at 11:55
-
@quasi I think it is wrong for $x \lt 0$ – S.H.W Apr 12 '17 at 11:57
-
@S.H.W The function $\chi$ is defined by $\chi_A(x) = 1$ if $x \in A$ and $0$ otherwise. Other people denote it by $\mathbb 1_A$ – Jack Apr 12 '17 at 11:57
-
@S.H.W -- fixed now – quasi Apr 12 '17 at 11:57
-
@Jack But it is a piecewise function again ! – S.H.W Apr 12 '17 at 11:58
-
@S.H.W -- You didn't define $y$ when $x = 0$. What do you want it to be? – quasi Apr 12 '17 at 11:59
-
@quasi It's not important when $x=0$. – S.H.W Apr 12 '17 at 12:02
-
@S.H.W this might help - http://math.stackexchange.com/questions/1903741/step-function-without-piece-wise-definition?rq=1 – Jack Apr 12 '17 at 12:02
-
@Jack Thank you a lot . They were very complicated functions . I don't know how he gets it ! – S.H.W Apr 12 '17 at 12:08
1
In one of your comments, you asked for a function, defined for all $x \in \mathbb{R},\,$ such that $$ f(x)=\cases{ 0 &\text{if}\; x < 0\\[3pt] 1 &\text{if}\; x > 0 } $$ Here's one trick which will bury the cases . . .
$$f(x)=\left\lfloor{\max\left(0\,,\frac{1+x}{1+|x|}\right)}\right\rfloor$$

quasi
- 58,772
-
-
-
-
-
-
-
No$,-,$parentheses are correct. The function $\max$ is a function of two variables. By definition, $\max(a,b)$ equals $a$ or $b$, whichever is greater. – quasi Apr 12 '17 at 12:43
-
Okay but I see it usually with curly brackets . It's fine no problem thank you a lot! – S.H.W Apr 12 '17 at 12:45