# Calculating number of lines and planes in affine space over finite field

Consider a finite field $F_p$ with $p$ elements; how would one calculate the number of lines and the number of planes in the affine space $F^3_p$?

If one knew the number of lines through a particular point, the number of planes could then be calculated by multiplying the number of lines through the origin by the number of points on any line.

-
There are $p$ points on every line. The lines through can go through every other point, and two distinct ones have only that point in common, so there are $$\frac{p^{3} - 1}{p-1} = 1 + p + p^{2}$$ lines through a point.
If you count the number of lines as $$\text{number of points} \cdot \text{number of lines through each point} = p^{3} \cdot (1 + p + p^{2}),$$ then you are counting each line $p$ times, one for each of its points, so the number of lines is $$p^{2} \cdot (1 + p + p^{2}).$$