# How does one create a step function?

Is there a general form for the equation of a step function? For example, if I wanted to find the equation of this particular step function: How would I go about doing so? At first I was thinking of a piecewise function, but what if the function goes on forever? I don't think a piecewise function will do. I would appreciate some help

• $$y(x) = \sup \{z \in \mathbb{Z} : z \le x\}$$
– user61527
Mar 17, 2014 at 20:56
• @T.Bongers I have no idea what $\text{sup}\{z\in \mathbb Z: z \leq x \}$ means Mar 17, 2014 at 20:57
• The supremum of a set is the last upper bound on a set.
– user61527
Mar 17, 2014 at 20:58
• I think the example on wikipedia en.wikipedia.org/wiki/Step_function is very good. Mar 17, 2014 at 20:59
• This looks like a horizontal shift of the greatest integer function (the floor function), $0.5$ units to the left. You can write it as $f(x) = \lfloor x + 0.5 \rfloor$.
– josh
Mar 17, 2014 at 21:04

For this particular step function (staying away from $\sup$), you need the floor function $f(x) = \lfloor x \rfloor$. $\lfloor x \rfloor$ is defined as "the largest integer less than or equal to $x$." In other words, if $x$ is not a whole number, you round down to the nearest whole number. If $x$ is a whole number, then $\lfloor x \rfloor$ is just $x$ itself. For instance, $\lfloor 1.2 \rfloor = 1$, $\lfloor 8.9 \rfloor = 8$, $\lfloor -2.2 \rfloor = -3$, and $\lfloor 5 \rfloor = 5$. If you were to graph $f(x) = \lfloor x \rfloor$, it would look something like this.
Your function looks like a shift of $f(x) = \lfloor x \rfloor$, $0.5$ units to the left. To move a function $c$-units to the left, you write it as $f(x+c)$. Using this idea with the function $f(x) = \lfloor x \rfloor$, you would write your function as $\lfloor x + 0.5 \rfloor$.