6. In the process of measuring a certain physical quantity, due to the errors of the instrument and observation, $n$ measurements yield $a_{1}, a_{2}, \cdots, a_{n}$, a total of $n$ data points. The "best approximate value" $a$ of the measured physical quantity is defined as a quantity such that, compared with other approximate values, the sum of the squares of the differences between $a$ and each data point is the smallest. According to this definition, the $a$ derived from $a_{1}, a_{2}, \cdots, a_{n}$ is equal to ( 1).
A. $\sqrt[n]{a_{1} a_{2} \cdots a_{n}}$
B. $\frac{a_{1}+a_{n}}{2}$
C. $\frac{1}{n}\left(a_{1}+a_{2}+\cdots+a_{n}\right)$
D. $\frac{1}{2} a_{n}$
6. C.
$$
\begin{array}{l}
\quad y=\left(a-a_{1}\right)^{2}+\left(a-a_{1}\right)^{2}+\cdots+\left(a-a_{n}\right)^{2}=n a^{2}-2\left(a_{1}+a_{n}+\cdots+a_{n}\right) a+\left(a_{1}^{2}+ \\
\left.a_{2}^{2}+\cdots+a_{n}^{2}\right) .
\end{array}
$$