Greatest Integer Function: Definition & Examples
In this lesson, we’ll examine the greatest integer function. We’ll define this function through words and examples, and lastly, we’ll take a look at different real world scenarios when this type of function can be used.
Greatest Integer Function
Have you ever mailed a package? If so, you probably noticed that the shipping cost depends on the weight of the package. For instance, suppose the post office has its priority shipping rates listed as shown like this:
Weight Cost
1 lb. up to 2 lbs. $1
2 lbs. up to 3 lbs. $2
3 lbs. up to 4 lbs. $3
4 lbs. up to 5 lbs. $4
5 lbs. up to 6 lbs. $5
6 lbs. up to 7 lbs. $6
7 lbs. up to 8 lbs. $7
8 lbs. up to 9 lbs. $8
9 lbs. up to 10 lbs. $9
The cost depends on the package weight, so the cost is a function of the package weight. However, here’s something interesting that’s a little different from the functions we’re used to seeing. Did you notice that the shipping cost for any package that has weight between x pounds and x + 1 pounds is the same? For example, if you had a package that weighed 1.2 pounds, it would cost $1 to ship, and if you had a package that weighed 1.8 pounds, it would also cost $1. In mathematics, this is a special type of function called the greatest integer function. It is also sometimes called a step function. There are different notations that we can use for the greatest integer function, including these:
gratinfun1
The greatest integer function is a function such that the output is the greatest integer that is less than or equal to the input. That makes sense, but it’s a little confusing. To clarify, let’s consider it another way. The greatest integer function takes an input, and the output is given based on the following two rules:
If the input is an integer, then the output is that integer
If the input is not an integer, then the output is equal to the next smallest integer
We can also think of it as taking an input and rounding down to the nearest integer. That makes things a bit more clear. So if we are given a number, say 18, and we plug it into the greatest integer function, we would get 18 back out since 18 is an integer. On the other hand, if we were given a non-integer number, say 5.27, the output would be equal to the next smallest integer, which is 5. I think we’ve got it!
To solidify our understanding of this concept, let’s consider some more examples:
gratinfun2
Graphing the Greatest Integer Function
Alright, we’ve got this greatest integer function concept down, but this may leave you curious about what a graph of this type of function might look like. Well, I’ll give you a hint – they don’t call it a step function for nothing! Let’s take a look at the graph of our postage example:
gratinfun3
Since the shipping cost is the same for a package weighing x pounds up to x + 1 pounds, the graph ends up being a series of horizontal lines that look like a set of steps – ah-ha, a step function! If we extend the graph in both directions using this same rule, the resulting graph is the graph of the greatest integer function.