# Given some $x ∈ ℝ$, find some $y ∈ ℝ: x < y < \left \lfloor {x+1} \right \rfloor$

Motivation:

This Wolfram webpage suggests that you can represent a floor function analytically as:

$$\left \lfloor x \right \rfloor := x + \frac{\tan^{-1}(\ \cot(\pi x) \ )}{\pi} - \frac{1}{2} \ \\ \forall x ∈ ℝ \backslash ℤ$$

which is valid whenever x is not an integer.

Yes, it works (and I'm amazed).

However, I'd like to safely use the function even when x is an integer, hence the question. It's not hard per-se, my brain just doesn't like me right now.

I appreciate any guidance you have to offer.

• The floor of an integer is itself, simple as that. – Parcly Taxel Jul 23 '18 at 9:13
• If $x$ is an integer then $\lceil x \rceil=x$. – lulu Jul 23 '18 at 9:14
• Somewhat heuristically, you cannot compose "nice" functions to make a floor function that works everywhere, because "nice" functions are continuous on their domains, and the floor function is not. (Note that the version of the floor function described above is continuous, because the points where it would be discontinuous are not part of the domain.) – Mees de Vries Jul 23 '18 at 9:18
• @MeesdeVries I tried using a dirac-delta to fill in the removable discontinuities (see answer). I'm a simple boy: I see dirac, I use dirac. – McMath Jul 24 '18 at 5:36
• @ParclyTaxel the problem is that the function in the question stem becomes undefined at integer values of x. Hope this helps. – McMath Jul 24 '18 at 5:37

The function:$$\left \lfloor x \right \rfloor := x + \frac{\tan^{-1}(\ \cot(\pi x) \ )}{\pi} - \frac{1}{2} \ \\ \forall x ∈ ℝ \backslash ℤ$$

breaks down for x ∈ ℤ because $\cot(\pi x)$ does not exist.

A potential fix is to add a function $\phi(x)$ that only turns on when x is an integer.

Thus:

$$\left \lfloor x \right \rfloor := \phi(x) + x + \frac{\tan^{-1}(\ \cot(\pi (\phi(x)+x)) \ )}{\pi} - \frac{1}{2}$$

where

$$\phi(x):=\frac{1}{4}\int_{-1}^{\cos(2\pi x)-1}{\delta(\tau)\ d\tau} \ + \ \frac{1}{4}\int_{1-\cos(2\pi x)}^{1}{\delta(\tau)\ d\tau}\$$

and $x∈ℝ$, which gets the job done.

You could probably write $\phi(x)$ using unit step functions.

The dirac-delta functional is technically a distribution, so maybe I cheated a little.

Best.

A simple solution to the problem stated in the question title, rather than in the paragraph below, is $$y = \frac{x + \lfloor x+1 \rfloor}{2}.$$

Mees de Vries's comment explains nicely why you're not likely to find a "pretty" answer in terms of known continuous functions.

• there's one minor problem with this approach: the definition of the floor in the question breaks down for integer x. Thus, x+1 is an integer, and the problem persists. – McMath Jul 24 '18 at 5:07
• The floor of an integer, is the integer of it self. So if $x \in \mathbb{Z}$, then $x+1 \in \mathbb{Z}$, so $\lfloor x+1 \rfloor := x+1$. Hence, if $x$ is an integer, the interval is $[x,x+1]$, and the average is clearly in it. – user518441 Jul 24 '18 at 5:35
• I know the definition of "floor"; it's what Raymond describes. The mess in the question happens to equal the floor when $x \notin \Bbb Z$, but so what? My answer provides a way to compute the thing asked for in the question; it uses the well-known "floor" function. That's not what you asked for in the body of the question, but as I said, there's unlikely to be any solution to the problem as written in the body. – John Hughes Jul 24 '18 at 18:30
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7097281217575073, "perplexity": 394.25866771318897}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-26/segments/1560627999814.77/warc/CC-MAIN-20190625072148-20190625094148-00439.warc.gz"}