---
title: "variance"
type: concept
related: [Variance, Expectation]
source: https://www.jemoka.com/posts/kbhvariance/
confidence: high
status: active
---

variance (also known as second central moment) is a way of measuring spread:
\begin{align} Var(X) &amp;= E[(X-E(X))^{2}] \\ &amp;= E[X^{2}] - (E[X])^{2} \\ &amp;= \qty(\sum_{x}^{} x^{2} p\qty(X=x)) - (E[X])^{2} \end{align}
&ldquo;on average, how far is the probability of \(X\) from its expectation&rdquo;
The expression(s) are derived below. Recall that standard deviation is a square root of the variance.
computing variance: \begin{align} Var(X) &amp;= E[(X - \mu)^{2}] \\ &amp;= \sum_{x}^{} (x-\mu)^{2} p(X) \end{align}
based on the law of the Unconscious statistician. And then, we do algebra:
So, for any random variable \(X\), we say:
\begin{align} Var(X) &amp;= E[X^{2}] - (E[X])^{2} \\ &amp;= \qty(\sum_{x}^{} x^{2} p(X=x)) - (E[X])^{2} \end{align}
based on the law of Unconscious statistician.
Sum of Variance \begin{equation} Var(X + Y)=Var(X)+Var(Y)+2Cov(X+Y). \end{equation}
\begin{equation} Var\qty(\sum_{j}^{} X_{j}) = \sum_{i}^{} \sum_{j}^{} Cov\qty(X_{i}, X_{j}) \end{equation}
