Topic contents

Lesson 2

How are probabilities distributed across random outcomes?

This lesson introduces discrete random variables: outcomes can be counted individually, and each value has a corresponding probability.

Customer purchase count

Try it

Why can random outcomes be listed in a table?

First identify the type: a discrete random variable has values that can be listed individually. For example, a customer buys 0, 1, 2, or 3 items. “Discrete” is not the name of a curve that is “sometimes discrete, sometimes continuous”; it classifies how a random variable takes values.

A campus supermarket records “the number of items bought by the next customer,” using X to represent this random outcome.

For this teaching example, assume that only 0, 1, 2, or 3 items can be purchased.

Possible outcomes

Items purchased X0123Total
Probability P(X=x)0.150.300.300.251.00
0.000.10000.20000.3000Probability P(X=k)0 · Other values: 0.15000 · Value of interest: 0.0001 · Other values: 0.30001 · Value of interest: 0.0012 · Other values: 0.002 · Value of interest: 0.300023 · Other values: 0.25003 · Value of interest: 0.003
Items bought by the next customer (bar heights represent probabilities)

Think about it

  1. Look at the graph: which purchase count is most common? If the probability of “buying 2 items” increases, must the other probabilities also be adjusted?

Probability-weighted mean and variance

Try it

Does a probability distribution also have a mean and variance?

We continue with customers' purchase counts at the campus supermarket. The expected value here is not the mean of a batch of actual observations. It is the theoretical mean calculated from the possible outcomes and their probabilities.

Items purchased X0123Total
Probability P(X=x)0.150.300.300.251.00
Expected value E(X)
1.650
Variance Var(X)
1.027
Standard deviation SD(X)
1.014

Expected value: a probability-weighted mean

E(X)=∑xxP(X=x)=0×0.15+1×0.30+2×0.30+3×0.25=1.650E(X)=\sum_x xP(X=x)=0\times 0.15+1\times 0.30+2\times 0.30+3\times 0.25=1.650

Variance: probability-weighted squared deviations

Var⁡(X)=∑x[x−E(X)]2P(X=x)\operatorname{Var}(X)=\sum_x[x-E(X)]^2P(X=x)
Var⁡(X)=(0−1.650)2×0.15+(1−1.650)2×0.30+(2−1.650)2×0.30+(3−1.650)2×0.25=1.027\operatorname{Var}(X)=(0-1.650)^2\times 0.15+(1-1.650)^2\times 0.30+(2-1.650)^2\times 0.30+(3-1.650)^2\times 0.25=1.027
0.000.10000.20000.3000Probability P(X=k)0 · Other values: 0.15000 · Value of interest: 0.0001 · Other values: 0.30001 · Value of interest: 0.0012 · Other values: 0.30002 · Value of interest: 0.0023 · Other values: 0.25003 · Value of interest: 0.003
The same probability distribution: changing probabilities updates the expected value and variance together

Think about it

  1. Compare with the previous topic: the sample mean uses observed frequencies as weights; here, theoretical probabilities are the weights.

Product inspection settings

Try it

Product inspection: when do we use the binomial distribution?

For example, randomly inspect n items from a large batch produced by a stable process. Each item has only two possible outcomes: “conforming” or “nonconforming.” If inspections are independent and each item has the same probability p of being nonconforming, the number of nonconforming items X follows a binomial distribution.
P(X=k)
0.3020
P(X≤k)
0.6778
E(X)=np
2.00

Binomial probability formula

P(X=k)=n!k!(n−k)!pk(1−p)n−kP(X=k)=\frac{n!}{k!(n-k)!}p^k(1-p)^{n-k}
P(X=2)=45×0.202×0.808≈0.3020P(X=2)=45\times 0.20^{2}\times 0.80^{8}\approx 0.3020
0.000.10000.20000.3000Probability P(X=k)0 · Other values: 0.10740 · Value of interest: 0.0001 · Other values: 0.26841 · Value of interest: 0.0012 · Other values: 0.002 · Value of interest: 0.302023 · Other values: 0.20133 · Value of interest: 0.0034 · Other values: 0.088084 · Value of interest: 0.0045 · Other values: 0.026425 · Value of interest: 0.0056 · Other values: 0.0055056 · Value of interest: 0.0067 · Other values: 0.00078647 · Value of interest: 0.0078 · Other values: 0.000073738 · Value of interest: 0.0089 · Other values: 4.096×10⁻⁶9 · Value of interest: 0.00910 · Other values: 1.024×10⁻⁷10 · Value of interest: 0.0010
Nonconforming item count k (the bar for exactly k items is highlighted)
How do you read the graph? The highlighted bar shows that the probability of exactly 2 nonconforming items is 30.20%. Adding the bar probabilities from 0 to 2 gives 67.78%, the probability of “at most 2 nonconforming items.” The mean is np=2.00, and the variance is np(1−p)=1.60.

Think about it

  1. Try it: keep n fixed and increase p. In which direction do the probability bars mainly move?

Customer arrival settings

Try it

How many customers arrive in a time interval? Meet the Poisson distribution

This section introduces a common discrete probability distribution, the Poisson distribution, often used to describe the number of random events occurring in a time interval or region.

Note: not every chance event follows a Poisson distribution. Suitability depends on the actual arrival pattern.

P(X=k)
0.2240
P(X≤k)
0.6472
Expected value=variance=λ
3.0

Poisson probability formula

P(X=k)=λke−λk!P(X=k)=\frac{\lambda^k e^{-\lambda}}{k!}
P(X=3)=3.03e−3.03!≈0.2240P(X=3)=\frac{3.0^{3}e^{-3.0}}{3!}\approx 0.2240
0.000.10000.2000Probability P(X=k)0 · Other values: 0.049790 · Value of interest: 0.0001 · Other values: 0.14941 · Value of interest: 0.0012 · Other values: 0.22402 · Value of interest: 0.0023 · Other values: 0.003 · Value of interest: 0.224034 · Other values: 0.16804 · Value of interest: 0.0045 · Other values: 0.10085 · Value of interest: 0.0056 · Other values: 0.050416 · Value of interest: 0.0067 · Other values: 0.021607 · Value of interest: 0.0078 · Other values: 0.0081028 · Value of interest: 0.0089 · Other values: 0.0027019 · Value of interest: 0.00910 · Other values: 0.000810210 · Value of interest: 0.001011 · Other values: 0.000221011 · Value of interest: 0.001112 · Other values: 0.0000552412 · Value of interest: 0.001213 · Other values: 0.0000127513 · Value of interest: 0.001314 · Other values: 2.732×10⁻⁶14 · Value of interest: 0.001415 · Other values: 5.463×10⁻⁷15 · Value of interest: 0.0015
Customer arrivals k per 10 minutes (the bar for exactly k people is highlighted)

Note: the graph shows only 0–15 people. Probabilities for more than 15 people still contribute to the Poisson distribution's total probability.

Probability not plotted P(X>15) = 1.241×10⁻⁷

Think about it

  1. Change λ from 1 to 8: where does the bar distribution move? How does the most probable arrival count generally change?

Summary: how do we choose a model for a random count?

Three key ideas

① Discrete random variable: possible values can be listed one by one, such as the number of nonconforming items or arrivals at a store.

② Probability distribution: lists each value and its probability; the probabilities sum to 1.

③ Expected value and variance: summarize the theoretical center and dispersion of random outcomes, respectively.

Two common distributions

Binomial distribution: count successes or failures in a fixed number of independent trials with the same probability of success.

Poisson distribution: count events in a fixed time interval or region, under appropriate assumptions about the arrival process.

Inspect 20 products and count nonconforming items. Inspections are independent with the same nonconforming rate. Which distribution should you consider first?

A counter receives an average of 4 customers every 10 minutes. Under suitable assumptions, which distribution can model the actual number arriving in 10 minutes?

The probabilities of a random variable's possible values are 0.2, 0.3, and 0.6. Is this a valid probability distribution?

Customer purchase count

P(X=2) = 0.30