Module VI: Probability

1. Random Variables

Definition
A random variable is a function that assigns a numerical value to each outcome of a random experiment.
Type Definition Example
Discrete Takes countable values (finite or countably infinite) Number of heads in 3 coin tosses: 0, 1, 2, 3
Continuous Takes any value in an interval (uncountably infinite) Height, weight, time, temperature

2. Discrete Random Variable & Probability Distribution

Probability Mass Function (PMF)
For a discrete random variable \( X \), the PMF is \( P(X = x) = p(x) \) where:
A die is thrown. Let X = number on top face. Find probability distribution
X123456
P(X)1/61/61/61/61/61/6
Sum = \( 6 \times \frac{1}{6} = 1 \) ✓ (Valid PMF)
Find k if \( P(X = x) = kx \) for \( x = 1, 2, 3, 4 \)
\( k = \frac{1}{10} = 0.1 \)

3. Continuous Random Variable & PDF

Probability Density Function (PDF)
For a continuous random variable \( X \), the PDF \( f(x) \) satisfies:
For continuous random variable: \( P(X = a) = 0 \) (probability at a single point is zero)
Find k if \( f(x) = kx^2 \) for \( 0 \leq x \leq 3 \), and 0 otherwise
\( k = \frac{1}{9} \)
For the above PDF, find \( P(1 \leq X \leq 2) \)
\( P(1 \leq X \leq 2) = \frac{7}{27} \)

4. Expectation (Mean)

Discrete: \( E(X) = \mu = \sum x \cdot P(X = x) \)

Continuous: \( E(X) = \mu = \int_{-\infty}^{\infty} x \cdot f(x) \, dx \)
Properties of Expectation
Find E(X) for the distribution
X0123
P(X)0.10.30.40.2
\( E(X) = 1.7 \)
For \( f(x) = \frac{1}{9}x^2 \), \( 0 \leq x \leq 3 \), find E(X)
\( E(X) = \frac{9}{4} = 2.25 \)

5. Variance and Standard Deviation

Variance: \[ \text{Var}(X) = \sigma^2 = E(X^2) - [E(X)]^2 \]

Also written as: \( \sigma^2 = E[(X - \mu)^2] \)

Standard Deviation: \[ \sigma = \sqrt{\text{Var}(X)} = \sqrt{E(X^2) - [E(X)]^2} \]
For calculation:
Discrete: \( E(X^2) = \sum x^2 \cdot P(X = x) \)
Continuous: \( E(X^2) = \int_{-\infty}^{\infty} x^2 \cdot f(x) \, dx \)
Properties of Variance
Find Variance and S.D. for the distribution
X0123
P(X)0.10.30.40.2
Variance = 0.81, Standard Deviation = 0.9
For \( f(x) = \frac{1}{9}x^2 \), \( 0 \leq x \leq 3 \), find Var(X)
Var(X) = 0.3375, \( \sigma = \sqrt{0.3375} \approx 0.581 \)

6. Moment Generating Function (MGF)

Definition
The moment generating function of a random variable \( X \) is:
Discrete: \( M_X(t) = E(e^{tX}) = \sum e^{tx} \cdot P(X = x) \)

Continuous: \( M_X(t) = E(e^{tX}) = \int_{-\infty}^{\infty} e^{tx} \cdot f(x) \, dx \)
Key Property: Finding Moments from MGF
\[ E(X^n) = \mu_n' = \left. \frac{d^n}{dt^n} M_X(t) \right|_{t=0} \]

First moment: \( E(X) = M_X'(0) \)

Second moment: \( E(X^2) = M_X''(0) \)

\( M_X(t) \) is called "moment generating function" because its derivatives at \( t = 0 \) give moments
Find MGF and first two moments for \( P(X=x) = \frac{1}{2^x} \) for \( x = 1, 2, 3, ... \)
\( M_X(t) = \frac{e^t}{2-e^t} \), \( E(X) = 2 \), \( E(X^2) = 6 \), Var(X) = 6 - 4 = 2
Find MGF of \( f(x) = e^{-x} \) for \( x \geq 0 \)
\( M_X(t) = \frac{1}{1-t} \), \( E(X) = 1 \), \( E(X^2) = 2 \), Var(X) = 1
For a random variable with MGF \( M_X(t) = e^{3t + 2t^2} \), find mean and variance
Mean = 3, Variance = 4

Quick Reference: All Formulas

Concept Discrete Continuous
Valid distribution \( \sum P(X=x) = 1 \) \( \int f(x)dx = 1 \)
Mean \( E(X) \) \( \sum x \cdot P(X=x) \) \( \int x \cdot f(x)dx \)
\( E(X^2) \) \( \sum x^2 \cdot P(X=x) \) \( \int x^2 \cdot f(x)dx \)
Variance \( \text{Var}(X) = E(X^2) - [E(X)]^2 \)
S.D. \( \sigma = \sqrt{\text{Var}(X)} \)
MGF \( \sum e^{tx} \cdot P(X=x) \) \( \int e^{tx} \cdot f(x)dx \)
Moments from MGF \( E(X^n) = M_X^{(n)}(0) \)