Prashnikaप्रश्निका
Code
About

Bayes' theorem and binomial calculator

Two probability tools in one. Bayes’ theorem: give the events, their probabilities and the chance of A under each, and get the total probability and every P(E | A). Binomial distribution: give the number of trials and the chance of success, and get P(X = r), at least and at most, the mean and the variance.

How to use it

  1. 1Choose Bayes’ theorem or Binomial distribution.
  2. 2Fill in the probabilities (1/4, 0.25 and 25% all work), or tap an example.
  3. 3Press Work it out for the table of P(E | A), the total probability, or P(X = r), the mean and the variance.
What to do

Leave empty to call them E1, E2, ...

Write a probability as 1/4, 0.25 or 25%. They must add up to 1.

One for each event, in the same order.

Worked example

machines A, B, C: a defective item

This is the kind of answer you get. Put these values in the boxes or type your own.

Answer

P(Machine A | A)
25/69 ≈ 0.3623
P(Machine B | A)
28/69 ≈ 0.4058
P(Machine C | A)
16/69 ≈ 0.2319

P(A), the total probability, is 69/2000 = 0.0345.

Working

Event EP(E)P(A | E)P(E) × P(A | E)P(E | A)
Machine A1/4 = 0.251/20 = 0.051/80 = 0.012525/69 ≈ 0.3623
Machine B7/20 = 0.351/25 = 0.047/500 = 0.01428/69 ≈ 0.4058
Machine C2/5 = 0.41/50 = 0.021/125 = 0.00816/69 ≈ 0.2319
  1. Total probability: P(A) = Σ P(E) × P(A | E) = 1/80 + 7/500 + 1/125 = 69/2000 = 0.0345
  2. Bayes’ theorem: P(Eᵢ | A) = P(Eᵢ) × P(A | Eᵢ) ÷ P(A), so each row’s last column is its P(E) × P(A | E) divided by P(A).

About the Bayes' theorem and binomial calculator

What it does

Two probability tools in one. Bayes’ theorem: give the events, their probabilities and the chance of A under each, and get the total probability P(A) and every P(E | A), in exact fractions. Binomial distribution: give the number of trials and the chance of success, and get P(X = r), at least and at most, the mean, the variance and the standard deviation.

Bayes’ theorem

  • Total probability: P(A) = ΣP(E) × P(A | E).
  • Bayes’ theorem: P(Eᵢ | A) = P(Eᵢ) × P(A | Eᵢ) ÷ P(A).
  • The probabilities P(E) of the events must add up to 1.

The binomial distribution

  • For n independent trials, each with chance p of success and q = 1 − p of failure: P(X = r) = ⁿCᵣ pʳ qⁿ⁻ʳ.
  • Mean = np, variance = npq, standard deviation = √(npq).
  • P(at least one success) = 1 − qⁿ.

Common questions

What do the events E and A mean in Bayes’ theorem?

The events E₁, E₂, … are the possible causes (the machine, the bag, whether a person has the disease). A is what you have observed (a defective item, a red ball, a positive test). P(E | A) is the chance of each cause now that you know A happened.

When do I use the binomial distribution?

When there is a fixed number n of independent trials and each one has the same chance p of success: tossing a coin 5 times, throwing a die 4 times, testing 10 items.

How do I find “at least” and “at most” probabilities?

Give r and the page shows P(X = r), P(X ≤ r), P(X < r), P(X ≥ r) and P(X > r) together. “At least one” is 1 − qⁿ.

Practise on real ISC questions

More Mathematics tools

All study tools →