# The Floor Function

## The Floor Function

Until a few decades ago, $[x]$ was a customary notation for the *whole part* of a real number $x.$ Nowadays, the *floor function* notation $lfloor xrfloor$ is at least as widely spread. The latter notation for the floor function and its companion for the ceiling function $lceil xrceil$ (which is the least integer not less than $x)$ were introduced by Kenneth Iverson in the early 1960s. Because of the extreme utility and frequency of use, the notations made inroads in mathematics literature. (PS: In the old version of the page I wrote: «If it were not for the difficulty of typesetting in HTML, I would follow the crowd. As it is, and for the time being, I shall be using the older $[x]$ notation.» However, the development of JavaScript and the MathJax library made using the new notations as easy as using the old ones. Hence, what follows is the renovated variant of the old page.)

For a given real $x,$ $lfloor xrfloor$ denotes the largest integer $n$ that does not exceed $x.$ From the definition, $lfloor xrfloor + 1$ is always greater than $x.$ $lfloor xrfloor = x,$ for all integer $x.$ For non-integer numbers, $lfloor xrfloor$ is strictly less than $x.$ The inequality $lfloor xrfloor le x ltlfloor xrfloor +1$ always holds. We can now define other functions via formulas that include $lfloor xrfloor.$ Take, for example, $f(x) = lfloorsin (x)rfloor.$ Can you draw the graph of this function?

There are many curiosities related to the floor function. Here are a few spurious examples drawn from an old Russian magazine (Mathematics Education, n1, 1934 ):

$lfloor erfloor ^

$lfloor sqrt<2>rfloor + lfloor sqrt<2>rfloor = lfloor sqrt<4>rfloor,$

$lfloor sqrt<3>rfloor + lfloor sqrt<3>rfloor = lfloor sqrt<6>rfloor,$

$lfloor sqrt<8>rfloor + lfloor sqrt<8>rfloor = lfloor sqrt<16>rfloor.$

The function has sensible uses as well. Following is a couple of examples where the floor function plays a very meaningful role. In the analysis of Wythoff’s game. we had encountered two integer sequences: $A$ and $B$. The $n^ $ terms in the sequences $A$ and $B$ are expressed as $lfloor nphirfloor$ and $lfloor nphi^<2>rfloor,$ respectively, where $phi$ is the golden ratio $(sqrt<5> + 1)/2.$ The Beatty squences generalize this construction.

There is a well known problem whose formulation, perhaps even existence itself, depends on the floor function. In [Ref. 2 ], it has been designated as a *-problem, to indicate an increased level of difficulty.

Let integer $p$ and $q$ be coprime. Prove that

$displaystylebigglfloorfracbiggrfloor + bigglfloorfrac<2p>

biggrfloor + bigglfloorfrac<3p>

biggrfloor + ldots + bigglfloorfrac< (q-1)p>

biggrfloor =frac<(p-1)(q-1)><2>.$

However, the solution that appeals to a geometric interpretation is extremely simple.

Let, for example, $p = 7$ and $q = 16.$ Consider a system of Cartesian coordinates. Draw the line connecting the origin with point $(q, p).$ Note that since $p$ and $q$ are assumed to be coprime, the point $(q, p)$ is visible (from the origin.) That is to say that between the origin and the point $(q, p),$ that line contains no other grid points, points with integer coordinates. The number of such integer points inside the rectangle formed by points $(0, 0),$ $(0, p),$ $(q, 0),$ and $(q, p)$ is $(p — 1)(q — 1).$ $(p — 1)(q — 1)/2$ is half that quantity.

The equation of the diagonal line is $y = (p/q)x.$ It only remains to note that for an integer $0lt n,$ $lfloor np/qrfloor$ is the number of integer points $(n, m)$ below that line. For example, for $n = 8,$ there are $lfloor 8cdot 7/16rfloor = 3$ points, $(8, 1),$ $(8, 2),$ and $(8, 3).$ Since no integer point within the rectangle lies on the diagonal, all such points are either below or above the line. The left-hand side in the required identity counts the number of integer points below the diagonal. As we just saw, the number of such points is $(p — 1)(q — 1)/2.$

Curiously, from the symmetry (in $p$ and $q$) of the right side, we also have

$displaystylebigglfloorfracbiggrfloor + bigglfloorfrac<2q>biggrfloor + bigglfloorfrac<3q>biggrfloor + ldots + bigglfloorfrac< (p-1)q>biggrfloor =frac<(p-1)(q-1)><2>.$

The graph of the floor function consists of a sequence of unit intervals parallel to the $x$-axis.

The dot at the right end of each segment indicates that the point itself is excluded from the graph. The segments include the left end points but not the right end points. Indeed, $lfloor xrfloor$ is obtained by omitting the fractional part of $x,$ if any. For an integer $n$ and $x$ satisfying $n le x lt n+1,$ $lfloor xrfloor = n.$ Therefore, $lfloor xrfloor$ is constant in semi-open intervals $[n, n+1).$ Note the behavior for negative numbers. For example, $lfloor -3.5rfloor = -4$ in accordance with the definition.

$lfloor xrfloor$ has the property $lfloor x + nrfloor = lfloor xrfloor + n.$ So that integer pieces can be taken in and out of the brackets. The graph of $y = lfloorsin (x)rfloor$ is shown below.

The graph has solitary points (in red) where sine takes value $1$ but, otherwise, consists of line segments, some with excluded endpoints (in blue.) The function inherits from $sin (x)$ its period, $2pi.$ You may try to figure out the graph of the function $y =sinlfloor xrfloor$ which is not that nice at all.

To give another application, recollect a remark to the effect that the domain $mathbb

Second, for any number a, $0 lt a lt 1,$ $a^*tends* to $0$ as $n$ grows. Therefore, $mathbb

### References

- J. Cofman,
*What To Solve?*. Oxford Science Publications, 1996. - D. O. Shklarsky, N. N. Chentzov, I. M. Yaglom,
*The USSR Olympiad Problem Book*. Freeman, 1962