Basically what I'm asking is if there are any functions $f: \mathbb{R}\rightarrow \mathbb{R}$ such that \begin{align}\text{floor}(f(x)) = f(\text{floor}(x)),\text{ or } f \circ \text{floor} = \text{floor} \circ f. \end{align} I am, of course, aware of trivial examples like $f(x) = x$, but I'm wondering if there's a whole class of functions?

For example, for $g(x) = x^b$, any function $f(x) = x^a$ will commute with $g$ in the way stated above; that is, $g\circ f = f\circ g$ for all $x \in \mathbb{R}.$

  • 6
    $\begingroup$ A slightly less dull answer is $f(x) = x + n$ where $n$ is an integer. $\endgroup$ – badjohn Jun 18 '20 at 9:31
  • 3
    $\begingroup$ Well, there are examples like $f(x)=x-\frac 12\times \{x\}$, where (as usual) $\{x\}$ denotes the fractional part of $x$, $x-\lfloor x\rfloor$. $\endgroup$ – lulu Jun 18 '20 at 9:33
  • 1
    $\begingroup$ Hmm, wouldn't any funtion where for all $n\le x < n+1$ then $[f(n)] \le f(x) < [f(n)] + 1$ do. Seems there's lots of variable. $\endgroup$ – fleablood Jul 18 '20 at 22:49

In order for $f(\lfloor x\rfloor)=\lfloor f(x)\rfloor$ to hold for all $x$, we must have $f(k)\in\mathbb{Z}$ for all $k\in\mathbb{Z}$, with $f(k)\le f(x)\lt f(k)+1$ for $k\le x\lt k+1$. Beyond that the function can behave any way it likes.

Remark: The prime counting function, $\pi(x)$, is a nice example of a function that commutes with the floor function. If you want a continuous example, the (strictly) increasing function

$$f(x)=x+{1\over\pi}\sin(\pi x)$$

fits the bill, since $f(k)=k$ for all $k\in\mathbb{Z}$. (It's increasing since $f'(x)=1+\cos(\pi x)\ge0$ for all $x$.)


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.