# In what situations does the sample mean equal the population mean?

Let $\lbrace x_i,y_i \rbrace_{i=1}^{n}$ be a random sample. Let $\bar{X}$ and $\bar{Y}$ be the sample means.

I want to rewrite the statement

$$\sum_{i=1}^n x_i y_i - \bar{X}\bar{Y}$$ in terms of the standard error $S_{xy}$

My friend claims I can simply say

$$\frac{\sum_{i=1}^n x_i y_i}{n} = \Bbb E[XY]$$ and that

$$\Bbb E [XY] - \bar{X}\bar{Y} = S_{xy}$$

I don't follow why this should be true in general. But I can't explain why.

## My Question

Does the sample mean equal the population mean in general and if so why? How does this relate to the variance?

• If the random variables have a continuous distribution, then the answer is never. With something like the binomial distribution, there's a small chance for equality only if $pn$ is an integer. – Alex R. Apr 18 '16 at 18:56
• Your friends argument is correct if you interpret the expectation $\mathbb E$ as being relative to the empirical distribution of the data. In that case, it is trivially true that $\mathbb E X = \bar X$ for example. – guy Apr 17 '19 at 15:01