Loading…

Negative Binomial Distribution Calculator

Math Probability • Discrete Probability Distributions

View all topics

Negative Binomial Distribution Calculator – P(X=k), Mean/Variance (Free)

Compute the probability that the \(r\)-th success occurs on trial \(k\): \[ P(X=k)=\binom{k-1}{r-1} p^r (1-p)^{k-r},\quad k\ge r. \]

Tip: Press Play to animate successes accumulating to \(r\), and sweep a highlighted \(k\) on the PMF chart.

Inputs

Accepted expressions: 1e-3, pi, e, sqrt(2), sin(), cos(), tan(), ln(), log(), abs(). Use * for multiplication.

Output & visualization
Drag on the PMF chart to pan. Use mouse wheel / trackpad to zoom. Canvas labels are plain text (no LaTeX inside the chart).
Simulation

Simulate one run of Bernoulli trials until the \(r\)-th success occurs, then animate the run.

Ready
Interactive view — success tracker + PMF chart (pan/zoom) + Play

Top panel: a run of trials highlighting successes until \(r\). Bottom panel: PMF bars \(P(X=k)\) with highlighted \(k\).

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What does X represent in this calculator?

X is the trial number on which the r-th success occurs (the total number of trials needed to obtain r successes).

Why is there a binomial coefficient C(k-1,r-1)?

To have the r-th success on trial k, the first k-1 trials must contain exactly r-1 successes in any order; the number of such sequences is C(k-1,r-1).

How is this related to the geometric distribution?

When r=1, the negative binomial reduces to the geometric distribution for trials until the first success.

Why might the PMF partial CDF shown on the chart be less than 1?

The chart only sums probabilities up to the selected maximum k. The full CDF approaches 1 as k grows without bound.