# Mod Operator Question

#### JJ16

It's been years since I've done math and this one (which I imagine is so simple) is doing my head. Looking for a basic simple explanation of why is T or F. Much appreciated any help!

If a ≡ x1 (mod m) and b ≡ y1 (mod m), then we will have ab ≡ x1y1 (mod m). True or False?

#### romsek

Math Team
$a= km+x_1,~k \in \mathbb{Z}$
$b=j m + y_1,~j \in \mathbb{Z}$

$a b = (k m + x_1)(j m + y_1) = \\ j k m^2 + (x_1 j + y_1 k)m + x_1 y_1$

$a b \pmod{m} = x_1y_1$

topsquark

#### JJ16

All hieroglyphics to me, but thank you!

#### romsek

Math Team
$a \equiv x_1 \pmod{m}$ means that there is some integer $k$ such that $a = k \cdot m + x_1$

same with $b\equiv y_1 \pmod{m}$

so this means for some integers $j$ and $k$

$a = k m + x_1\\ b = j m + y_1$

now multiply

$ab = (km + x_1)(j m + y_1) = j k m^2 + (j x_1 + k y_1)m + x_1 y_1$

Now we mod this all with $m$

$jkm^2 \pmod{m} = 0\\ (j x_1 + k y_1) m \pmod m = 0$

and we're left with

$ab \pmod{m} = x_1 y_1 \pmod {m}$

Is that any clearer?

#### JJ16

Perfect, much appreciated!