One difference worth noting is that \(\Var(X)\text{,}\) as the average of squared values, must always be nonnegative. The expression \((X - \mu_X)(X - \mu_X)\) can be negative for combinations of \(X\) and \(Y\) values where one is greater than its average and the other is smaller. If this is the average behavior, then \(\Cov(X, Y)\) can be negative overall. This is useful information: a negative \(\Cov(X, Y)\) would imply that (on average, not necessarily always) when \(X\) is larger than typical, \(Y\) is smaller than typical, and vice versa.
Also as with variance, the covariance definition formula gives us some useful insight, but it can be unwieldy to work with. There is an alternative formula, analogous to TheoremΒ 3.2.2:
To make use of this formula, itβs helpful to have both a joint distribution and marginal distributions. The marginal distributions let you find \(\E(X)\) and \(\E(Y)\text{.}\) The joint distribution lets you find \(\E(XY)\text{.}\)
Since theyβre indicator random variables, we can immediately see that \(\E(X) = 0.6\) and \(\E(Y) = 0.7\) (see ExampleΒ 3.1.5). For \(\E(XY)\text{,}\) weβll traverse cell by cell through the joint distribution table, constructing products of the form \(X\)-value times \(Y\)-value times probability:
Suppose we roll a fair, 4-sided die two times. Let \(X\) be the sum of the rolls, and let \(Y\) be the product of the rolls. Find the covariance of \(X\) and \(Y\text{.}\)