# How do you express $f(x)$ given the following inequalities

If $$f(x) = 0$$

when

$$0 < x \le 50$$

and

$$f(x) = 100$$

when

$$50 < x \le 100$$

How do you express the $f(x)$?

e.g. \begin{align} f(0) & = 0 \\ f(50) & = 0 \\ f(51) & = 100 \\ f(100) & = 100 \end{align}

-
That is correct. –  qnoid Jan 12 '13 at 21:50
You have written $0\lt x\le50=0$, which is clearly not what you meant to write, since $50$ doesn't equal zero. Can you edit the body of your question, please, to bring it into line with what you actually mean to ask? –  Gerry Myerson Jan 12 '13 at 21:50
@qnoid You already have a representation $$f(x) = \begin{cases} 0 & x \in [0,50]\\ 100 & x \in (50,100]\end{cases}$$ –  user17762 Jan 12 '13 at 21:56

The proper expression would be $$f(x)=\begin{cases}0&:\ 0\leq x\leq 50\\ 100 &:\ 50<x\leq 100\end{cases}.$$

-
does this mean that a single function that finds y does not exist? –  qnoid Jan 12 '13 at 22:00
You are not likely to find an expression simpler than this. –  Austin Mohr Jan 12 '13 at 22:08
@qnoid: This is what is called a piecewise function. It is a single function with different definitions depending on where $x$ is located. –  Clayton Jan 12 '13 at 22:11

Maybe this counts?

$f(x) = 100 \left[\frac{x}{50+0}\right]$, defined for $0\le x\le 100$

-
This is basically the same answer, since the greatest integer function itself has a piecewise definition. –  Austin Mohr Jan 12 '13 at 22:12

It is easy to see:

$$f(x) = \begin{cases}0 & 0 \le x \le 50 \\ 100 & 50 < x \le 100\end{cases}$$

If you want an expression which can be put into "one equation" so to speak, you can have it, but whether it is better or worse is debatable.

$$f(x) = 100 \left\lfloor \frac{x}{50} \right\rfloor$$

Where $\lfloor x \rfloor$ is the integer less than $x$. Note that this a little different, for example, this is defined even for $x \not\in [0, 100]$

-
This is basically the same answer, since the greatest integer function itself has a piecewise definition. –  Austin Mohr Jan 12 '13 at 22:13
@AustinMohr, agreed, and there is absolutely no way, or reason, to want to put a simple piecewise definition into a confusing linear one. –  George V. Williams Jan 12 '13 at 22:15