0

Prove that $a\bmod b = a-b$ if $\frac{a}{2}\lt b\leq a$.

I know that $a\bmod b = a - qb$ for some $q\in \mathbb{Z}$ but I can't see how does the constraint $\frac{a}{2}\lt b\leq a$ help with $q = 1$

Bill Dubuque
  • 272,048
Malzahar
  • 520
  • Hint: q is the (integer) quotient when you divide $a$ by $b$. – NickD Oct 28 '21 at 17:27
  • It will be the floor of a/b. It makes sense to me that 1<=floor(a/b)<2 which means q=1 but I'm not sure how to arrive at that formally in a proof. – Malzahar Oct 28 '21 at 18:01
  • $q$ and $r$ are uniquely defined in the division algorithm. – NickD Oct 28 '21 at 18:33
  • yes, q=floor(a/b) and r=a-qb. Not sure what to do next. – Malzahar Oct 28 '21 at 19:18
  • The emphasis is on "unique": if you can find a $q$ and an $r$ with the required properties (both those required by the division algorithm -e.g. $0\le r \lt b$ - and those required by the problem at hand), that's it: there is no other solution. – NickD Nov 15 '21 at 23:22

0 Answers0