Floor and Ceiling Function — Definition and Examples
Floor and Ceiling Function — Definition and Examples
TL;DR
The floor function ⌊x⌋ gives the greatest integer less than or equal to x, and the ceiling function ⌈x⌉ gives the least integer greater than or equal to x. This article covers their notation, graphs, properties, and worked examples, plus the negative-number trap that costs the most marks.
What Are the Floor and Ceiling Functions?
The floor function, written ⌊x⌋, returns the greatest integer that is less than or equal to x. The ceiling function, written ⌈x⌉, returns the least integer that is greater than or equal to x. In plain terms, floor rounds down to the nearest integer and ceiling rounds up.
For ( x=3.2 ): ⌊3.2⌋=3 and ⌈3.2⌉=4. When x is already an integer, both agree: ⌊5⌋=⌈5⌉=5.
How Do You Read the Notation?
The square-bottomed brackets ⌊⌋ mean floor, and the square-topped brackets ⌈⌉ mean ceiling. A quick memory anchor:
- ⌊7.9⌋=7 (down to the nearest integer)
- ⌈7.1⌉=8 (up to the nearest integer)
- ⌊−2.3⌋=−3 (down means more negative)
- ⌈−2.3⌉=−2 (up means less negative)
Floor and Ceiling Function Formula
Stated precisely with set-builder notation:
⌊x⌋=max{n∈Z:n≤x}
⌈x⌉=min{n∈Z:n≥x}
In words, floor is the largest integer no bigger than x, and ceiling is the smallest integer no smaller than x. The variable key below keeps the symbols straight.
| Symbol | Meaning |
|---|---|
| x | Any real number (the input) |
| n | An integer chosen from Z (the output) |
| Z | The set of all integers {…,−2,−1,0,1,2,…} |
| ⌊x⌋ | Floor of x: the greatest integer ≤x |
| ⌈x⌉ | Ceiling of x: the least integer ≥x |
What Do Their Graphs Look Like?
Both functions produce a staircase graph made of flat horizontal segments. Each step is one unit wide and jumps by one unit at every integer.
- The floor graph holds the value of the left endpoint of each interval: on the interval [3,4), ⌊x⌋=3.
- The ceiling graph holds the value of the right endpoint: on (3,4], ⌈x⌉=4.
Which Properties Should You Know?
A handful of identities cover almost every problem. Each holds for any real x and integer n.
- Integer shift: ⌊x+n⌋=⌊x⌋+n and ⌈x+n⌉=⌈x⌉+n.
- Bounds: ⌊x⌋≤x<⌊x⌋+1 and x≤⌈x⌉<x+1.
- Relationship: for non-integer x, ⌈x⌉=⌊x⌋+1; for integer x, ⌈x⌉=⌊x⌋.
- Negation: ⌊−x⌋=−⌈x⌉, which is where the negative-number mistakes hide.
Examples of the Floor and Ceiling Function
The examples move from a single value up to an applied problem. Work each line before reading the next.
Example 1
Evaluate ⌊4.7⌋ and ⌈4.7⌉.
- The integers around 4.7 are 4 and 5.
- ⌊4.7⌋=4 (greatest integer not above 4.7).
- ⌈4.7⌉=5 (least integer not below 4.7). Final answer: ⌊4.7⌋=4, ⌈4.7⌉=5.
Example 2
Evaluate ⌊−2.3⌋.
- The tempting move is to drop the decimal and answer −2. Test it: is −2 less than or equal to −2.3? No, so the greatest integer less than or equal to −2.3 is ⌊−2.3⌋=−3. Final answer: ⌊−2.3⌋=−3.
Example 3
Evaluate ⌈−2.3⌉.
- The least integer greater than or equal to −2.3 is ⌈−2.3⌉=−2. Final answer: ⌈−2.3⌉=−2.
Example 4
Simplify ⌊3.6+5⌋ using the integer-shift property.
- ⌊3.6+5⌋=⌊3.6⌋+5 = 3 + 5 = 8. Final answer: ⌊3.6+5⌋=8.
Example 5
Evaluate f(x)=⌈3x−5⌉ at x=3.9.
- Substitute first: 3(3.9)−5=11.7−5=6.7, hence ⌈6.7⌉=7. Final answer: f(3.9)=7.
Example 6
A print shop charges per sheet, and each sheet holds 4 photos. How many sheets are needed for 27 photos?
- Sheets = 27÷4=6.75. Round up with ceiling: ⌈6.75⌉=7. Final answer: 7 sheets.
Why the Floor Function Runs Quietly Behind Everyday Systems
The floor and ceiling functions exist to answer a single stubborn question: how do you turn a continuous amount into a whole count?
- The notation ⌊x⌋ and ⌈x⌉ was introduced by Kenneth Iverson in 1962 to make integer rounding precise in computing, replacing the older ambiguous "greatest integer" bracket [x].
- Applications include tax brackets (floor) and pagination (ceiling).
Tripping Points to Avoid
Three errors account for most wrong answers:
- Rounding negatives the wrong way: ⌊−4.2⌋ should equal −5.
- Swapping the two brackets: ⌈4.2⌉ not = 4.
- Assuming they always differ by 1: on integer inputs, ⌊6⌋=⌈6⌉=6.
Conclusion
- The floor function gives the greatest integer at or below x; the ceiling function gives the least integer at or above x.
- Both draw staircase graphs; floor holds the lower integer per step, ceiling the upper.
- For negatives, floor moves away from zero: ⌊−2.3⌋=−3.