STA 260.1 · Introduction to Probability and Statistics
Our notes
2 min readWhat a random variable is
A random variable X is a rule that gives a number to each outcome. Toss three coins; X = number of heads takes values 0, 1, 2, 3.
- Discrete: countable values (number of defects, calls per hour).
- Continuous: any value in an interval (lifetime of a bulb, porosity of a rock).
Discrete: probability mass function (pmf)
p(x) = P(X = x), with p(x) ≥ 0 and Σ p(x) = 1.
Three fair coins:
| x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| p(x) | 1/8 | 3/8 | 3/8 | 1/8 |
Continuous: probability density function (pdf)
f(x) ≥ 0 and ∫ f(x) dx over all x = 1. Probabilities are areas:
P(a ≤ X ≤ b) = ∫ from a to b of f(x) dx.
For a continuous X, P(X = a) = 0, so ≤ and < give the same answer.
Worked example
f(x) = kx for 0 ≤ x ≤ 2, zero elsewhere.
- Find k: ∫₀² kx dx = k[x²/2]₀² = 2k = 1, so k = ½.
- P(X ≤ 1) = ∫₀¹ x/2 dx = [x²/4]₀¹ = ¼.
Check: the density is a triangle with base 2 and height f(2) = 1; area = ½ × 2 × 1 = 1 ✓; the part up to 1 is a triangle of area ½ × 1 × ½ = ¼ ✓.
Cumulative distribution function (cdf)
F(x) = P(X ≤ x).
- Discrete: a step function. For the coins, F(1) = 1/8 + 3/8 = ½.
- Continuous: F(x) = ∫ from −∞ to x of f(t) dt, and f(x) = F′(x).
- F rises from 0 to 1 and never decreases. P(a < X ≤ b) = F(b) − F(a).
In the example above, F(x) = x²/4 for 0 ≤ x ≤ 2.
Functions of a random variable
If Y = g(X), its distribution follows from X's. For a discrete X, P(Y = y) adds p(x) for all x with g(x) = y. For Y = aX + b the shape is the same, shifted and stretched.
Exams usually ask
- Check that a given table or function is a valid pmf or pdf, or find the constant k.
- Find P(a < X < b) and the cdf.
- Find the median m from F(m) = ½ (here m²/4 = ½ gives m = √2 ≈ 1.414).
Common mistake
Treating a pdf value f(x) as a probability. f(x) can be bigger than 1; only areas under f are probabilities.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Introductory Statistics 2e, 4.1 Probability Distribution Function (PDF) for a Discrete Random Variable
(opens openstax.org in a new tab)
OpenStax, Introductory Statistics 2e, 4.1 Probability Distribution Function (PDF) for a Discrete Random Variable, CC BY-NC-SA 4.0 · licence
-
Random variable
(opens en.wikipedia.org in a new tab)
Wikipedia, Random variable, CC BY-SA 4.0 · licence
-
Probability distribution
(opens en.wikipedia.org in a new tab)
Wikipedia, Probability distribution, CC BY-SA 4.0 · licence
-
Cumulative distribution function
(opens en.wikipedia.org in a new tab)
Wikipedia, Cumulative distribution function, 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
-
02 - Random Variables and Discrete Probability Distributions
30 min · ≈ 135 MB · about ₦76
(opens youtube.com in a new tab)
-
Random Variables and Probability Distributions
22 min · ≈ 99 MB · about ₦56
(opens youtube.com in a new tab)
-
Random variables | Probability and Statistics | Khan Academy
6 min · ≈ 27 MB · about ₦15
(opens youtube.com in a new tab)
-
Random Variables and Probability Distributions – Complete Overview
8 min · ≈ 36 MB · about ₦20
(opens youtube.com in a new tab)
-
JOINT PROBABILITY DISTRIBUTIONS FOR DISCRETE AND CONTINUOUS RANDOM VARIABLES (Lecture 13)
1 h 6 min · ≈ 297 MB · about ₦167
(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.