1

I would like to know how to solve $x^2 \equiv [1]\text{ in }\Bbb Z_5$?

How to solve this kind of equation in general?

Jyrki Lahtonen
  • 133,153
torr
  • 435
  • 1
    I mean, $x^2-1=(x-1)(x+1)$ and all nonzero elements of $\Bbb Z_5$ are invertible. Every time $n$ is a prime, you just get that $x\equiv [1]$ and $x\equiv [n-1]$ are the only solutions. – Adam Hughes Dec 04 '14 at 18:13
  • If it is quadratic equations you are interested in, then here is some discussion. – Jyrki Lahtonen Dec 04 '14 at 21:03

2 Answers2

2

There are five values for $x$: $[0],[1],[2],[3],[4]$.
Square them, and you get $[0],[1],[4],[9],[16]$, which are $[0],[1],[4],[4],[1]$.
You get $[1]$ twice, so the answers are $x=[1]$ and $x=[4]$.

For general $n$, $x^2=[1]$ means that $x^2-1$ is a multiple of $n$.
Ordinary algebra says that $x^2-1=(x-1)(x+1)$.
If $n$ is prime, then either $x-1$ is a multiple of $n$, so $x=[1]$ in $\mathbb{Z}_n$, or $x+1$ is a multiple of $n$, so $x=[n-1]$ in $\mathbb{Z}_n$.

There can be more solutions if $n$ is not prime, For example $n=8$, there are four solutions $x=[1],[3],[5],[7]$. Things are better behaved if $n$ is prime.

Empy2
  • 50,853
  • And in general? how would I proceed in $Z_n$ – torr Dec 04 '14 at 18:17
  • Just as AdamHughes showed you in his comment. If $x^{2} \equiv 1 \pmod{n}$, then $x^{2} - 1 \equiv 0 \pmod{n}$. So you factor and go from there. Note $1, n-1$ are coprime with $n$ always. So the discrete log problem is well-defined here. – ml0105 Dec 04 '14 at 18:20
0

Modulo $5$, the only possible remainders are $0,\pm1$ and $\pm2$. Squaring them, we have $0,1$ and $4$. In general, when working modulo $2n+1$, the remainders are $0,\pm1,\pm2,\ldots,\pm n$. This is especially useful when dealing with even powers. Hope this helps.

Lucian
  • 48,334
  • 2
  • 83
  • 154
  • What do you mean with "In general, when working modulo $2n+1$, the remainders are $0,\pm1,\pm2,\ldots,\pm n$."? – Bart Michels Dec 04 '14 at 19:47
  • @barto: For instance, modulo $7$, instead of saying $4,5,6$, it might be easier to speak of $-3,-2,-1$. Obviously, $7n+4=7(n+1)-3$, etc – Lucian Dec 04 '14 at 19:55