A Craps Tutorial

Other Topics Section    --    The Greatest Integer Function   [ aka Bracket ftn or Floor ftn ]

  x   =   the largest integer not exceeding x

   

For our Bracket Function material,   we recommend black text on a white background.
But you can try other color schemes if cookies are enabled.

 





Note:
Internet Explorer doesn't support the floor function character entities [ e.g. ⌊ ]. So I created my own symbol for the bracket function.   My symbol doesn't have the correct color, but I don't yet have a better solution.

 

The bracket function is sometimes called the Gauss bracket function or the greatest integer function.   An implementation of it is available in many programming languages, where it is sometimes called the floor function.   In mathematics, its invocation is symbolized by putting a number or variable inside a pair of fancy square brackets.
For example, to apply the function to x we write     x   .

  Note:  
    Some people believe that this notation should be revised.
    For example, see
    A reason to deprecate the commonly used notation for the bracket function

We do not disagree; however, in this discussion we will stick with the commonly used notation.

We define   x     to be the greatest integer less than or equal to x.

Examples:     86     =   86        4.999     =   4        -2.001     =   -3

If a programmer is working with numerical quantities and needs to find the fractional part of some number x,   he might use these facts:
x ≥ 0     the fractional part of x is   x   -     x    
x < 0     the fractional part of x is   x - 1 -     x    

Before we derive some useful properties of the bracket function,   we need to know a little bit about real numbers and integers.

We hope you recall from some math class the concepts of real numbers, integers, and rational numbers.

The real numbers are those that can be plotted on a one-dimensional line.

The real numbers include the integers,   which are the whole numbers
0   1   -1   2   -2   3   -3   4   -4   5   -5   6   -6 ....

The integers are evenly spaced along the real number line.

All the numbers on the line are arranged by size --   as you move from left to right,   the numbers get larger.   So, if you were given two distinct real numbers located anywhere on the line,   the larger number would lie to the right of the smaller one.

The line is infinitely long,   but in Fig 1 we show a small piece of it near the number zero.

The rational numbers are those real numbers that can be expressed as one integer divided by another. For example, 36.2 is rational because it equals 362 / 10, a quotient of two integers.   Most real numbers are not rational. For example, it is not possible to express the exact value of the square root of 5 as a quotient of two integers
( 2236/1000   is close to but not exactly equal to √5 ).

Our discussion will ignore the rational numbers and focus on integers and reals.

Given any real number x,   either x is an integer or else
x lies between two consecutive integers k and k+1.

In the case where x lies between consecutive integers k and k+1,
it is obvious that   x   would have to equal k.

No matter whether x is an integer or not,
there must exist a real number   α   such that
x   =     x   +   α   where   0 ≤ α < 1.

In Fig 2 we show a piece of the number line for the case where x is not an integer.

The concepts we've just looked at can be very helpful to anyone who wants to understand the proofs of the following theorems about the bracket function.

One application:   theorems 1 and 2 are needed to derive the   Zeller formula   for a perpetual calendar   [ we have not shown the proof for that formula   ].

 
  Theorem   1      
    If x is any real number and t is any integer then
        x + t     =   x     +   t
  proof of theorem 1
 
  Theorem   2      
    If x is any real number and p is any positive integer   then
        x / p     =       x     / p    
  proof of theorem 2
 
  Theorem   3      
    For any real numbers x and y
        x     +     y   ≤   x + y   ≤   x   +   y   + 1
  proof of theorem 3
 
  Theorem   4      
    Let x be any real number.
      if x is an integer then     x     +     -x       =   0
otherwise,                     x     +     -x       =   -1
  proof of theorem 4
 
  Theorem   5      
    The smallest integer greater than or equal to x is   - -x  
  proof of theorem 5

  You might want to ignore theorem 6 and instead look at 6A and 6B.
 
  Theorem   6      
    Given any real number x,
let   c1   =   -   1/2 - x     and   let   c2   =     1/2 + x    
If x is an integer,   then c1 and c2 both equal x.   But if x is not an integer then x must lie somewhere between two consecutive integers k and k+1.   If x happens to lie exactly half way between k and k+1, then c1 = k and c2 = k+1.   Otherwise, c1 and c2 both equal the nearest integer to x.
  proof of theorem 6

  To simplify theorem 6, we split it into two theorems -- theorem 6A and theorem 6B.
 
  Theorem   6A      
    Let x be any real number.
    if x lies exactly halfway between two integers
then x + 0.5   is the larger of those two integers.
Otherwise, x + 0.5   is the closest integer to x.
  proof of theorem 6A
 
  Theorem   6B      
    Let x be any real number.
    if x lies exactly halfway between two integers
then   - 0.5 - x   is the smaller of those two integers.
Otherwise,   - 0.5 - x   is the closest integer to x.
  proof of theorem 6B

 





 

Last Update: 09 September 2006