Modular Arithmetic – How to Find the Square Root

modular arithmetic

Okay so I am in college and in the notes it shows this example:

//
Example: Compute the square root of 3 modulo 143

3 modulo 143 = 3 mod (11*13)

Then he jumps to this:

√3 (mod 11) = ± 5

√3 (mod 13) = ± 4

Using the Chinese Remainder Theorem, we can calculate the four square roots as 82,
126, 17 and 61.

//

The lecturer never makes anything clear even though it is our first encounter with module arithmetic. I don't know were the 4 or the 5 come from or the √3 . Can anyone explain to be how he got

√3 (mod 11) = ± 5

√3 (mod 13) = ± 4

And also how does he use this information in conjunction with the Chinese Remainder Theorem arrive at the square roots. I would really appreciate if anyone could help me out here

Best Answer

There are actually several different concepts here, so I'll try to address all of them. I'll get to the modular arithmetic in just a moment, but first a review:

SQUARE ROOTS

We should know that 25 has two square roots in ordinary arithmetic: 5 and -5.

MODULAR ARITHMETIC SQUARE ROOTS

IF the square root exists, there are 2 of them modulo a prime. To continue our example, 25 has the two square roots 5 and -5.

We can check this:

$$(-5)^2 = 25 \equiv 3\bmod 11$$ $$(5)^2 = 25 \equiv 3\bmod 11$$

To find the square roots sometimes takes a bit of trial and error. Often you have to go through each value $v$ and square it (to get $v^2$) to check if it's equivalent to $n \bmod p$, where $n$ is the number whose square root you want to find.

MULTIPLE PRIMES

Again, if a square root exists, there are two square roots modulo each prime. So if we are using multiple primes, there can be more square roots. For example, with two primes, there are 2 square roots modulo the first prime and two square roots modulo the second prime. This gives us $2 \cdot 2 = 4$ square roots.

In general, if we can find a square root modulo each prime, there are a total of $2^n$ square roots modulo $n$ primes.

RETURNING TO YOUR EXAMPLE

We can first calculate 3 modulo 11 and 13:

$$3 \equiv 3 (\bmod 11)$$ $$3 \equiv 3 (\bmod 13)$$

So, modulo 11, we are looking to find a number that, when squared, is equivalent to 3. If we find one, we know that there will be another. So we check the numbers: $1^2 \equiv 1$, $2^2 \equiv 4$, $3^2 \equiv 9, \dots$ and find that

$$5^2 = 25 \equiv 3 (\bmod 11)$$

...so we know that there will also be another square root modulo 11. Continuing on our quest, we check

$$6^2 = 36 \equiv 3 (\bmod 11)$$

...so we've found the square roots modulo 11. We then continue this modulo 13 to find that:

$$4^2 = 16 \equiv 3 (\bmod 13)$$ $$9^2 = 81 \equiv 3 (\bmod 13)$$

So we know that our square root is either 5 or 6 modulo 11, and either 4 or 9 modulo 13. This gives us 4 possibilities. We can then find that:

$$82 \equiv 5 (\bmod 11), 82 \equiv 4 (\bmod 13)$$ $$126 \equiv 5 (\bmod 11), 126 \equiv 9 (\bmod 13)$$ $$17 \equiv 6 (\bmod 11), 17 \equiv 4 (\bmod 13)$$ $$61 \equiv 6 (\bmod 11), 61 \equiv 9 (\bmod 13)$$