Google
 
Web unafbapune.blogspot.com

Thursday, November 29, 2012

 

Ex 1.6 \(a\) mod \(b\) with \(b < 0\)

Given (\(a\) mod \(b\)) is defined to be \(a - b \lfloor \frac{a}{b} \rfloor\). Let \(a,b \in \mathbb{Z}\) with \(b < 0\). Show that (\(a\) mod \(b\)) \(\in (b,0]\).






== Attempt ==

First, \(\lfloor \frac{a}{b} \rfloor\) is a unique integer \(m\) such that \( m \le \frac{a}{b} \lt m + 1 \). Equivalently, \(\frac{a}{b} = m + \epsilon \) for some \(\epsilon \in [0,1)\).
  \[ \begin{aligned} a \text{ mod } b &= a - b \lfloor \frac{a}{b} \rfloor \\ &= a - bm \\ &= b(m + \epsilon) - bm \\ &= b\epsilon \end{aligned} \]
Knowing that
  \[ \begin{aligned} 0 &\le \epsilon < 1 \text{, and given } b < 0 \\ 0 &\ge b\epsilon > b \\ 0 &\ge (a \text{ mod } b) > b \\ \end{aligned} \]
\(\Box\)


Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?