# Find the actual codeword

Let $C$ be a reed solomon code with length $6$, dimension $2$ and distance $5$. Suppose that we are over $\mathbb{F}_7$ and we have the genrator polynomial $g(x)=(x- \alpha)(x- \alpha^2) (x- \alpha^3) (x- \alpha^4)$, where $\alpha=3 \in \mathbb{F}_7$. We get the word $r(x)=x^5+6x+4$ and we want to find the word that was sent.

I found the syndrome:$S(z)=2z^4+4z^3+6z^2+6z$.

We are looking for the error locator polynomial, that is defined as follows:

$$\sigma(z):= \prod_{j=0}^{l-1} (1- \alpha^{i_j} z)$$

for $e(x)=x^{i_0}+ x^{i_1}+ \dots+ x^{i_{l-1}}$.

The degree of $\sigma(z)$ is equal to the number of errors that are done.

The code can correct till $\lfloor \frac{d-1}{2}\rfloor=2$ errors.

So $\sigma(z)=(1- \alpha^j z)(1- \alpha^k z)$.

It holds that $z^5=(2^4+4z^3+6z^2+6z)(4z+6)+(z^3+3z^2-z) \Rightarrow z^3+3z^2-z=(1-4 z) S(z) \mod{z^5}$.

So $w(z)=z^3+3z^2-z$ and $\sigma(z)=1-4z$, where $w(z)= \sum_{i \in E} e_i \alpha^i \prod_{j \in E \setminus{\{ i\}}}(1- \alpha^j z)$.

$E=\{0 \leq i \leq n-1 | e_i \neq 0 \}$.

Since we have found that $\sigma(z)=1-4 z$,it means that there is one error.

But then $w(z)$ is of the form $e_j \alpha^j z$.

But I have found that $w(z)=z^3+3z^2-z$.

What have I done wrong?