Covariance measures whether two random variables move together. Find the mean of the product and subtract the product of the means; divide by both standard deviations to get the correlation, a unit-free number between and .
| Step | On with | |
|---|---|---|
| 1 | Find both means from the margins. Add across rows and down columns to get the marginal pmfs, then take each weighted sum. | |
| 2 | Find the mean of the product. Multiply in every cell by that cell's probability and add. | |
| 3 | Subtract the product of the means. Positive: the variables tend to be large together. Negative: one large, the other small. | |
| 4 | Find both standard deviations. Use each margin as on the standard deviation page. | , so |
| 5 | Divide to get the correlation and check its range. The correlation always lies in ; outside means an error. |