Download Greatest and least integer functions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Large numbers wikipedia , lookup

Abuse of notation wikipedia , lookup

Big O notation wikipedia , lookup

Functional decomposition wikipedia , lookup

Addition wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Fundamental theorem of calculus wikipedia , lookup

Continuous function wikipedia , lookup

Collatz conjecture wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Dirac delta function wikipedia , lookup

History of the function concept wikipedia , lookup

Non-standard calculus wikipedia , lookup

Function (mathematics) wikipedia , lookup

Factorial wikipedia , lookup

Function of several real variables wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
OpenStax-CNX module: m15299
1
Greatest and least integer
functions
∗
Sunil Kumar Singh
This work is produced by OpenStax-CNX and licensed under the
Creative Commons Attribution License 2.0†
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 (oor), least integer function (ceiling) and nearest
integer function form part of this family.
1 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 oor 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)
-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 dene a function called fraction part function (FPF) that returns fraction part of real number. We
shall nd 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}
In the nutshell, we can use any of the following interpretations of greatest integer function :
∗
†
Version 1.9: Aug 12, 2008 12:02 pm +0000
http://creativecommons.org/licenses/by/2.0/
http://cnx.org/content/m15299/1.9/
OpenStax-CNX module: m15299
2
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
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.
1.1 Graph of greatest integer function
Few initial function values are :
F or
− 2 ≤ x < − 1,
F or
− 1 ≤ x < 0,
f (x) = [x] = −1
F or
0 ≤ x < 1,
f (x) = [x] = 0
F or
1 ≤ x < 2,
f (x) = [x] = 1
F or
2 ≤ x < 3,
f (x) = [x] = 2
The graph of the function is shown here :
http://cnx.org/content/m15299/1.9/
f (x) = [x] = −2
OpenStax-CNX module: m15299
3
Greatest integer function
Figure 1: The domain of the function is R.
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,
Domain = R
Range = Z
GIF is not a periodic function. Though function is dened 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) = p
Solution :
1
π − [x]
The denominator of function is positive. This means :
⇒ π − [x] > 0
⇒ [x] < π
http://cnx.org/content/m15299/1.9/
OpenStax-CNX module: m15299
The value of
π
4
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
Domain
= (−∞, 4)
1.2 Important properties
Certain properties of greatest integer function are presented here :
1:
If and only if xis an integer, then :
[x] = x
2:
If and only if at least either x or y is an integer, then :
[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] = −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
For example, let x = 2.Then
⇒ [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
For example, let x = 2.7.Then
⇒ [2.7] + [−2.7] = 2 − 3 = −1
Example 2
Problem :
Find domain of the function :
f (x) =
Solution :
1
[x − 2]
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
http://cnx.org/content/m15299/1.9/
OpenStax-CNX module: m15299
5
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
We can write this function as :
⇒ [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
⇒2≤x<3
[x] = 2
⇒ x ∈ [2, 3)
Hence, domain of given function is :
Domain
= R − [2, 3)
2 Fraction part function
We dene a fraction part function (FPF) denoted by {x} as :
{x} = x − [x]
This function returns fraction part of the number, when x is not an integer. This exception of nonintegral 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
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
⇒ {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
⇒ {−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.
http://cnx.org/content/m15299/1.9/
OpenStax-CNX module: m15299
6
2.1 Graph of {x}
Few function expressions in dierent intervals are :
For
For
− 2 ≤ x < − 1,
− 1 ≤ x < 0,
For
f (x) = {x} = x − [x] = x − (−2) = x + 2
f (x) = {x} = x − [x] = x − (−1) = x + 1
0 ≤ x < 1,
f (x) = {x} = x − [x] = x − 0 = x
For
1 ≤ x < 2,
f (x) = {x} = x − [x] = x − 1
For
2 ≤ x < 3,
f (x) = {x} = x − [x] = x − 2
The graph of the function is shown here :
Graph of {x} function
Figure 2: The domain of the function is R.
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
http://cnx.org/content/m15299/1.9/
=R
OpenStax-CNX module: m15299
7
Range
=0≤y<1
FPF is a periodic function. The values are repeated with a period of 1. Further, function is dened for
all real x, but graph is not continous. It breaks at integral values of x.
3 Least integer function
We have seen that greatest integer function represents the integer, which can be considered to be the oor
integral value of a real number. Correspondingly, we dene 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 :
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 nding
least integer function are : If x is an integer, then [x) = x. 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
3.1 Graph of least integer function
Few initial values of the functions are :
F or
− 3 < x ≤ −2,
f (x) = [x) = −2
F or
− 2 < x ≤ −1,
f (x) = [x) = −1
F or
http://cnx.org/content/m15299/1.9/
− 1 < x ≤ 0,
f (x) = [x) = 0
F or
0 < x ≤ 1,
f (x) = [x) = 1
F or
1 < x ≤ 2,
f (x) = [x] = 2
OpenStax-CNX module: m15299
8
2.
1.
Graph of least integer function
Figure 3: The domain of the function is R.
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
Range
=R
=Z
GIF is not a periodic function. Though function is dened for all real x, but graph is not continous.
It breaks at integral values of x.
3.2 Important properties
Certain properties of least integer function are presented here :
1:
If and only if xis an integer, then :
[x) = x
2:
If and only if at least either x or y is an integer, then :
[x + y) = [x) + [y)
For example, let x = 2.27 and y = 0.63. Then,
⇒ [x + y) = [2.27 + 0.63) = [2.9) = 3
http://cnx.org/content/m15299/1.9/
OpenStax-CNX module: m15299
9
⇒ [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
For example, let x = 2.Then
⇒ [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
For example, let x = 2.7.Then
⇒ [2.7) + [−2.7) = 3 − 2 = +1
4 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;
f (x) = n + 1;
if
if
n ≤ x ≤ n + 1/2,
n + 1/2 < x ≤ n + 1,
n∈Z
n∈Z
Examples :
(2.3) = 2,
(−2.3) = −2,
(2.6) = 3
(−2.6) = −3
5 Exercise
Exercise 1
(Solution on p. 10.)
Find domain of the function :
f (x) =
http://cnx.org/content/m15299/1.9/
p
2
x2 − [x]
OpenStax-CNX module: m15299
10
Solutions to Exercises in this Module
Solution to Exercise (p. 9)
We analyze given function using its properties to nd domain. Subsequently, we shall use graphical
solution, which is more elegant. Now, for radical function,
2
⇒ x2 − [x] ≥ 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
Squaring both sides,
2
[x] = x2 ;
2
x2 − [x] = 0;
x∈Z
x∈Z
However, evaluation of expression is slightly dicult 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
x2
. 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
x2 .
2
x>0
2
x>0
[x] ≤ x2 ;
[x] ≥ x2 ;
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
Graphical analysis
2
= (0, ∞) ∪ {−n; n ∈ N }
y = [x] and y = [x] as in the rst and second gures. Finally, we superimpose y = x2 on the
2
2
graph y = [x] as shown in the third gure. Noting values of x for which value of x is greater than or
2
equal to [x] , the domain of the function is :
We draw
http://cnx.org/content/m15299/1.9/
OpenStax-CNX module: m15299
11
Domain
Figure 4: Domain is chosen for x such that dierence of graphs is non-negative.
Domain
http://cnx.org/content/m15299/1.9/
= (0, ∞) ∪ {−n; n ∈ N }