STAT1003 – Statistical Techniques
Dr. Emi Tanaka
Australian National University
These slides are best viewed on a modern browser like Google Chrome on a desktop or laptop. Some interactive components may require some time to fully load.
Some components of this lecture was adapted from the previous STAT1003 lecturers. Thank you folks!
A random variable is a variable whose possible values are numerical outcomes of a random phenomenon.
There are two main types of random variables:
Notation
A probability distribution describes how probabilities are assigned to the possible values of a random variable.
By convention we denote:
Binomial distribution
Poisson distribution
Negative binomial distribution
Normal distribution
t distribution
Uniform distribution
Properties of a pmf:
If \(X\) is the number of heads in 2 tosses of a fair coin, then the pmf is given by:
| \(x\) | \(p_X(x)\) |
|---|---|
| \(0\) | \(0.25\) |
| \(1\) | \(0.50\) |
| \(2\) | \(0.25\) |
Note: this is similar to a relative frequency table, but the probabilities are theoretical values based on the assumption of a fair coin, rather than empirical estimates from data.
The expected value (or mean) of a discrete random variable \(X\) is the long-run average value of repetitions of the experiment:
\[E(X) = \mu = \sum_{i=1}^k x_i \, p_X(x_i).\]
The expected value of \(X\), the number of heads in 2 tosses of a fair coin, is:
\[E(X) = 0 \times 0.25 + 1 \times 0.50 + 2 \times 0.25 = 1.\]
The variance measures how spread out the values of \(X\) are around the mean:
\[\text{Var}(X) = \sigma^2 = \sum_{i=1}^k (x_i - \mu)^2 \,p_X(x_i)\]
The variance of \(X\), the number of heads in 2 tosses of a fair coin, is:
\[\begin{align*} \text{Var}(X) &= (0 - 1)^2 \times 0.25 +\\&\qquad (1 - 1)^2 \times 0.50 +\\&\qquad (2 - 1)^2 \times 0.25\\ &= 0.5. \end{align*}\]
The expected value of a transformation is given by: \[E\left(g(X)\right) = \sum_{i = 1}^k g(x_i) \cdot p_X(x_i)\]
for a discrete random variable \(X\).
If \(X\) is the number of heads in 2 tosses of a fair coin, and we define \(Y = X^2\), then the expected value of \(Y\) is:
\[\begin{align*} E(Y) &= E(X^2)\\ &= 0^2 \times 0.25 + 1^2 \times 0.50 + 2^2 \times 0.25\\ &= 1.5. \end{align*}\]
A bivariate distribution describes the probability behavior of two random variables, say \(X\) and \(Y\), simultaneously.
The joint probability distribution specifies \(P(X = x, Y = y)\) for all possible \((x, y)\) combinations and must satisfy:
Joint probability table:
| \(X \backslash Y\) | \(1\) | \(2\) |
|---|---|---|
| \(0\) | \(0.1\) | \(0.2\) |
| \(1\) | \(0.3\) | \(0.4\) |
The marginal distribution describes the probability distribution of one variable in a bivariate (joint) distribution, regardless of the value of the other variable.
For random variables \(X\) and \(Y\) with joint probabilities \(p_{X,Y}(x, y)\):
If the joint probability table is:
| \(X \backslash Y\) | \(1\) | \(2\) |
|---|---|---|
| \(0\) | \(0.1\) | \(0.2\) |
| \(1\) | \(0.3\) | \(0.4\) |
If the joint probability table is:
| \(X \backslash Y\) | \(1\) | \(2\) |
|---|---|---|
| \(0\) | \(0.1\) | \(0.2\) |
| \(1\) | \(0.3\) | \(0.4\) |
The covariance is defined as: \[\mathrm{Cov}(X, Y) = E\left((X - E(X)) (Y - E(Y))\right)\]
Alternatively, \[\mathrm{Cov}(X, Y) = E(XY) - E(X)E(Y)\]
For random variables \(X\) and \(Y\), and constants \(a\) and \(b\), the following properties hold:
A discrete random variable \(X\) takes on a countable number of distinct values.
The probability mass function (pmf), \(p_X(x)\), gives the probability that a discrete random variable is exactly equal to \(x\).
The expected value \(E(X) = \sum_x x\cdot p_X(x)\).
The variance \(\mathrm{Var}(X) = E\left(X - E(X)\right)^2 = E(X^2) - E(X)^2\).
The expected value of a transformation \(E(g(X)) = \sum_x g(x) \cdot p_X(x)\).
The random variables \(X\) and \(Y\) are independent if \(p_{XY}(x,y) = p_X(x) \cdot p_Y(y)\) for all \(x\) and \(y\).
For random variables \(X\) and \(Y\) and constants \(a\) and \(b\):
or (B) head 
\[X = X_1 + X_2 + \cdots + X_n \sim B(n, p)\]
Probability mass function:
\[P(X = x) = \binom{n}{x} p^x (1-p)^{n-x}\]
Suppose I flip an unbiased coin 10 times (so \(n = 10, p = 0.5\)).
Simulating coin flips and count the number of heads
\[X \sim B(n, p)\]
If \(X \sim B(n, p)\) and \(n \to \infty\), \(p \to 0\) such that \(np = \lambda\) (a constant), then
\[ P(X = k) = \lim_{n \to \infty} \binom{n}{k} p^k (1 - p)^{n - k} = \frac{e^{-\lambda} \lambda^k}{k!}. \]
This limiting distribution is called the Poisson distribution with parameter \(\lambda\) written as \(X \sim \mathrm{Poisson}(\lambda)\).
\(E(X) = \lambda\) and \(\mathrm{Var}(X) = \lambda\).
If a coffee shop has an average of 75 customers per hour then assume the number of customers \(X \sim \mathrm{Poisson}(75)\). Then probability of exactly 70 customers arriving in an hour is \[ P(X=70) = \frac{75^{70}e^{-75}}{70!} \approx 0.0402. \]
\[X \sim \mathrm{Poisson}(\lambda)\]

STAT1003 – Statistical Techniques