4.2 General Formulas

This section covers the formulas for calculating the expectation of a random variable, variance of a random variable, and the covariance between two random variables. The expectation of the random variable, if it exists, is the mean for that random variable. The formulas in this section are especially helpful to understand for people interested in courses concerning finance and investing.

General case

_ _
E (X ) = μx

             [          ]
V ar(X ) = E  (X - μx )2 =  σ2x

Cov (X, Y ) = E [(X - μx )(Y - μy)] = σxy

Discrete case

_ _
         ∑
E (X ) =    p x  = μ
              ii    x
(4.1)

          ∑              2     2
Var (X  ) =    pi[(xi - μx) ] = σx

             ∑
Cov (X, Y ) =    pi[(xi - μx)(yi - μy)] = σxy

where pi is the probability of outcome i and xi is the outcome. Example i, could refer to recession, stable economy, expanding economy. The pi could be the given probabilities of each and xi could be the profit/loss of a mutual fund given the situation. Note: ipi = 1.

Continuous case

_ _
         ∫ ∞
E (X ) =     xf (x)dx = μ
          -∞

           ∫ ∞                    ∫ ∞
V ar(X ) =      (x - μ)2f(x)dx =      x2f (x)dx - μ2 = σ2
            - ∞                    -∞

             ∫ ∞  ∫ ∞
Cov (X,Y ) =          (x - μx )(y - μy )f(x,y)dxdy =  σxy
              - ∞  -∞

The following subsections will cover only the discrete case for a deeper understanding of the latter formulas presented. For discrete random variables summation is required to solve for expectation, variance and covariance. For continuous random variables integration is required, which is beyond the scope of this text.