Q:

Simple question about variance

I always thought I understood the concept of variance, but this one confuses me.
$
\begin{eqnarray}
X & := & (1, 2, 3)\\
E(X) & = & (1 + 2 + 3) / 3 = 2\\
Var(X) & = & Cov(X, X) = E((X - E(X))^2)\\
& = & E((-1, 0, 1)^2)\\
& = & E(1,0,1)\\
& = & 2/3
\end{eqnarray}
$
But R tells me that
> var(c(1,2,3))
[1] 1

Which part of my calculation is wrong?

A:

In the details of ?var we find:

The denominator n - 1 is used which gives an unbiased estimator of the
  (co)variance for i.i.d. observations.

so you should have $2/2=1$ instead. See here for some more details.

