myLearning

Topic 2 of 7

Step 22: Probability theory

Discrete and continuous random variables

Step 22 · Probability theory topics

Describe random variables by their probability mass or density functions, compute probabilities from them, and use cumulative distribution functions for both kinds.

Probability mass functions

A discrete random variable takes separate values, like counts. Its probability mass function p(x) = P(X = x) gives each value's probability. The probabilities are never negative, and they add to 1.

Distributionp(k)Mean
Bernoulli(p)p for 1, 1 − p for 0p
Binomial(n, p)(nk)pk(1−p)n−k\binom{n}{k}p^{k}(1 - p)^{n-k}np
Geometric(p)(1−p)k−1p(1 - p)^{k-1}p1p\frac{1}{p}
Poisson(λ)e−λλkk!\frac{e^{-\lambda}\lambda^{k}}{k!}λ

Example: Geometric

A free throw goes in with probability 0.7. What is the probability the first miss comes on the third throw?

  1. Make, make, then miss: 0.7 × 0.7 × 0.3.

Answer0.147

Example: Poisson

A help desk gets 3 calls an hour on average. What is the probability of no calls in an hour?

  1. For a Poisson(3) count, P(X=0)=e−3P(X = 0) = e^{-3}.

AnswerAbout 0.050

Probability density functions

A continuous random variable takes values across a whole interval. Its density f(x) gives probabilities as areas: P(a ≤ X ≤ b) is the integral of f from a to b. The total area is 1, and any single value has probability 0.

P(a≤X≤b)=∫abf(x) dx∫−∞∞f(x) dx=1P(a \le X \le b) = \int_{a}^{b} f(x)\,dx \qquad \int_{-\infty}^{\infty} f(x)\,dx = 1

Example: A uniform variable

X is uniform on [0, 4]. What is P(1 ≤ X ≤ 2.5)?

  1. The density is 1/4 on [0, 4].
  2. The area from 1 to 2.5 is 1.5 × 1/4.

Answer0.375

Example: An exponential variable

A bulb's lifetime in years has density f(x)=0.5e−0.5xf(x) = 0.5e^{-0.5x} for x ≥ 0. What is P(X > 2)?

  1. ∫2∞0.5e−0.5x dx=e−1\int_{2}^{\infty} 0.5e^{-0.5x}\,dx = e^{-1}.

AnswerAbout 0.368

An exponential density, drawn 10 times taller so its shape shows. The shaded area beyond x = 2 is the chance a bulb lasts more than 2 years, about 0.37.

Cumulative distribution functions

The cumulative distribution function F(x) = P(X ≤ x) works for both kinds. It rises from 0 to 1. For a continuous variable it is the integral of the density, and the density is its derivative.

Example: Uniform

Find F(x) for X uniform on [0, 4].

  1. For 0 ≤ x ≤ 4, F(x) is the area up to x, which is x/4.
  2. F is 0 below 0 and 1 above 4.

AnswerF(x) = x/4 on [0, 4]

Example: From F to probabilities

F(x)=1−e−xF(x) = 1 - e^{-x} for x ≥ 0. Find P(1 < X ≤ 2).

  1. P(1 < X ≤ 2) = F(2) − F(1).
  2. That is (1−e−2)−(1−e−1)=e−1−e−2(1 - e^{-2}) - (1 - e^{-1}) = e^{-1} - e^{-2}.

AnswerAbout 0.233

Try it yourself

Work each one on paper first, then open the answer to check.

  1. X is 1, 2 or 3 with probabilities 0.2, 0.5 and c. What is c?

    Show answer

    0.3

  2. X is binomial with n = 4 and p = 0.5. What is P(X = 4)?

    Show answer

    116\frac{1}{16}

  3. X is uniform on [2, 6]. What is P(X ≤ 3)?

    Show answer

    0.25

  4. f(x) = 2x on [0, 1]. What is P(X ≤ 0.5)?

    Show answer

    0.25

  5. X is continuous. What is P(X = 3)?

    Show answer

    0

  6. F(5) = 0.8 and F(2) = 0.3. What is P(2 < X ≤ 5)?

    Show answer

    0.5

What next?