Salick Academy

Discrete Random Variables

No calculator

Unit 1 built discrete random variables from scratch: a table of probabilities, then E(X)E(X) and Var(X)\operatorname{Var}(X) from that table. This topic is about the situations that come up so often they have named distributions, with formulae you can quote instead of tabulating.

Named discrete distributions

Distribution Situation P(X=x)P(X = x) E(X)E(X) Var(X)\operatorname{Var}(X)
Binomial B(n,p)B(n,p) xx successes in nn fixed trials (nx)pxqnx\binom{n}{x}p^x q^{n-x} npnp npqnpq
Geometric Geo(p)\text{Geo}(p) the first success is on trial xx qx1pq^{x-1}p 1p\dfrac1p qp2\dfrac{q}{p^2}
Poisson Po(λ)\text{Po}(\lambda) xx events in a fixed interval eλλxx!\dfrac{e^{-\lambda}\lambda^x}{x!} λ\lambda λ\lambda

with q=1pq = 1 - p throughout.

The geometric distribution

Trials are repeated until the first success. XX is the trial number on which it occurs, so X=1,2,3,X = 1, 2, 3, \dots with no upper limit.

P(X=x)=qx1pP(X = x) = q^{x-1}p

The reasoning is direct: x1x - 1 failures, then a success.

15% of tyres from a production line are faulty. Tyres are tested one at a time until a faulty one is found.

P(X=4)=0.853×0.15=0.0921P(X = 4) = 0.85^3 \times 0.15 = 0.0921

E(X)=10.15=6.67Var(X)=0.850.152=37.8E(X) = \frac{1}{0.15} = 6.67 \qquad \operatorname{Var}(X) = \frac{0.85}{0.15^2} = 37.8

The tail probability has a shortcut worth memorising — "more than nn trials" means the first nn all failed:

P(X>n)=qnsoP(X>5)=0.855=0.4437P(X > n) = q^n \qquad\text{so}\qquad P(X > 5) = 0.85^5 = 0.4437

and therefore P(X3)=10.853=0.3859P(X \le 3) = 1 - 0.85^3 = 0.3859.

The Poisson distribution

Events occur at random, independently, at a constant average rate λ\lambda per interval. Then

P(X=x)=eλλxx!,x=0,1,2,P(X = x) = \frac{e^{-\lambda}\lambda^x}{x!}, \qquad x = 0, 1, 2, \dots

A switchboard receives calls at an average of 3 per five-minute period.

P(X=2)=e3322!=0.2240P(X = 2) = \frac{e^{-3}\,3^2}{2!} = 0.2240

P(X1)=1P(X=0)=1e3=0.9502P(X \ge 1) = 1 - P(X = 0) = 1 - e^{-3} = 0.9502

P(X2)=e3(1+3+92)=0.4232P(X \le 2) = e^{-3}\left(1 + 3 + \tfrac92\right) = 0.4232

Changing the interval, and adding variables

Two properties make the Poisson unusually convenient.

Scaling. If events occur at λ\lambda per interval, then over kk intervals the count is Po(kλ)\text{Po}(k\lambda). Three five-minute periods give λ=9\lambda = 9:

P(X=10)=e991010!=0.1186P(X = 10) = \frac{e^{-9}\,9^{10}}{10!} = 0.1186

Addition. If XPo(λ1)X \sim \text{Po}(\lambda_1) and YPo(λ2)Y \sim \text{Po}(\lambda_2) are independent, then

X+YPo(λ1+λ2)X + Y \sim \text{Po}(\lambda_1 + \lambda_2)

Emails arriving at 4 per hour and texts at 6 per hour give a combined Po(10)\text{Po}(10), so P(8 messages in an hour)=e10108/8!=0.1126P(\text{8 messages in an hour}) = e^{-10}10^8/8! = 0.1126.

Poisson as an approximation to the binomial

When nn is large and pp is small, B(n,p)Po(np)B(n,p) \approx \text{Po}(np). The usual working rule is n>50n > 50 and np<5np < 5.

A component has a 1% failure rate; 200 are installed.

Here λ=np=2\lambda = np = 2, so

P(X=3)e2233!=0.1804P(X = 3) \approx \frac{e^{-2}2^3}{3!} = 0.1804

The exact binomial value is 0.18140.1814 — an error of about half a percent, for a fraction of the arithmetic.

P(X2)=1e2(1+2)=0.5940P(X \ge 2) = 1 - e^{-2}(1 + 2) = 0.5940

Choosing the right model

Before writing anything down, ask three questions.

  1. Is there a fixed number of trials? Yes → binomial.
  2. Are you counting trials until the first success? Yes → geometric.
  3. Are you counting events in an interval, with no natural maximum? Yes → Poisson.