# The number of elements which are squares in a finite field.

Meanwhile reading some introductory notes about the projective special linear group $PSL(2,q)$ wherein $q$ is the cardinal number of the field; I saw:

....in a finite field of order $q$, the number of elements ($≠0$) which are squares is $q-1$ if $q$ is even number and is $\frac{1}{2}(q-1)$ if $q$ is a odd number..." .

I can see it through $\mathbb Z_5$ or $GF(2)$. Any hints for proving above fact? Thanks.

-
Shouldn't that be "the number of non-zero elements that are squares..."? Because, for example, in $\mathbb{Z}/11\mathbb{Z}\,$ we have $\,6=\frac{1}{2}(11+1)\,$ squares. –  DonAntonio May 30 '12 at 11:25
@DonAntonio: Oh Yes. I ll edit it. Thanks Don. –  B.S. May 30 '12 at 11:27
Nice question posed a while ago!+ –  amWhy Mar 3 at 0:09

Let $F^*$ be the multiplicative group of the field $F$. Find the kernel of the squaring homomorphism $f: F^* \to F^*$, $f(x) = x^2$. Use that to find the order of the image $f(F^*)$.

-
As you noted we have $Ker(f)={+1,-1}$ or $Ker(f)={+1}$. Thanks. –  B.S. May 30 '12 at 11:35

The multiplicative group of a finite field is cyclic.

-
That will do it, but what if one is not familiar with that result? –  Gerry Myerson May 30 '12 at 11:23
@Gerry, Dustan's answer is the most elementary way, but mine works for other powers, not just squares. –  lhf May 30 '12 at 11:31

If our field is of order $2^k$, then the map $x \mapsto x^2$ is injective and thus bijective since the field is finite. Therefore every element is a square.

When the field has odd order, consider the equivalence relation on the nonzero elements defined by $x \sim y \Leftrightarrow x^2 = y^2$. The number of nonzero squares is the number of equivalence classes of this relation. Each equivalence class contains exactly two elements, so half of the nonzero elements are squares.

Intuitively, in the list of squares of nonzero elements

$$a_1^2,\ a_2^2,\ a_3^2,\ \ldots$$

we get repetitions when $a_i^2 = a_j^2 \Leftrightarrow a_i = a_j$ or $a_i = -a_j$. Since $a_i \neq -a_i$ for each $a_i$, rearranging and relabeling the list gives

$$b_1^2, (-b_1)^2, b_2^2, (-b_2)^2, b_3^2, (-b_3)^2, \ldots$$

where $b_i \neq \pm b_j$. Again, the number of different elements in this list is half the number of nonzero elements.

-
Another way to prove it, way less elegant than Dustan's but perhaps slightly more elementary: let $$a_1,a_2,...,a_{q-1}$$ be the non zero residues modulo $\,q\,,\,q$ an odd prime . Observe that $\,\,\forall\,i\,,\,\,a_i^2=(q-a_i)^2 \pmod q\,$ , so that all the quadratic residues must be among $$a_1^2\,,\,a_2^2\,,...,a_m^2\,\,,\,m:=\frac{q-1}{2}$$
Note that $\,\,\forall\,1\leq i,j\leq m\,:$$a_i+a_j=0\Longrightarrow a_i=-a_j=q-a_i\Longrightarrow$$$$\Longrightarrow a_i-a_j=q=0$$ Both left most equalities above would lead us to$\,a_i=a_j=0\,$, which is absurd. Finally, we prove that not two of the above$\,\,(q-1)/2\,\,$elements are equal. The following's done modulo$\,q$:$$a_i^2=a_j^2\Longrightarrow (a_i-a_j)(a_i+a_j)=0\Longrightarrow a_i-a_j=0$$since we already showed that$\,\,a_i+a_j\neq 0$- This works, when$q$is a prime number, but how does this help, when$F$is not a prime field? Say, when$F=GF(9)=F_3[x]/\langle x^2+1\rangle$? – Jyrki Lahtonen May 30 '12 at 12:06 Indeed it doesn't except when$q\$ is a prime. Didn't notice before it could be a power of a prime. I'll edit my answer. Thanx. –  DonAntonio May 30 '12 at 12:18