keisoku

Binomial Distribution Calculator

For a binomial distribution with n trials and success probability p, compute the probability mass P(X=k), cumulative probability, upper tail, mean, and variance, with a bar chart of the distribution.

Input

For a binomial distribution with n trials and success probability p, compute the probability mass, cumulative probability, upper tail, mean, and variance at a given number of successes k.

Enter an integer of 1 or more.

Enter a value between 0 and 1 (for example 0.5).

Enter an integer from 0 to n.

Result

Probability mass P(X equals k = 3) with n = 10 and p = 0.5

0.1171875

Cumulative probability P(X at most k)

0.171875

Upper tail P(X at least k)

0.9453125

Binomial coefficient C(n, k)

120

Mean

5

Variance

2.5

Bar chart of the probability mass function

012345678910

How it works

  • The probability mass is P(X=k) = C(n,k) p^k (1-p)^(n-k), where C(n,k) is the binomial coefficient.
  • The cumulative probability P(X at most k) is computed with the regularized incomplete beta function, so it stays stable even for large n.
  • The upper tail is P(X at least k) = 1 - P(X at most k-1).
  • The mean is np and the variance is np(1-p).
  • The binomial coefficient is computed with the log gamma function to avoid factorial overflow.
  • When the number of trials n is large, the bar chart focuses on the range around the mean.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Binomial Distribution Calculator