# Modular arithmetic

• February 28th 2010, 09:03 AM
integral
Modular arithmetic
$\textrm{I\; am\; trying\; to\; learn\; modular\; arithmetic,\; and\; this\; right \; here\; stumped\; me.}$
$
10\cdot(-13)+27\cdot 6\equiv-122\mathrm{mod}2$

$

\textrm{I\; thought\; It\; would\; go\; like\; this:}$

$10\cdot(-13)+27\cdot 6\; \; \; \textrm{Can be reduced to in mod}2$
$0\cdot(1)+1\cdot 0=0\mathrm{mod}2$

$\textrm{Please explain this to me someone}$
• February 28th 2010, 10:45 AM
Bacterius
Hi Integral,

Suppose you have :
$10 \times (-13) + 27 \times 6$

This can be written as :

$(2 \times 5 + 0) \times (2 \times (-6) + 1) + (2 \times 13 + 1) \times (2 \times 3 + 0)$

Note that modulo two, adding two doesn't change the residue, and multiplying by two makes the residue zero. So this simplifies to :

$0 \times 1 + 1 \times 0$ (mod 2)

And therefore the whole expression is equivalent to zero modulo 2 (it is even). These are just modular arithmetic theorems that need to be learnt (that adding the modulus to terms doesn't change anything, multiplying by the modulus makes the term zero, that the residue of a sum of terms is the same as the sum of the residues of each term, ... then you got the powers and Fermat's/Euler's Theorem ...)

:)