Inputs
Model & Formula
We count the number of failures k observed before achieving r successes in independent Bernoulli trials with success probability p.
log P(X = k) = lnΓ(k + r) - lnΓ(r) - ln(k!) + r ln p + k ln(1 - p)
Mean = r(1 - p)/p Variance = r(1 - p)/p2. Computations use log-space and a Lanczos approximation for lnΓ to maintain stability for large k and non-integer r.
Results
-
PMF value P(X = 5)
0.104509440000
-
log PMF
-2.258477876729
-
CDF P(X ≤ 5)
0.684605440000
-
Mean failures
4.500000
-
Variance
11.250000
FAQs
1) What do the parameters r p and k represent?
r is the target count of successes, p is the success probability per trial, and k is the number of failures observed before the r-th success.
2) Which parameterization does this calculator use?
It uses the count of failures before achieving r successes. This is a common form in statistics and matches the formula shown above.
3) Can r be non-integer?
Yes. The PMF extends to positive real r using the Gamma function. The tool computes with log-space math for stability with non-integer r.
4) Why show log PMF?
Log probabilities avoid underflow and are easier to compare across parameter sets. They are essential when k or r are large or when p is near 0 or 1.
5) How is the CDF calculated?
The CDF up to k is a running sum of PMF values from 0 to k. The table uses a stable recurrence to generate each PMF term efficiently.