# Solving equation in finite field

1. Nov 8, 2006

### twoflower

Hi all,

I encountered a problem I don't know how to solve: In $\mathbb{Z}_{21}$, I want to find numbers x such that $x^2 = x$.

I don't know what to do with that, I just wrote that (since 21 divides $x^2 - x$)

$$21y = x^2 - x$$

for some integer y, but it didn't seem to help me much.

And I have one more (probably trivial, but I can't find it nowhere) question regarding $Z_{n}$: These fields consist of elements $\{0, 1, ... , n - 1\}$. But what if I am given something like -7 or $\frac{2}{5}$, how should I represent it in this field?

Thank you.

2. Nov 8, 2006

### Hurkyl

Staff Emeritus
Z_21 isn't a finite field. If it was, solving this problem would be trivial. (You'd do exactly the same thing you did in your precalculus classes)

But you can factor Z_21 into the product of two finite fields...

-7 should be easy. (Remember that Z_n is just working modulo n)

As for 2/5, that would simply require solving the equation 5x = 2. The extended Euclidean algorithm will be useful here. (run it on (5, n))

Last edited: Nov 8, 2006
3. Nov 8, 2006

### mathwonk

solve it as usual, i.e. x(x-1) = 0, so either x = 0, or x-1 = 0, or x(x-1) is a multiple of 3(7). e.g. x=7 works.

but as i noticed on my midterm in college when i had not studied this topic, it aint too hard to find all solutions of a problem when there are only 21 possible solutions. i.e. try them all.

4. Nov 8, 2006

### Hurkyl

Staff Emeritus
Hey, wait a minute! I thought x² - x = (x - 15)(x - 7)!

(Yes, I know both are true. I just thought it would be fun to say it that way. )