I am working over $F_5$ and $f(x)=x^2+1$
I am told that $f(1)=-2$.
I understand that $-2=3$mod$5$
Why can we not leave it as $f(1)=1^2+2=3$?
Because $3$ mod $5$ $=3$ so why do we have to "change" $3$ to $-2$?
I am working over $F_5$ and $f(x)=x^2+1$
I am told that $f(1)=-2$.
I understand that $-2=3$mod$5$
Why can we not leave it as $f(1)=1^2+2=3$?
Because $3$ mod $5$ $=3$ so why do we have to "change" $3$ to $-2$?
Copyright © 2021 JogjaFile Inc.
Both -2 and 3 are correct. You can also even say that 8 is correct, because $8 = f(1) \mod{5}$. However, that is unusual.
Many authors apply one convention for writing modular residues, to ensure consistency. To prevent confusion, one should not use both $-2\mod{5}$ and $3\mod{5}$ in the same context/report/paragraph, unless clearly stated. Common choices are using the number ranges $[0,n)$ or $(-\frac{1}{2}n, \frac{1}{2}n]$ when computing $\mod{n}$.
No choice is perfect, but there are reasons to choose one representation over another. Computing the square of a small number is often easier than the square of a large number, so that may be a reason of using $(-\frac{1}{2}n, \frac{1}{2}n]$ over $[0,n)$. If you do not like negative numbers for any reason, you can use $[0,n)$. In my experience, computer scientists tend to use $[0,n)$ over $(-\frac{1}{2}n, \frac{1}{2}n]$, and mathematicians don't seem to care.
Based on the remark made, I think the author of your article prefers to use the representation of $(-\frac{1}{2}n, \frac{1}{2}n]$ over the $[0,n)$.