Beta-Binomial Distribution Calculator

Enter n, k, α and β to get the beta-binomial probability.

How it is calculated

The probability of exactly k successes in n trials is P(k) = C(n, k) × B(k + α, n - k + β) / B(α, β), where B is the beta function. The engine evaluates it through logarithms of the gamma function and exponentiates the result, which keeps larger n stable. Mean and variance are nα / (α + β) and nαβ(α + β + n) / ((α + β)2(α + β + 1)). The probability is shown to 6 decimals, mean and variance to 2. n and k are rounded to whole numbers (3.6 becomes 4); k must lie between 0 and n, and α and β can be any positive numbers, not only integers. The tool gives one probability P(k), not a cumulative total.

Worked example

Take n = 10 trials, k = 3 successes, α = 2 and β = 5. The binomial coefficient C(10, 3) = 120. The beta functions are B(5, 12) = 0.0000457875 and B(2, 5) = 0.033333. So P(3) = 120 × 0.0000457875 / 0.033333 = 0.164835. Mean = 10 × 2 / 7 = 2.86. Variance = 10 × 2 × 5 × 17 / (49 × 8) = 4.34. A plain binomial with the same mean success rate (2/7) would have a variance of only about 2.04, so this distribution is wider.

Try this example →

Common mistakes

  • Entering α and β as the success and failure counts of the current trial; they are shape parameters describing prior belief about the rate, so n and k stay separate.
  • Reading the output as a cumulative probability: it is the chance of exactly k successes, so "at most k" means summing the values for 0 to k.
  • Treating a decimal k such as 3.6 as valid; it is silently rounded to 4 and the answer changes.
  • Using a mean success rate directly as α; only the ratio α / (α + β) sets the mean, while their sum controls how spread out the probabilities are.
  • Expecting the variance to match the binomial formula n·p·(1 - p); it is always larger for the same mean.

About this calculator

The beta-binomial distribution is a compound distribution: instead of assuming a fixed success probability like the ordinary binomial does, it treats that probability as itself uncertain and drawn from a Beta(α, β) distribution. The result models overdispersed count data — situations where outcomes vary more than a plain binomial would predict because the underlying rate differs from trial to trial or group to group.

This calculator computes the probability mass P(k), mean and variance for given trials n, successes k, and shape parameters α and β. It’s a core tool in Bayesian statistics for updating beliefs about a success rate, in A/B testing and marketing analytics where conversion rates vary across users or segments, and in ecology and genetics for modeling count data with natural between-group variability.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The beta-binomial is a binomial where the success chance itself is uncertain, and that uncertainty fattens the spread. With the preset figures the mean is 2.86 and the variance 4.34, whereas a plain binomial with the same mean would have a variance of about 2.04. Where do your alpha and beta come from, a prior built from past data or a fit to counts that vary more than a binomial allows?

Popular calculators

All Calculators