# Thread: Modular Arithmetic- Quick question

1. ## Modular Arithmetic- Quick question

Hello

I've been having difficulty with understanding a concept within modular arithmetic

The question I have been stuck on for a while now is:

Given 5x = -2(mod 8)

find x^2(mod 8)

My attempt at a solution:

5x = -2(mod 8)'
25x^2 = 4 (mod 8)
x^2 = 4 (mod 8), as 25 = 4 (mod 8)

The answer at the back says 1, and I'm not sure where I went wrong

2. Originally Posted by Wandering
Hello

I've been having difficulty with understanding a concept within modular arithmetic

The question I have been stuck on for a while now is:
i can't find a mistake. for example x=6 satisfies 5x=-2(mod 8) and 6^2=4(mod 8)
Given 5x = -2(mod 8)

find x^2(mod 8)

My attempt at a solution:

5x = -2(mod 8)'
25x^2 = 4 (mod 8)
x^2 = 4 (mod 8), as 25 = 4 (mod 8)

The answer at the back says 1, and I'm not sure where I went wrong

i can't find a mistake. for example x=6 satisfies 5x=-2(mod 8) and 6^2=4(mod 8)

3. So the answer at the back must be wrong?

Thanks a lot

4. Originally Posted by Wandering
Hello

I've been having difficulty with understanding a concept within modular arithmetic

The question I have been stuck on for a while now is:

Given 5x = -2(mod 8)

find x^2(mod 8)

My attempt at a solution:

5x = -2(mod 8)'
25x^2 = 4 (mod 8)
x^2 = 4 (mod 8), as 25 = 4 (mod 8)

The answer at the back says 1, and I'm not sure where I went wrong

I too agree with your answer, nice going!

One little thing which I'm presuming is a typo since you got the correct answer. You wrote 25 = 4 (mod 8). In actuality 25 = 1 (mod 8).

-Dan

5. Hello, Wandering!

Sometimes early squaring can introduce extraneous roots.
So I solved it head-on.

$\text{Given: }\:5x\:\equiv\:\text{-}2\text{ (mod 8)}$

. . $\text{Find: }\:x^2\text{ (mod 8)}$

$\text{We are given: }\:5x\:\equiv\:\text{-}2\text{ (mod 8)}$

$\text{Multiply by 5: }\; 25x\:\equiv\:\text{-}10\text{ (mod 8)}$

$\text{Since }\:25\,\equiv 1\text{ (mod 8)}\:\text{ and }\:\text{-}10 \,\equiv\,6\text{ (mod 8)}$

. . $\text{we have: }\:x\:\equiv\:6\text{ (mod 8)}$

$\text{Therefore: }\:x^2 \:\equiv\:36 \:\equiv\:4 \text{ (mod 8)}$

You are correct . . . Good work!