Floors and ceilings: definitions, defining inequalities, identities and counting

Two definitions, and why the wording matters

For a real number xx, the floor ⌊x⌋\lfloor x\rfloor is the greatest integer that is less than or equal to xx, and the ceiling ⌈x⌉\lceil x\rceil is the least integer that is greater than or equal to xx. Both functions map R\mathbb{R} to Z\mathbb{Z}; neither is injective, since every value is attained on a whole interval.


Read the definitions as instructions about position on the number line rather than as instructions about digits. Floor moves left (down) to the nearest integer, ceiling moves right (up).


For positive numbers this coincides with chopping off the decimal part, which is exactly why so many students get negatives wrong: truncation moves toward zero, and toward zero is right for a negative number, so truncating a negative computes the ceiling, not the floor.


  • ⌊5.8⌋=5\lfloor 5.8\rfloor = 5 and ⌈5.8⌉=6\lceil 5.8\rceil = 6.
  • ⌊−4.3⌋=−5\lfloor -4.3\rfloor = -5 and ⌈−4.3⌉=−4\lceil -4.3\rceil = -4. Note that −5<−4.3-5 \lt -4.3, so −5-5 really is the largest integer at or below −4.3-4.3; −4-4 is above it.
  • ⌊9⌋=⌈9⌉=9\lfloor 9\rfloor = \lceil 9\rceil = 9. At an integer the two functions agree, and this is the only situation in which they do.

The defining inequalities

Most floor and ceiling problems become routine once you replace the bracket notation with an inequality. For an integer nn:


  • ⌊x⌋=n\lfloor x\rfloor = n exactly when n≤x<n+1n \le x \lt n+1.
  • ⌈x⌉=n\lceil x\rceil = n exactly when n−1<x≤nn-1 \lt x \le n.


Watch which endpoint is included. The floor condition is closed on the left and open on the right; the ceiling condition is the reverse. That asymmetry is not decoration, it is what makes each function single-valued at the integers.


Two consequences are used constantly: x−1<⌊x⌋≤xx-1 \lt \lfloor x\rfloor \le x and x≤⌈x⌉<x+1x \le \lceil x\rceil \lt x+1. In words, each bracket function stays within one unit of xx, on the stated side.


Worked example. Solve ⌊x⌋=7\lfloor x\rfloor = 7. By the defining inequality, the solution set is the interval 7≤x<87 \le x \lt 8, that is [7,8)[7,8). It is an interval, not a single number. Compare ⌈x⌉=7\lceil x\rceil = 7, whose solution set is (6,7](6,7], a different interval, with the inclusion at the other end.

Identities: which ones survive every real number

Let nn denote an integer and x,yx, y arbitrary real numbers. A handful of relations hold universally, and many plausible-looking ones do not.


Statement

Status

Reason or counterexample

⌊x+n⌋=⌊x⌋+n\lfloor x+n\rfloor = \lfloor x\rfloor + n

Always true

An integer shift slides the defining interval without changing the fractional part

⌈x+n⌉=⌈x⌉+n\lceil x+n\rceil = \lceil x\rceil + n

Always true

The same argument applied to the ceiling's defining inequality

⌊x⌋+⌊y⌋≤⌊x+y⌋≤⌊x⌋+⌊y⌋+1\lfloor x\rfloor + \lfloor y\rfloor \le \lfloor x+y\rfloor \le \lfloor x\rfloor + \lfloor y\rfloor + 1

Always true

The discarded fractional parts sum to less than 2, so at most one unit carries

⌊x⌋+⌊−x⌋=0\lfloor x\rfloor + \lfloor -x\rfloor = 0

Only when x∈Zx\in\mathbb{Z}

At x=2.4x=2.4 the sum is 2+(−3)=−12+(-3)=-1, not 0

⌊x+y⌋=⌊x⌋+⌊y⌋\lfloor x+y\rfloor = \lfloor x\rfloor + \lfloor y\rfloor

Not always

At x=y=0.6x=y=0.6: the left side is 1, the right side is 0


A pattern is visible in these rows. Floor and ceiling commute with adding an integer, because a whole-unit shift cannot change where xx sits within its unit interval. They do not commute with adding an arbitrary real or with multiplying, because those operations alter the fractional part, which can then carry into the integer part.

How to test a proposed identity

Given a candidate relation, do not try to prove it first. Try to break it, using a short list of deliberately awkward values.


  • An integer, such as x=4x=4. Floor and ceiling coincide there and nowhere else, so any relation that treats them as differing will fail at exactly these points. This is the single most productive test.
  • A half-integer, such as x=0.5x=0.5. Doubling carries the fractional part across a boundary, which breaks relations that assume the bracket functions are linear.
  • A negative non-integer, such as x=−4.3x=-4.3. This catches any argument that silently assumed truncation, since truncation moves toward zero and floor moves away from it.
  • A second variable, as with x=y=0.6x=y=0.6. Two fractional parts that sum past 1 defeat relations that assume additivity.


If a candidate survives all four, then look for a proof. One further technique is worth having: floor and ceiling are related to each other by reflection through 00, since negating a number exchanges what lies above it with what lies below.


Applying −1-1 to a floor's defining inequality and reversing the direction of the inequalities will produce a ceiling statement, and it is worth carrying out that manipulation yourself to see which identity it yields.

Proving a floor identity: the fractional-part method

Nearly every identity in this topic is proved the same way. Write x=m+fx = m + f where m=⌊x⌋∈Zm = \lfloor x\rfloor \in \mathbb{Z} and the fractional part satisfies 0≤f<10 \le f \lt 1. Then handle the cases into which ff falls.


For instance, to show ⌊x+n⌋=⌊x⌋+n\lfloor x+n\rfloor = \lfloor x\rfloor + n for integer nn: from m≤x<m+1m \le x \lt m+1, adding nn gives m+n≤x+n<m+n+1m+n \le x+n \lt m+n+1. Since m+nm+n is an integer, the defining inequality identifies it as ⌊x+n⌋\lfloor x+n\rfloor, which is ⌊x⌋+n\lfloor x\rfloor + n. Notice the whole proof is the definition applied twice; no case split is needed here because the shift is by a whole unit.

Counting with floors and ceilings

The two most useful applications in a discrete mathematics course are counting and packing.


Counting multiples. The number of positive multiples of dd that do not exceed NN is ⌊N/d⌋\lfloor N/d\rfloor, because those multiples are d,2d,…,kdd, 2d, \dots, kd with kk the largest integer satisfying kd≤Nkd \le N, i.e. k≤N/dk \le N/d. For example, the multiples of 6 up to 250 number ⌊250/6⌋=⌊41.67⌋=41\lfloor 250/6\rfloor = \lfloor 41.67\rfloor = 41, and the check is that 6×41=246≤2506\times 41 = 246 \le 250 while 6×42=2526 \times 42 = 252 overshoots.


Packing. When items must be distributed into groups of fixed capacity and no item may be left over, the number of groups is a ceiling. If 290 delegates must travel in coaches seating 24, the requirement is ⌈290/24⌉=⌈12.083‾⌉=13\lceil 290/24\rceil = \lceil 12.08\overline{3}\rceil = 13 coaches.


Twelve coaches seat only 288. Floor would answer 12 and strand two people; the choice between the two functions is a modelling decision, decided by asking whether a partial group is acceptable.

Errors worth rehearsing

  • Truncating negatives. ⌊−4.3⌋\lfloor -4.3\rfloor is −5-5, not −4-4. Sketch the number line if in doubt.
  • Rounding. Neither function rounds to nearest. ⌊5.8⌋=5\lfloor 5.8\rfloor = 5, even though 5.8 is much closer to 6.
  • Treating ⌊x⌋=n\lfloor x\rfloor = n as an equation with one solution. Its solution set is always a half-open interval of length 1.
  • Skipping the integer case. Many relations between floor and ceiling behave differently when xx happens to be an integer, and that is where a careless argument usually breaks. Test it separately, every time.

Evaluate ⌊−7.4⌋\lfloor -7.4\rfloor and ⌈−7.4⌉\lceil -7.4\rceil.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A university must run a compulsory safety briefing for all 371 enrolled students. The lecture hall seats 48 students, and every student must attend one of the sittings.

What is the smallest number of sittings that will accommodate all the students?

Give your answer in sittings.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Which of the following statements is true for every real number xx?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors