Modular Arithmetic & Congruence
State the formal definition of \(a \equiv b \pmod n\).
\(a \equiv b \pmod n\) if and only if \(n\) divides \((a - b)\), written as: \[n \mid (a - b)\] This is equivalent to saying \(a\) and \(b\) have the same remainder when divided by \(n\).
Calculate \(17 \pmod 5\) and \(-17 \pmod 5\).
True or False: If \(a \equiv b \pmod n\), then \(a^k \equiv b^k \pmod n\) for any positive integer \(k\).
True. Modular arithmetic is compatible with exponentiation. This property is fundamental for algorithms like RSA encryption.
Solve for \(x\): \(3x \equiv 1 \pmod 7\).
We are looking for the modular multiplicative inverse of 3 modulo 7. Testing values:
What is the set \(\mathbb{Z}_n\)?
\(\mathbb{Z}_n\) is the set of equivalence classes of integers modulo \(n\), usually represented by the remainders: \[\mathbb{Z}_n = \{0, 1, 2, \dots, n-1\}\]
Calculate \((45 + 38) \pmod{10}\) using modular properties.
\[(45 \pmod{10} + 38 \pmod{10}) \pmod{10}\]
\[(5 + 8) \pmod{10} = 13 \pmod{10} = \mathbf{3}\]
True or False: In \(\mathbb{Z}_n\), if \(ab \equiv 0 \pmod n\), then either \(a \equiv 0\) or \(b \equiv 0\).
False. This only holds if \(n\) is prime. Counterexample in \(\mathbb{Z}_6\): \(2 \times 3 = 6 \equiv 0 \pmod 6\), but neither \(2\) nor \(3\) is \(0 \pmod 6\). These are called zero divisors.
Evaluate \(2^{10} \pmod 3\).
Since \(2 \equiv -1 \pmod 3\): \[2^{10} \equiv (-1)^{10} \pmod 3\] \[(-1)^{10} = 1\] So, \(2^{10} \equiv 1 \pmod 3\).
How is the “clock” analogy used to explain modular arithmetic?
A clock is \(\mathbb{Z}_{12}\) (or \(\mathbb{Z}_{24}\)). When you add 5 hours to 10:00, you don’t get 15:00 in 12-hour time; you get \(15 \pmod{12} = 3:00\). The number line “wraps around” a circle of size \(n\).
Does \(2x \equiv 1 \pmod 4\) have a solution? Why or why not?
No. \(2x\) will always be even. Any number \(y \equiv 1 \pmod 4\) must be odd (of the form \(4k+1\)). An even number can never equal an odd number.
If today is Monday (Day 1), what day of the week will it be in 100 days? (Use \(\mathbb{Z}_7\) where Sunday=0).
Calculate \((1 + 100) \pmod 7\).
\(101 = (14 \times 7) + 3\).
\(101 \equiv 3 \pmod 7\).
Day 3 is Wednesday.
What is the remainder when \(10^{100}\) is divided by \(9\)?
\(10 \equiv 1 \pmod 9\). Therefore, \(10^{100} \equiv 1^{100} \pmod 9\). The remainder is 1.