1

I came across the following example on page 9 of Introduction to Arithmetic for Digital Systems by Waser and Flynn:

Example 1.5

Suppose we have two $\mod 99$ $A'$ and $B'$, having the following operations performed $\mod 100$, and then corrected to $\mod 100$ and then to a $\mod 99$ result?

(i) $A' = 47$, $B' = 24$; find $(A' + B') \mod 99$.

    47
   +24
  -----
   071    71 mod 100 ≡ 71 mod 99 = result

(ii) $A' = 47$, $B' = 57$; find $(A' + B') \mod 99$.

    47
   +57
  -----
   104    4 mod 100 ≡ 5 mod 99 = result
    +1
  -----
    05

(iii) $A' = 47$, $B' = 52$; find $(A' + B') \mod 99$.

    47
   +52
  -----
   099    99 mod 100 ≡ 0 mod 99 = result

Could someone please help me understand why $4 \mod 100 \equiv 5 \mod 99$?

I know that $N \mod \mu \equiv M \mod \mu$, iff there exists an integer $K$ such that $N - M = K\mu$, but I don't know how to interpret congruence between two different moduli.

user51462
  • 673
  • 6
  • 12
  • 31
  • You need to read the first paragraph very carefully. – copper.hat Aug 18 '23 at 05:46
  • 3
    Take the 2nd example above, the result of adding is $104$ which is $4 $ modulo $100$ but, $104$ is $5$ modulo $99$. The process that is (poorly described & justified) is to take the addition value $104$ and use that to compute the result modulo $99$. – copper.hat Aug 18 '23 at 05:59
  • I also think there is a typo, I would guess that the modulus should be $\beta^n-1$ not $\beta^n$. – copper.hat Aug 18 '23 at 06:00
  • Gack this exposition (the original source, not OP). – Brian Tung Aug 18 '23 at 16:46

2 Answers2

4

Looks like a typographical error as well as some pretty rubbish notation ($=$ result?? No thanks).

There's two conventional (and closely related) ways of interpreting mod. One is as an equivalence relation (congruence mod m) which is kind of how you have written it: $$ a \equiv b \text{ mod } m \quad \text{if $m|(a-b)$} $$ (here, think of 'mod' as being attached to the relation $\equiv$, rather than either of the numbers).

The other way is as an operator on a number, that is $ a \text{ mod } m = b$ where $b$ is the unique number such that $m|(a-b)$ and $0\leq b \leq m-1$. That's how this text is using it (but in that case it is confusing that they use $\equiv$). Note however that in that case $$ 5 \text{ mod } 100 = 5 \text{ mod } 99 \neq 4 \text{ mod } 99. $$ (They do this correctly in the other examples).

messenger
  • 1,026
1

It's a poor description (of the linear case) of casting out $\,99$'s, a radix (base) $100$ analog of casting out nines. Namely write the sum $s$ in radix $100$ as follow $s = 100\,h + u,\,$ so $\,h =\,$ hundreds digit, $u= $ units digit in radix $100$. Then $\!\bmod 99\!:\ \color{#c00}{100\equiv 1}\Rightarrow s = \color{#c00}{100}\,h + u \equiv h+u \equiv$ digit sum, e.g. for their 2nd example $\color{#c00}1\color{#0a0}{04}\equiv \color{#c00}1+\color{#0a0}{04}\equiv 5\pmod{\!99}.$ The same works for any size integer with radix $100$ digits $\,d_i,\,$ i.e.

$$\begin{align} n = f(\color{#c00}{100})\, = &\ \ d_k 100^k + \cdots + d_1 100 + d_0\\[.3em] \Rightarrow\ n\equiv\,\ \ f(\color{#c00}1)\ \ \equiv &\ \ d_k+\cdots +d_1 + d_0\!\!\pmod{99}\end{align}\quad$$

For much further discussion on "casting out" mod reduction and divisibility tests see this answer.

Bill Dubuque
  • 272,048
  • Thank you @Bill, that clears it up, I wasn't aware of casting out nines. One thing I'm still confused about is: what if we had a non-zero digit in the tens place? e.g. what if the sum $s$ had been $1099$, then wouldn't casting out nines have left us with $1000 \equiv (1 + 9 + 9) \mod 999 \equiv 19 \mod 999$ instead of $1000 \equiv 100 \mod 999$? – user51462 Aug 18 '23 at 12:06
  • I presume the final $\beta^n$ should be $\beta^n-1$ in the linked page. – copper.hat Aug 18 '23 at 16:35
  • @use $\bmod 999!:\ abcde!f = abc\cdot 1000 + de!f \equiv abc+de!f,, $ e.g. $123456\equiv 123+456\equiv 579\ \ $ – Bill Dubuque Aug 18 '23 at 16:41
  • @BillDubuque, thank you. – user51462 Aug 19 '23 at 04:27