I have a piecewise function $f(x)$, it takes up too much space, I want to conserve space when writing it. Is there a practical and professional way to write it in a single line, so I save some space? $$ f(x) = \begin{cases} a, & x = 0 \\ b, & x = 1 \\ c, & x \neq 0,1 \end{cases} $$

  • $\begingroup$ I have voted to close this question as off-topic, because it is not about mathematics (it is about typesetting, really). You might be better off asking at TeX - LaTeX. $\endgroup$ – Xander Henderson Feb 11 at 17:40
  • $\begingroup$ @XanderHenderson It has more to do with formalism of math expression, but math nonetheless I think. $\endgroup$ – updraft Feb 11 at 18:03

It's common to use $1_A(x)$ to denote $1_A(x) = 1$ for $x\in A$ and $=0$ everywhere else. Hence, we can rewrite $f$ as $f(x) = a1_{0} +b1_{1} + c1_{\{0,1\}^c}$

  • $\begingroup$ Fantastic answer @Andrew Yuan by using characteristic functions. +1 for that. $\endgroup$ – Dbchatto67 Feb 11 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.