Piecewise Relation for the Floor and Ceiling Functions

1k Views Asked by At

I am trying to write the piecewise function notation for the floor and ceiling step functions. This is my own rule - I am just looking for confirmation that it is valid.

For $f(x) = [x]$ and $c(x) = ]x[$, $a$ is the integer for which the equation is true, $b$ is the integer for which the inequality is true,

$f(x) = \begin{cases} x, x - a = 0 \\ b, 0 < x - b < 1 \end{cases} $

$c(x) = \begin{cases} x, x - a = 0 \\ b, -1 < x - b < 0 \end{cases} $

Now, allow me to explain my reasoning. For either function, if an integer can be subtracted from $x$ and leave $0$, that means $x$ is already an integer, and therefore the function simply returns $x$. But if it doesn't, then it continues to the second given equation.

For the floor function, $x$ subtracted by an integer has to lie between $0$ or $1$, or else $x$ is an integer and would have been returned by the first equation. So, the integer by which $x$ is subtracted and lies within that range is the floored value. For example, $f(6.5) = 6$, because $6$ is the only value by which $6.5$ can be subtracted and lie between $0$ and $1$. Similar is true for the ceiling function.

I am just wondering whether this is a valid explanation for the piecewise function, and what the formal mathematical notation for this would be.