Textbook
For $n\ge1$ numerical observations $x_1,\ldots,x_n$, the arithmetic mean is $\bar x=\frac1n\sum_{i=1}^{n}x_i$. Each observation has equal weight $1/n$; repeated values count as many times as they occur.
The bar denotes the mean of these particular data. Values 2, 4, and 6 have mean 4; observations 2, 2, and 4 have mean $8/3$. The repeated 2 is another observation, not a set duplicate to remove.
An expectation $\mathbb E[X]$ describes a specified distribution, whereas $\bar x$ describes an observed sample. If the source distribution gives 2, 4, and 6 with equal chances, its expectation is 4. Observing 2, 2, and 4 does not change that expectation, although the sample mean differs.
The mean is also the expectation of the empirical distribution assigning each observation weight $1/n$. This correspondence is useful, but the empirical distribution must not silently replace the unknown source distribution.
The mean lies between the smallest and largest observation. If every $x_i\ge m$, their sum is at least $nm$, giving $\bar x\ge m$; the upper bound follows similarly. The equivalent identity $\sum_i(x_i-\bar x)=0$ expresses balance: positive and negative deviations cancel around the mean. Adding the same number to every observation shifts the mean by that number without changing this balance.
Definitions and notation: Mathematics for Machine Learning.
Related concepts: Expected value: the mean of a distribution.
In plain language
The mean describes the length of three boards after their combined length is shared equally. Identical boards count separately because the calculation uses observations, not just distinct sizes. The resulting length may match none of the originals, but multiplying it by the board count recovers the total. This imaginary sawing preserves material rather than choosing a winner in a wooden beauty contest. The number describes the measured set without automatically revealing the whole warehouse.
Example
The constructed observations are 2, 2, and 4. Both repeated measurements contribute to the total and mean.
Arithmetic mean of observations
First observation
After the first measurement, the sum is 2.
Step 1 of 4: First observation
Read all steps
First observation
After the first measurement, the sum is 2.
- Observations
- 2current24
- Sum; count
- 21
The repeat counts
The second observation adds another 2; the count becomes 2.
- Observations
- 2included2current4
- Sum; count
- 42
Complete total
The third observation brings the total to 8 and the count to 3.
- Observations
- 2included2included4current
- Sum; count
- 83
Equal redistribution
Dividing 8 by 3 retains the repeated value.
- Mean
- 8/3included
For these three observations, $8/3$ lies between 2 and 4 as required, and three copies total exactly 8. Removing the repeated two would produce 3: a valid mean for a different collection containing only two observations. That mistake happens before division, when both the total and count silently change. The original measurements remain included even when their numerical values look identical.
The denominator is the number of observations, not the number of distinct values.