Are there smooth functions that in their limit can perform ceiling and floor operations

ceiling-and-floor-functions

Preamble

  1. There is a motivation section at the bottom which explains where this arose from — might be helpful or of interest
  2. There is a set of ideal criteria which if met would define the ideal solution
  3. There a follow on set of less than criteria which relax the ideal criteria — some readers pointed out that the original criteria are unnecessarily restrictive

Do we have

Ideal Criteria

$1.$ functions like $f(x,\theta)$ and $g(x,\theta)$

$2.$ are defined where $\theta \in {\rm I\!R}^1$ and $x \in {\rm I\!R}^1$

$3.$ are smooth and continuous where $ \left| \theta \right| \lt C$ where $C$ is some constant

$4.$ $f$ and $g$ themselves cannot be defined (make use of) the floor or ceiling functions

$5.$ $f$ and $g$ cannot be defined as different functions over subsets over their domain for example: 𝑓(𝑥,𝜃)=0 for |𝜃|<𝐶 and 𝑓(𝑥,𝜃)=⌊𝑥⌋

$6.$ $f$ and $g$ can make use of $\Sigma$ and $\Pi$ operators

$7.$ $f$ and $g$ can make use of frequency type decomposition

Less than Ideal Criteria — which may involve relaxing some of the Ideal Criteria

$8.$ a less than ideal solution would allow $\theta$ to be $\in \mathbb{Z}$

$9.$ a less than ideal solution can allow $f$ and $g$ to make of differentiation and integration

$10.$ a borderline admissible solution would allow $f$ and $g$ to a composition of different functions over disjoint subsets over their domain — in other word relaxing condition $4.$

that we get

$$
\lim_{\theta \to \infty} f(x, \theta) = \lfloor x \rfloor
$$

and

$$
\lim_{\theta \to \infty} g(x, \theta) = \lceil x \rceil
$$

Motivation

  1. The question really comes from can we implement something in terms of something else — kinda like how can we use deterministic logic to generate random numbers, or how can we implement a Turing machine using NAND logic

  2. Additionally, more mental itch — would be great to see floor and ceiling implementations using middle-school or say high-school math

  3. I want a representation off floor and ceiling that is does not make use of the if-then — say we were to implement floor and ceiling in terms of electrical or mechanical machinery, if-then machinery is complex and expensive

  4. Say we were in a world where analog computers existed where we had black-boxes that did addition, multiplication, power, division, log, but no memory and no if-then/jump type stuff — could we implement floor and ceiling

  5. Allowing direct memory components such as accumulators or delay operators would not be allowed

Best Answer

For continuous functions, we can take $$ f(x,\theta) = \lfloor x \rfloor + \big( x - \lfloor x \rfloor \big)^\theta. $$ It's easy to convert this to smooth functions, since there is always a smooth function $\tilde f(x,\theta)$ uniformly satisfying $\big| \tilde f(x,\theta) - f(x,\theta) \big| < \frac1\theta$.

In any case, we can take $g(x,\theta) = -f(-x,\theta)$, since $-\lfloor-x\rfloor = \lceil x\rceil$.