UNIHIVE

Study Hub UNIPORT STA 260.1

STA 260.1 · Introduction to Probability and Statistics

Random variables and probability distributions

Discrete and continuous random variables, probability mass and density functions, and the cumulative distribution function.

Our notes

2 min read

What 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:

x0123
p(x)1/83/83/81/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

Watch

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.

All STA 260.1 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.