Proof of a property of Greatest Integer Function

317 Views Asked by At

If $a,b,q\in\mathbb{Z}^+, r\in\mathbb{N}$ such that $a=qb+r,0\leq r\lt b,$ how do you prove that $q=\lfloor\frac{a}{b}\rfloor$ and $r=a-b\lfloor\frac{a}{b}\rfloor$?

1

There are 1 best solutions below

0
On BEST ANSWER

We only need to prove $q=\lfloor\dfrac ab\rfloor$ as the other result follows immediately from $r=a-bq$.

We have $\dfrac ab=q+\dfrac rb$, and we know that $0\le\dfrac rb\lt1$ and that $q$ is an integer.

So $\lfloor\dfrac ab\rfloor=\lfloor q+\dfrac rb\rfloor=\lfloor q\rfloor=q$.