[Math] Proving Floor and Ceiling of a Rational Number

ceiling-and-floor-functionsrational numbers

Suppose x,y $ \in \mathbb{Z}^+ $

Prove $\lceil x/y \rceil = \lfloor (x-1)/y \rfloor + 1$

I was considering using the definition of floor and ceiling to prove this. But this does not seem like a valid proof to me as I assume the right hand side is already equal to the left hand side.

This is what I have so far:

Let n$ \in \mathbb{Z} $

$\lceil x/y \rceil = n \iff n-1 < x/y \leq n $

$\lfloor (x-1)/y \rfloor = n -1 \iff n-1 \leq (x-1)/y < n $
Then $\lfloor (x-1)/y \rfloor +1 = n \iff n-1 \leq (x-1)/y < n + 1 $

Then both sides are equivalent.

Would a better way be to prove using a contradiction by assuming both sides are not equal?

Best Answer

If $y$ divides $x$ then:

  • $\lceil\frac{x}{y}\rceil=\frac{x}{y}$
  • $\lfloor\frac{x-1}{y}\rfloor=\frac{x}{y}-1$

Hence $\lceil\frac{x}{y}\rceil=\lfloor\frac{x-1}{y}\rfloor+1$


If $y$ does not divide $x$ then:

  • $\lceil\frac{x}{y}\rceil=\lfloor\frac{x}{y}\rfloor+1$
  • $\lfloor\frac{x-1}{y}\rfloor=\lfloor\frac{x}{y}\rfloor$

Hence $\lceil\frac{x}{y}\rceil=\lfloor\frac{x-1}{y}\rfloor+1$

Related Question