BL2.ru

Bernoulli formula and binomial distribution calculator

Enter the number of trials n, the success probability p and k — the calculator applies the Bernoulli formula, finds the probability of at least one success, the most probable number, M(X) and D(X), and shows the solution step by step. For large n it also gives the Poisson and Moivre–Laplace approximations compared with the exact value.

Bernoulli scheme: n independent trials with success probability p
Enter p as 0.3, 1/6 or 30%. n is an integer from 1 to 100000, k is an integer from 0 to n.
What to find
Examples
Calculate

Bernoulli formula

Suppose n independent trials are made and in each of them event A occurs with the same probability p (and fails with probability q = 1 − p). The probability that A occurs exactly k times is Pₙ(k) = Cₙᵏ·pᵏ·qⁿ⁻ᵏ, where Cₙᵏ = n! / (k!·(n − k)!). The number of successes X has the binomial distribution: M(X) = np, D(X) = npq.

What else is asked in such problems

  • At least k times: P(X ≥ k) = Pₙ(k) + … + Pₙ(n) = 1 − P(X ≤ k − 1).
  • At least once: P(X ≥ 1) = 1 − qⁿ.
  • Most probable number k₀: np − q ≤ k₀ ≤ np + p; if np − q is an integer there are two such numbers.

Large n

For large n, computing C(n, k) by hand is impractical. If p is small and np does not exceed 10, use the Poisson formula Pₙ(k) ≈ λᵏ·e^(−λ) / k!, where λ = np. If npq is at least 10, the Moivre–Laplace theorems work: local Pₙ(k) ≈ φ(x) / √(npq), x = (k − np) / √(npq), and integral P(k₁ ≤ X ≤ k₂) ≈ Φ(x₂) − Φ(x₁), where Φ is the Laplace function (Φ(0) = 0, Φ is odd, Φ(∞) = 0.5).

FAQ

When does the Bernoulli formula apply?
When n independent trials with two outcomes (success and failure) are made and the success probability p is the same in every trial. Then the probability of exactly k successes is Cₙᵏ·pᵏ·qⁿ⁻ᵏ.
How do I find the probability of "at least k" and "at least one"?
"At least k" is the sum Pₙ(k) + … + Pₙ(n), or more conveniently 1 − P(X ≤ k − 1). "At least one" is the special case 1 − qⁿ, where q = 1 − p.
How do I find the most probable number of successes?
It is the integer k₀ in the interval np − q ≤ k₀ ≤ np + p. The interval has length 1, so usually there is one such number; if np − q is an integer there are two (np − q and np + p).
When should I use Poisson and when Moivre–Laplace?
Poisson — when n is large and p is small (rare events) and λ = np is at most 10. Moivre–Laplace — when n is large and p is not too close to 0 or 1, so that npq is at least 10. The calculator shows the exact value next to the approximation so you can see the error.
What is the difference between φ(x) and Φ(x)?
φ(x) = e^(−x²/2) / √(2π) is the standard normal density (an even function) used in the local theorem. Φ(x) is the Laplace function, the integral of φ from 0 to x (odd, Φ(∞) = 0.5), used in the integral theorem. Some books define Φ from −∞, so check which table you use.