Jump to content

High School Mathematics Extensions/Further Modular Arithmetic/Project/Finding the Square Root

From Wikibooks, open books for an open world
HSME
Content
Further Modular Arithmetic
Multiplicative Group and Discrete Log
Problems & Projects
Problem Set
Project
Solutions
Exercises Solutions
Problem Set Solutions
Misc.
Definition Sheet
Full Version
PDF Version


*Finding the square root*

[edit | edit source]

Legendre Symbol

[edit | edit source]

.. to be expanded There is actually a simple way to determine whether a is square

Let g be a generator of G where G is the multiplicative group mod p. Since all the squares form a group therefore, if a is a square, then

ap−12≡1

and if a is not a square then

ap−12≡−1

we shall use these facts in the next section. .. to be expanded

*Finding the square root*

[edit | edit source]

We aim to describe a way to find a square root in mod m. Let's start with the simplest case, where p is prime. In fact, for square root finding, the simplest case also happens to be the hardest.

If p ≡ 3 (mod 4) then it is easy to find a square root. Just note that if a has a square root then

(ap+14)2≡ap+12≡ap−12a≡a

So let us consider primes equivalent to 1 mod 4. Suppose we can find the square root of a mod p, and let

x02≡a(modp)

With the above information, we can find the square of a mod p2. We let

x=x0+x1p

we want x2 ≡ a (mod p2), so

x2=x02+2x0x1p+x12p2
x2=a+kp+2x0x1p(modp2)

for some k as x02≡a(modp) so x02=a+kp, we see that

x2=a+p(k+2x0x1)(modp2)

so if we need to find x1 such that k+2x0x1≡0(modp), we simply need to make x1 the subject

x1≡−k(2x0)−1(modp).

..generalisation ..example

..method for finding a sqr root mod p