Skip to content Skip to navigation

OpenStax-CNX

You are here: Home » Content » Greatest and least integer functions

Navigation

Recently Viewed

This feature requires Javascript to be enabled.
 

Greatest and least integer functions

Module by: Sunil Kumar Singh. E-mail the author

In this module, we shall study a family of functions which return integers based on certain rule, corresponding to a real number. Greatest integer function (floor), least integer function (ceiling) and nearest integer function form part of this family.

Greatest integer function (Floor function)

Greatest integer function returns the greatest integer less than or equal to a real number. In other words, we can say that greatest integer function rounds “down” any number to the nearest integer. This function is also known by the names of “floor” or “step” function. The greatest integer function (GIF) is denoted by the symbol “[x]” .

Interpretation of Greatest integer function is straight forward for positive number. Consider the values “0.23” and “1.7”. The greatest integers for two numbers are “0” and “1”. Now, consider a negative number “-0.54” and “-2.34”. The greatest integers less than these negative numbers are “-1” and “-3” respectively.

We can observe here that greater integer function is actually a function that returns the integral part of a positive real number. This interpretation is clear for positive number. Interpretation for negative numbers needs some explanation. We interpret these values in the context of the fact that every real number can be decomposed to have two parts (i) integral and (ii) fractional part. From this point of view, the negative number can be thought as :

-0.54 (real number) = -1 (integral part) + 0.36 (fraction part) -0.54 (real number) = -1 (integral part) + 0.36 (fraction part)

-2.34 (real number) = -3 (integral part) + 0.66 (fraction part) -2.34 (real number) = -3 (integral part) + 0.66 (fraction part)

We may be tempted to disagree (why not -2 + -0.34 = -2.34?). But, we should know that this is how greatest integer function (GIF) treats a negative number. It returns "-3" for "-2.34" - not "-2". Subsequently, we shall define a function called fraction part function (FPF) that returns fraction part of real number. We shall find that the function exactly returns the same fraction for negative number as has been worked out. The fraction part function (FPF) returns a fraction, which is always positive. It is denoted as {x}. Because of these aspects of GIF and FPF, we can understand the reason why negative number is treated the way it has been presented above. In terms of integral and fraction parts, we write a real number "x" as :

x = [ x ] + { x } x = [ x ] + { x }

In the nutshell, we can use any of the following interpretations of greatest integer function :

  • [x] = Greatest integer less than equal to “x”
  • [x] = Greatest integer not greater than “x”
  • [x] = Integral part of “x”

The value of "[x]" is an integer (n) such that :

f x = [ x ] = n ; if n x < n + 1 n Z f x = [ x ] = n ; if n x < n + 1 n Z

Working rules for evaluating greatest integer function are two step process :

  1. If “x” is an integer, then [x] = x.
  2. If “x” is not an integer, then [x] evaluates to greatest integer less than “x”.

Graph of greatest integer function

Few initial function values are :

F o r - 2 x < - 1, f x = [ x ] = - 2 F o r - 2 x < - 1, f x = [ x ] = - 2

F o r - 1 x < 0, f x = [ x ] = - 1 F o r - 1 x < 0, f x = [ x ] = - 1

F o r 0 x < 1, f x = [ x ] = 0 F o r 0 x < 1, f x = [ x ] = 0

F o r 1 x < 2, f x = [ x ] = 1 F o r 1 x < 2, f x = [ x ] = 1

F o r 2 x < 3, f x = [ x ] = 2 F o r 2 x < 3, f x = [ x ] = 2

The graph of the function is shown here :

Figure 1: The domain of the function is R.
Greatest integer function
 Greatest integer function  (fc1.gif)

This function is known as step function as values of function steps by "1" as we switch values of “x” from one interval to another. We see that there is no restriction on values of "x" and as such its domain has the interval equal to that of real numbers. On the other hand, the step function or greatest integer function evaluates only to integer values. It means that the range of the function is set of integers, denoted by "Z". Hence,

D o m a i n = R D o m a i n = R

R a n g e = Z R a n g e = Z

GIF is not a periodic function. Though function is defined for all real x, but graph is not continous. It breaks at integral values of x.

Example 1

Problem : Find domain of function given by :

f x = 1 π [ x ] f x = 1 π [ x ]

Solution : The denominator of function is positive. This means :

π [ x ] > 0 π [ x ] > 0 [ x ] < π [ x ] < π

The value of π is 3.14. Here, [x] returns integral value. Clearly, it can assume a maximum value of 3. But, GIF returns integer value “n” for x<n+1. The inequality, therefore, has solution given by :

x < 4 x < 4

Domain = - , 4 Domain = - , 4

Important properties

Certain properties of greatest integer function are presented here :

1: If and only if “x”is an integer, then :

[ x ] = x [ x ] = x

2: If and only if at least either “x” or “y” is an integer, then :

[ x + y ] = [ x ] + [ y ] [ x + y ] = [ x ] + [ y ]

For example, let x = -2.27 and y = 0.63. Then,

[ x + y ] = [ -2.27 + 0.63 ] = [ -1.64 ] = -2 [ x + y ] = [ -2.27 + 0.63 ] = [ -1.64 ] = -2

[ x ] + [ y ] = [ -2.27 ] + [ 0.63 ] = -3 + 0 = -3 [ x ] + [ y ] = [ -2.27 ] + [ 0.63 ] = -3 + 0 = -3

However, if one of two numbers is integer like x = -2 and y = 0.63, then the proposed identity as above is true.

4: If “x” belongs to integer set, then :

[ x ] + [ - x ] = 0 ; x Z [ x ] + [ - x ] = 0 ; x Z

For example, let x = 2.Then

[ 2 ] + [ - 2 ] = 2 2 = 0 [ 2 ] + [ - 2 ] = 2 2 = 0

We can use this identity to test whether “x” is an integer or not?

3: If “x” does not belong to integer set, then :

[ x ] + [ - x ] = - 1 ; x Z [ x ] + [ - x ] = - 1 ; x Z

For example, let x = 2.7.Then

[ 2.7 ] + [ - 2.7 ] = 2 3 = - 1 [ 2.7 ] + [ - 2.7 ] = 2 3 = - 1

Example 2

Problem : Find domain of the function :

f(x) = 1 [ x - 2 ] f(x) = 1 [ x - 2 ]

Solution : Given function is in rational form having GIF as its denominator. The denominator should not evaluate to zero for real values of x. The domain of GIF is real number set R. But, we know that GIF evaluates to zero in an interval which is spread over unit value. In order to know this interval, we determine interval of x for which [x-2] is zero.

[ x - 2 ] = 0 [ x - 2 ] = 0

We can write this function as :

[ x + ( - 2 ) ] = 0 [ x + ( - 2 ) ] = 0

Using property [x+y] = [x] + [y], provided one of x and y is an integer. This is the case here,

[ x + ( - 2 ) ] = [ x ] + [ - 2 ] = [ x ] - 2 = 0 [ x + ( - 2 ) ] = [ x ] + [ - 2 ] = [ x ] - 2 = 0

[ x ] = 2 2 x < 3 x [ 2 , 3 ) [ x ] = 2 2 x < 3 x [ 2 , 3 )

Hence, domain of given function is :

Domain = R - [ 2 , 3 ) Domain = R - [ 2 , 3 )

Fraction part function

We define a fraction part function (FPF) denoted by “{x}” as :

{ x } = x [ x ] { x } = x [ x ]

This function returns fraction part of the number, when “x” is not an integer. This exception of non-integral “x” is important. Zero is not a fraction. For integer "x", the function evaluates to zero :

{ 5 } = 5 [ 5 ] = 5 5 = 0 { 5 } = 5 [ 5 ] = 5 5 = 0

{ 5 } = 5 [ 5 ] = 5 + 5 = 0 { 5 } = 5 [ 5 ] = 5 + 5 = 0

Though zero is not a fraction, but FPF evaluates to zero for integral values. We should keep this exception in mind, while working with FPF. Let us, now, work out with numbers that we earlier used for evaluating greatest integer function :

{ 0.23 } = 0.23 [ 0.23 ] = 0.23 0 = 0.23 { 0.23 } = 0.23 [ 0.23 ] = 0.23 0 = 0.23

{ 1.7 } = 1.7 [ 1.7 ] = 1.7 1 = 0.7 { 1.7 } = 1.7 [ 1.7 ] = 1.7 1 = 0.7

{ - 0.54 } = - 0.54 [ - 0.54 ] = - .54 - 1 = - 0.54 + 1.0 = 0.36 { - 0.54 } = - 0.54 [ - 0.54 ] = - .54 - 1 = - 0.54 + 1.0 = 0.36

{ - 2.34 } = - 2.34 [ - 2.34 ] = - 2.34 - 3 = - 2.34 + 3.0 = 0.66 { - 2.34 } = - 2.34 [ - 2.34 ] = - 2.34 - 3 = - 2.34 + 3.0 = 0.66

We can see that interpretation of fraction for the negative number is consistent with what has been explained earlier.

Graph of {x}

Few function expressions in different intervals are :

For - 2 x < - 1, f x = { x } = x [ x ] = x 2 = x + 2 For - 2 x < - 1, f x = { x } = x [ x ] = x 2 = x + 2

For - 1 x < 0, f x = { x } = x [ x ] = x - 1 = x + 1 For - 1 x < 0, f x = { x } = x [ x ] = x - 1 = x + 1

For 0 x < 1, f x = { x } = x [ x ] = x 0 = x For 0 x < 1, f x = { x } = x [ x ] = x 0 = x

For 1 x < 2, f x = { x } = x [ x ] = x 1 For 1 x < 2, f x = { x } = x [ x ] = x 1

For 2 x < 3, f x = { x } = x - [ x ] = x - 2 For 2 x < 3, f x = { x } = x - [ x ] = x - 2

The graph of the function is shown here :

Figure 2: The domain of the function is R.
Graph of {x} function
 Graph of {x} function  (fc2.gif)

We see that there is no restriction on values of x and as such its domain has the interval equal to that of real numbers. The fractional part function can only evaluate to non-negative values between 0≤y<1. Hence,

Domain = R Domain = R

Range = 0 y < 1 Range = 0 y < 1

FPF is a periodic function. The values are repeated with a period of 1. Further, function is defined for all real x, but graph is not continous. It breaks at integral values of x.

Least integer function

We have seen that greatest integer function represents the integer, which can be considered to be the floor integral value of a real number. Correspondingly, we define a ceiling function called “least integer function (LIF)”, which returns the least integer greater than or equal to the number (x). We denote least integer function as “[x)” or "(x)". Some authors reserve "(x)" for near integer function. It is not important as we can always specify what we mean by qualifying the symbol explicitly. We interpret LIF as :

  • [x) = least integer greater than or equal to the number x
  • [x) = least integer not less than or equal to the number x

Clearly, least integer function returns a value, which is the integral “ceiling” of the number. For this reason, least integer function is also known as “ceiling” function. Working rules for finding least integer function are :

  1. If “x” is an integer, then [x) = x.
  2. If “x” is not an integer, then [x) evaluates to least integer greater than “x”.

The value of f(x) is an integer (n) such that :

f x = n ; if n - 1 < x n n Z f x = n ; if n - 1 < x n n Z

Graph of least integer function

Few initial values of the functions are :

F o r - 3 < x - 2, f x = [ x ) = - 2 F o r - 3 < x - 2, f x = [ x ) = - 2

F o r - 2 < x - 1, f x = [ x ) = - 1 F o r - 2 < x - 1, f x = [ x ) = - 1

F o r 1 < x 0, f x = [ x ) = 0 F o r 1 < x 0, f x = [ x ) = 0

F o r 0 < x 1, f x = [ x ) = 1 F o r 0 < x 1, f x = [ x ) = 1

F o r 1 < x 2, f x = [ x ] = 2 F o r 1 < x 2, f x = [ x ] = 2

Figure 3: The domain of the function is R.
Graph of least integer function
 Graph of least integer function  (fc3.gif)

We see that there is no restriction on values of “x” and as such its domain has the interval equal to that of real numbers. On the other hand, the least integer function evaluates only to integer values. It means that the range of the function is set of integers, denoted by "Z". Hence,

Domain = R Domain = R

Range = Z Range = Z

GIF is not a periodic function. Though function is defined for all real x, but graph is not continous. It breaks at integral values of x.

Important properties

Certain properties of least integer function are presented here :

1: If and only if “x”is an integer, then :

[ x ) = x [ x ) = x

2: If and only if at least either “x” or “y” is an integer, then :

[ x + y ) = [ x ) + [ y ) [ x + y ) = [ x ) + [ y )

For example, let x = 2.27 and y = 0.63. Then,

[ x + y ) = [ 2.27 + 0.63 ) = [ 2.9 ) = 3 [ x + y ) = [ 2.27 + 0.63 ) = [ 2.9 ) = 3

[ x ) + [ y ) = [ 2.27 ) + [ 0.63 ) = 3 + 1 = 4 [ x ) + [ y ) = [ 2.27 ) + [ 0.63 ) = 3 + 1 = 4

However, if one of two numbers is integer like x = 2 and y = 0.63, then the proposed identity as above is true.

4: If “x” belongs to integer set, then :

[ x ) + [ - x ) = 0 ; x Z [ x ) + [ - x ) = 0 ; x Z

For example, let x = 2.Then

[ 2 ) + [ - 2 ) = 2 2 = 0 [ 2 ) + [ - 2 ) = 2 2 = 0

We can use this identity to test whether “x” is an integer or not?

3: If “x” does not belong to integer set, then :

[ x ) + [ - x ) = + 1 ; x Z [ x ) + [ - x ) = + 1 ; x Z

For example, let x = 2.7.Then

[ 2.7 ) + [ - 2.7 ) = 3 2 = + 1 [ 2.7 ) + [ - 2.7 ) = 3 2 = + 1

Nearest integer function

Nearest integer function, as the name suggests, returns the nearest integer. It is denoted by the symbol, "(x)".

The value of "(x)" is an integer "n" such that :

f x = ( x ) = n ; if n x n + 1 / 2, n Z f x = ( x ) = n ; if n x n + 1 / 2, n Z

f x = n + 1 ; if n + 1 / 2 < x n + 1, n Z f x = n + 1 ; if n + 1 / 2 < x n + 1, n Z

Examples :

2.3 = 2, 2.6 = 3 2.3 = 2, 2.6 = 3

- 2.3 = - 2, - 2.6 = - 3 - 2.3 = - 2, - 2.6 = - 3

Exercise

Exercise 1

Find domain of the function :

f x = x 2 [ x ] 2 f x = x 2 [ x ] 2

Solution

We analyze given function using its properties to find domain. Subsequently, we shall use graphical solution, which is more elegant. Now, for radical function,

x 2 [ x ] 2 0 x 2 [ x ] 2 0

Evaluation of this expression for integer values of x is easy. We know that [x] evaluates to x for all integer values of x :

[ x ] = x ; x Z [ x ] = x ; x Z

Squaring both sides,

[ x ] 2 = x 2 ; x Z [ x ] 2 = x 2 ; x Z x 2 [ x ] 2 = 0 ; x Z x 2 [ x ] 2 = 0 ; x Z

However, evaluation of expression is slightly difficult for other values of x. Now, consider positive interval 1≤x<2. Here, [x] evaluates to 1 and its square is 1, which is less than or equal to x 2 x 2 . On the other hand, in negative interval -2≤x<-1, [x] evaluates to -2 and its square is 4, which is equal to or greater than x 2 x 2 .

[ x ] 2 x 2 ; x > 0 [ x ] 2 x 2 ; x > 0 [ x ] 2 x 2 ; x > 0 [ x ] 2 x 2 ; x > 0

Note that we have included “equal to sign” for both intervals of x. Equal to sign is appropriate when x is integer. For x=0, expression evaluates to 0. It means expression is non-negative for all non-negative x. But expression also evaluates to 0 for negative integers. Hence, domain of given function is :

Domain = 0, { - n ; n N } Domain = 0, { - n ; n N }

Graphical analysis

We draw y = [ x ] y = [ x ] and y = [ x ] 2 y = [ x ] 2 as in the first and second figures. Finally, we superimpose y = x 2 y = x 2 on the graph y = [ x ] 2 y = [ x ] 2 as shown in the third figure. Noting values of x for which value of x 2 x 2 is greater than or equal to [ x ] 2 [ x ] 2 , the domain of the function is :

Figure 4: Domain is chosen for x such that difference of graphs is non-negative.
Domain
 Domain  (fc4.gif)

Domain = 0, { - n ; n N } Domain = 0, { - n ; n N }

Content actions

Download module as:

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks