MTH 260 · Probability and Statistics
Our notes
1 min readJoint distribution
For two discrete variables, p(x, y) = P(X = x and Y = y). Each row and column total gives a marginal distribution.
Example
X = number of tutorials attended (0 or 1), Y = grade points (2, 4):
| Y = 2 | Y = 4 | p_X(x) | |
|---|---|---|---|
| X = 0 | 0.3 | 0.1 | 0.4 |
| X = 1 | 0.2 | 0.4 | 0.6 |
| p_Y(y) | 0.5 | 0.5 | 1 |
Independent? p(0, 2) = 0.3 but p_X(0) p_Y(2) = 0.4 × 0.5 = 0.2. Not equal, so dependent.
For continuous variables, a joint pdf f(x, y) gives probabilities as volumes; marginals come from integrating out the other variable.
Covariance
Cov(X, Y) = E[(X − μ_X)(Y − μ_Y)] = E(XY) − E(X)E(Y).
In the table: E(X) = 0.6, E(Y) = 3, E(XY) = (1)(2)(0.2) + (1)(4)(0.4) = 2.0. Cov = 2.0 − 1.8 = 0.2 (positive: attending goes with higher grades).
Correlation coefficient
ρ = Cov(X, Y) / (σ_X σ_Y), always between −1 and 1.
- ρ = ±1: an exact straight-line relation.
- ρ = 0: no linear relation (there may still be a curved one).
- Independent ⇒ ρ = 0, but ρ = 0 does not prove independence.
Sample correlation
From data: r = Sxy / √(Sxx Syy), where Sxy = Σ(x − x̄)(y − ȳ).
Worked example
x: 1, 2, 3, 4, 5; y: 2, 4, 5, 4, 5. x̄ = 3, ȳ = 4.
Sxy = (−2)(−2) + (−1)(0) + 0 + (1)(0) + (2)(1) = 6; Sxx = 10; Syy = 4 + 0 + 1 + 0 + 1 = 6.
r = 6/√60 = 0.775: a fairly strong positive link.
Least-squares line: b = Sxy/Sxx = 0.6, a = ȳ − b x̄ = 2.2, so ŷ = 2.2 + 0.6x.
(Checked by computer: r = 0.7746.)
Variance of a sum
Var(aX + bY) = a² Var(X) + b² Var(Y) + 2ab Cov(X, Y). This is how risk in a portfolio or error in a measurement adds up.
Exams usually ask
- Find marginals from a joint table and test independence.
- Compute covariance and correlation (population or sample).
- Fit and interpret a regression line.
Common mistake
Reading correlation as cause. Students who buy more textbooks may score higher, but the cause may be a third factor (time spent studying).
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Joint probability distribution
(opens en.wikipedia.org in a new tab)
Wikipedia, Joint probability distribution, CC BY-SA 4.0 · licence
-
Covariance
(opens en.wikipedia.org in a new tab)
Wikipedia, Covariance, CC BY-SA 4.0 · licence
-
Marginal distribution
(opens en.wikipedia.org in a new tab)
Wikipedia, Marginal distribution, CC BY-SA 4.0 · licence
-
OpenStax, Introductory Statistics 2e (whole free textbook)
The whole book, free to read online or download as a PDF (the PDF is large: Wi-Fi).
(opens openstax.org in a new tab)
OpenStax, OpenStax, Introductory Statistics 2e (whole free textbook), CC BY-NC-SA 4.0 · licence
Watch
-
Best pick Covariance and Correlation in Probability
20 min · ≈ 90 MB · about ₦51
(opens youtube.com in a new tab)
-
How To Calculate The Correlation Coefficient Using The Covariance Formula - College Statistics
20 min · ≈ 90 MB · about ₦51
(opens youtube.com in a new tab)
-
Joint Probability Distribution # 3 | Covariance and Correlation Coefficient
9 min · ≈ 41 MB · about ₦23
(opens youtube.com in a new tab)
-
Probability & Statistics - Lecture 09 [Joint Probability Distributions & Covariance]
25 min · ≈ 113 MB · about ₦63
(opens youtube.com in a new tab)
-
Lecture 53: Joint probability distribution and covariance
35 min · ≈ 158 MB · about ₦89
(opens youtube.com in a new tab)
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.