After 4 years I faced this exercise again and I found that first exercise is not solved properly. First part is ok and $\left|\mathbb{F}_p^n\right|=p^n$. Second part is wrong. Number of solutions is not equal $p^n-n$.
My new solution:
Let's begin on count how many solution has this equation:
$$
a_1x_1+a_2x_2=0\;\;\;\;\;\; a_i,x_i\in\mathbb{F}_p
$$
Let's assume that $a_1\not =0$ (For $a_2$ result will be the same). Let's assign any value for $x_2$ (we have $p$ possibilities). Then $a_2x_2'=r$ ($x_2'$ is assigned value). $\mathbb{F}_p$ is a field, so $r$ has additive inverse element $-r$.
$$a_1x_1=-r$$
Basing on the same reason (and $a_1\not=0)$ $a_1$ has multiplicative inverse element $a_1^{-1}$, so we have solution.
$$
x_1=-ra_1^{-1}$$
We have $p$ solutions for this equation.
Let's start with general solution right now.
$$
a_1x_1+a_2x_2+a_3x_3+\cdots+a_nx_n=0$$
Let's assume that $a_1\not =0$ (We could did it for any $a_i$) and let's assign any values for $x_2,x_3,x_4,\cdots x_n$ (We have $p^{n-1}$ possibilities). Then let's evaluate this expression. Result:
$$
a_1x_1+k=0\;\;\;\;\;\;k=a_2x_2'+a_3x_3'+\cdots+a_nx_n'
$$
Where $x_i'$ is assigned value. This equation has only one solution, so general equation has $p^{n-1}$ solutions, not $p^n-n$.
Is there any other way to find this value? On is my solution OK?
Thanks
Thanks @ancientmathematician I tried with rank-nullity theorem. Here is my result:
$A$ is linear transformation $A:\mathbb{F}_p^n\rightarrow\mathbb{F}_p$.
$$
A(x)=\sum_{i=1}^na_ix_i
$$
Domain of $A$ is whole $\mathbb{F}_p^n$, so
$$
\mathrm{dom}{A}=\mathbb{F}_p^n\;\Rightarrow\; \mathrm{dim}\,\mathrm{dom}{A}=n
$$
Image of $A$ is whole $\mathbb{F}_p$, so
$$
\mathrm{im}{A}=\mathbb{F}_p\;\Rightarrow\; \mathrm{dim}\,\mathrm{im}{A}=1
$$
From rank-nullity theorem
$$
\mathrm{dim}\,\mathrm{dom}{A}=\mathrm{dim}\,\mathrm{ker}{A}+\mathrm{dim}\,\mathrm{im}{A}
$$
i can figure out value of kernel dimension
$$
n=\mathrm{dim}\,\mathrm{ker}{A}+1\Rightarrow\mathrm{dim}\,\mathrm{ker}{A}=n-1
$$
Kernel of transformation is set of vectors which value is 0. So i understand i'm looking for $|\mathrm{ker}{A}|$. I'm not sure how to find amount of elements in kernel. Here is my try:
I know dimension of kernel and I know that kernel is linear space, so base of this set has $n-1$ elements. I can take any base so i'll take 'default'
$$
(1,0,0,\cdots,0)\;(0,1,0,\cdots,0)\;(0,0,1,\cdots,0)\cdots(0,0,0,\cdots,1)
$$
All vectors has $n-1$ coordinates. I can generate $p^{n-1}$ vectors basing on this set, so equation from begging of exercise has $p^{n-1}$ solutions.
Is that correct?