Library / Probability distributions / PRD-48
Probability distributions
Batch variation: exact successes
Probability of exactly x successes in a batch of n trials when the success probability itself varies from batch to batch following a beta distribution with shapes a and b.
- Ref
- PRD-48
- Rev
- v1
- Field
- Probability distributions
- Result
- P
With batch-to-batch variation in the success probability, the count in a batch of n follows the beta-binomial distribution. Conditional on a common probability p the trials are independent, and across batches p follows Beta(a, b). The count is more spread out than a plain binomial with the same mean. Use log-forms for large counts.
Probability of exactly x successes in a batch of n trials when the success probability itself varies from batch to batch following a beta distribution with shapes a and b.
Calculator
- Mean probability, a/(a + b)0.4
- Expected successes, na/(a + b)4
- Plain binomial probability at the same mean p0.2508
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- The chance of exactly 4 successes in a batch of 10 is 14 %.
- A plain binomial with the same mean probability would give 25.1 %; the beta-binomial puts more weight on extreme batches.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing () | Local step | Change in result |
|---|---|---|---|---|---|---|
| n Trials per batch n | 1 to 40 | 0 | 0.148 | 0.148 | +1 | −5.71 % |
| x Successes x | 0 to 40 | 0 | 0.1399 | 0.1399 | +1 | −10 % |
| b Shape b | 0.2 to 10 | 0.01572 | 0.1414 | 0.1257 | +10% | +0.971 % |
| a Shape a | 0.2 to 10 | 0.02181 | 0.1433 | 0.1215 | +10% | +1.74 % |
Sweep of Successes x
| Successes x | Probability of exactly x successes |
|---|---|
| 0 | 0.06593 |
| 5 | 0.1259 |
| 10 | 0.01099 |
| 15 | 0 |
| 20 | 0 |
| 25 | 0 |
| 30 | 0 |
| 35 | 0 |
| 40 | 0 |
Sweep one variable
Variables and how each one contributes
Probability of exactly x successes
What the equation gives you. Everything else feeds it.
Trials per batch n
The number of trials in a batch (a whole number, at least 1). More trials per batch raise the mean count and the variance. Raising it by 1 (to 11) moves the result by −5.71 %, from 0.1399 to 0.1319.
Shape a
The first shape of the beta distribution of batch probabilities (a plain number). Raises the average success probability and narrows its spread. Raising it by 10 % (to 2.2) moves the result by +1.74 %, from 0.1399 to 0.1423.
Shape b
The second shape of the beta distribution of batch probabilities (a plain number). Lowers the average success probability and narrows its spread. Raising it by 10 % (to 3.3) moves the result by +0.971 %, from 0.1399 to 0.1412.
Successes x
The number of successes in a batch (a whole number from 0 to n). Moves the count at which the probability is read. Raising it by 1 (to 5) moves the result by −10 %, from 0.1399 to 0.1259.
Worked example with the values above
- Ways to choose which trials succeed: C(10, 4) = 210.
- Beta ratio: B(x + a, n − x + b)/B(a, b) = B(6, 9)/B(2, 3).
- P = 0.13986.
Assumptions and limits
- Within a batch the trials are independent with a common probability p; across batches p follows a beta distribution with shapes a, b > 0.
- n and x are whole numbers, and 0 ≤ x ≤ n.
Common mistakes
- Using a plain binomial when batches differ in quality: it understates the variance and the chance of extreme batches.
- Treating a and b as probabilities: they are shape parameters, and a/(a + b) is the mean probability.
- Using the formula for x outside 0 to n: the probability is zero there.
Statistics and uncertainty
The inputs are parameters, usually fitted to data, and their estimation error carries into the result. The probability or density is a smooth function of the parameters, so the sweep chart shows how sensitive it is: where the curve is steep, a small error in a parameter makes a large difference. The formula treats the parameters as exact, so it gives no confidence interval on its own.
Where it is used
- Defect counts in batches of parts when batch quality varies.
- Test pass counts across lots, and any count with more spread than a binomial.
Maths you need
- Binomial distribution: successes in independent trials
- Beta distribution: a model for a probability that varies