Skip to main content
Physics LibreTexts

11.3.1: Mean and Variance

  • Page ID
    56871
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Suppose you have a set of values \(a_{j}\). By saying that this is a set, we mean that we have several values \(a_{1}\), \(a_{2}\), \(a_{3}\), and so forth. The notation \(a_{j}\), in this context, means that \(j\) can be replaced by any integer between 1 and the total number of values that you have in order to refer to that specific value. Suppose that we have \(N\) total values. The average of all of our values can be written as:

    \[\langle a\rangle=\frac{1}{N} \sum_{j} a_{j}\tag{11.10}\]

    The letter \(\Sigma\) is the capital Greek letter “sigma”. This notation means that you sum together all of the values of \(a_{j}\) that you have. For instance, suppose you had just four values, \(a_{1}, a_{2}, a_{3}\), and \(a_{4}\), then:

    \[\sum_{j} a_{j}=a_{1}+a_{2}+a_{3}+a_{4}\tag{11.11}\]

    Therefore, the mean (or average) value of \(a\) in this context is:

    \[\langle a\rangle=\frac{1}{N} \sum_{j} a_{j}=\frac{1}{N}\left(a_{1}+a_{2}+a_{3}+a_{4}\right)\tag{11.12}\]

    To quantify the uncertainty on a set of values, we want to say something about how far, on average, a given value is from the mean of all the values. Thus, it’s tempting to try to define the uncertainty as follows:

    \[\frac{1}{N} \sum_{j}\left(a_{j}-\langle a\rangle\right)\tag{11.13}\]

    Remember that addition is commutative. Realizing that the \(\sum\) symbol just indicates a sum, i.e. a whole lot of addition, we can rewrite this as:

    \[\frac{1}{N}\left(\sum_{j} a_{j}-\sum_{j}\langle a\rangle\right)\tag{11.14}\]

    The second term in the subtraction is a sum over \(j\) of the average value. The average value doesn’t depend on which \(a_{j}\) we’re talking about; it’s a constant, it’s the same for all of them. Therefore, the sum of that number \(N\) times is just going to be equal to \(N\langle a\rangle\). Making this substitution and distributing the 1/\(N\) into the parentheses:

    \[\frac{1}{N} \sum_{j} a_{j}-\frac{1}{N} N\langle a\rangle\tag{11.15}\]

    But we recognize the first term in this subtraction as just \(\langle a\rangle\). So, the total result of this is zero. Clearly, this is not a good expression for the uncertainty in \(a\). If you think about it, the average deviation of \(a_{j}\) from \(\langle a\rangle\) ought to be zero. If \(\langle a\rangle\) is the average value of \(a\), then \(a_{j}\) should be below \(\langle a\rangle\) about as often as it is above, so your sum will have a mix of positive and negative terms. The very definition of the average insures that this sum will be zero.

    Instead, we shall define the variance as:

    \[\Delta a^{2}=\frac{1}{N} \sum_{j}\left(a_{j}-\langle a\rangle\right)^{2}\tag{11.16}\]

    Here, we’re using \(\Delta a\) to indicate the uncertainty in \(a\). The variance is defined as the uncertainty squared.1 The advantage of this expression is that because we’re squaring the difference between each value \(a_{j}\) and the average value, we’re always going to be summing together positive terms; there will be no negative terms to cancel out the positive terms. Therefore, this should be a reasonable estimate of how far, typically, the measurements \(a_{j}\) are from their average.

    We can unpack this sum a bit, first by multiplying out the squared polynomial:

    \[\Delta^{2}=\frac{1}{N} \sum_{j}\left(a_{j}^{2}-2\langle a\rangle a_{j}+\langle a\rangle^{2}\right)\tag{11.17}\]

    In order to clean this expression up, inside the parentheses both add and subtract \(\langle a\rangle^{2}\):

    \[\begin{aligned}
    \Delta a^{2} &=\frac{1}{N} \sum_{j}\left(a_{j}^{2}-2\langle a\rangle a_{j}+2\langle a\rangle^{2}-\langle a\rangle^{2}\right) \\
    &=\frac{1}{N} \sum_{j}\left(a_{j}^{2}-\langle a\rangle^{2}+2\langle a\rangle\left(\langle a\rangle-a_{j}\right)\right) \\
    &=\frac{1}{N} \sum_{j} a_{j}^{2}-\frac{1}{N} \sum_{j}\langle a\rangle^{2}+\frac{1}{N} 2\langle a\rangle \sum_{j}\left(\langle a\rangle-a_{j}\right)
    \end{aligned}\tag{11.18}\]

    Notice that the last term is going to be zero, as it includes the average difference between the mean and each observation. The second term is just going to be \(\langle a\rangle^{2}\), because once again \(\langle a\rangle\) is the same for all terms of the sum; the sum will yield \(N\langle a\rangle^{2}\), canceling the \(N\) in the denominator. So, we have:

    \[\Delta a^{2}=\left\langle a^{2}\right\rangle-\langle a\rangle^{2}\tag{11.19}\]


    1If you know statistics, you may recognizing this as being very similar to how variance is defined there— only in statistics, we divide by \(N −1\) rather than by \(N\). The difference becomes unimportant as \(N\) gets large.


    This page titled 11.3.1: Mean and Variance is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Pieter Kok via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.