A11 · Lesson 10 · Discrete distributions
Counting successes and waiting for one
Send a 1000-bit packet over a link with a bit error rate of one in a thousand. How many errors will it have? Not exactly one: sometimes none, sometimes three. And if a corrupted packet is resent until one gets through, how many tries does that take? Two distributions answer these: the binomial, which counts successes in a fixed number of tries, and the geometric, which counts tries until the first success. Between them they describe most of the yes-or-no randomness in digital systems.
- Each draw counts the successes in independent tries, each succeeding with probability . The histogram builds the distribution; the line is the binomial formula.
- Where is the peak? Compare the measured mean and standard deviation with and .
- Make small and large. The shape leans against zero; lesson 12 explains what it becomes.
Predict
A 1000-bit packet crosses a link where each bit is wrong with probability 0.001, independently. What is the chance the packet has no errors?
About 37%: . The expected number of errors is one, but the count varies from packet to packet: about 37% have none, 37% have one, 18% have two, and so on. That number, very close to , isn't a coincidence; lesson 12 explains it.
Name it
Probability mass functions
A discrete random variable takes values from a list. Its probability mass function (PMF) gives the chance of each value, , and the chances add to 1. Its cumulative distribution function (CDF) adds them up: .
Bernoulli
One try that succeeds () with probability : mean , variance (lesson 9).
Binomial
The number of successes in independent tries, each with success probability :
It's a sum of independent Bernoulli variables, so means and variances add:
Bit errors in a word, defective parts in a lot, and packets lost out of a burst are all binomial when the tries are independent.
Geometric
The number of tries up to and including the first success:
It needs more than tries only if the first all fail: . Its mean and variance are
A link that resends a packet until it arrives (an ARQ scheme) needs transmissions on average.
No memory. . After any number of failures, the count of tries still needed has the same distribution as at the start: the link doesn't remember its bad luck.
Worked example
Each transmission of a packet succeeds with probability 0.8, and failed packets are resent. How many transmissions does a packet need on average, and how often does it need more than three?
Show the solution
- Mean. The number of transmissions is geometric with :
- More than three. That means the first three all failed: less than 1% of packets.
Answer a packet needs 1.25 transmissions on average, and more than three for 0.8% of packets.
Worked example
A 1000-bit packet has bit error rate . Find the mean and standard deviation of the number of errors, and the chance of no errors.
Show the solution
- The model. The error count is binomial with and .
- Mean.
- Standard deviation.
- No errors.
- What it means. The spread is as large as the mean, so a code that corrects only one error per packet would still fail often (lesson 12 computes how often).
Answer the mean is 1 error, the standard deviation 0.9995, and the chance of no errors 0.368.
Worked example
A packet gets through with probability 0.9, and failures are resent. How many transmissions does it take on average, and how often more than three?
Show the solution
- Mean. The number of transmissions is geometric with :
- More than three. It takes more than three only if the first three all fail: one packet in a thousand.
- What it means. A protocol that gives up after three tries loses that fraction.
Answer it takes 1.11 transmissions on average, and more than three for one packet in a thousand.
Check
A batch of 100 parts each fails with probability 0.01, independently. How many failures do you expect?
Check
A count is binomial with = 100 and = 0.1. What is its standard deviation?
Check
is binomial with = 5 and = 0.3. What is ?
Check
Each transmission succeeds with probability 0.8, and failures are resent. On average, how many transmissions does a packet need?
Check
Each try succeeds with probability 0.7. What is the chance that more than 2 tries are needed?
Check
A packet has already failed 3 times; each try succeeds with probability 0.6, independently. What is the chance the next try succeeds?
Check
Each transmission succeeds with probability 0.8, and failures are resent.
(a)
How many transmissions does a packet take on average?
(b)
What is the chance it needs more than 2?
Check
A packet of bits has bit error rate .
Step 1
What is the mean number of errors?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is its standard deviation?
Check
Simulate 10⁵ packets, each retried until it succeeds with probability 0.8 per try (np.random.default_rng(4); rng.geometric(0.8, n) gives the tries). Set mean_tries and over3, the fraction needing more than 3.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why is the mean of a binomial ?
A binomial count is the sum of indicator variables, one per try, each 1 with probability and 0 otherwise. Each indicator has mean , and expected values add for any variables, independent or not. So the total has mean . The variance also adds, but only because the tries are independent, giving .
Practice
Keep practicing
10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.