Covariance is a measure of the joint variability of two random variables. Given two random variables and their covariance can be calculated as follows
the expected value can be exchanged with the mean of the variables if that's more appropriate.
Given two random variables and if the covariance between them is positive it signals that large 's tend to occur with large 's and conversely, if it's negative it signals that large 's tend to occur with small 's. When the covariance is exactly and are independent random variables.
Covariance of a Sample