Utilia

Probability Calculator

Probability calculator with exact fractions and steps for AND/OR, Bayes' theorem, at least one success, binomial distribution and odds.

Probabilities can be typed as a fraction (1/6), a decimal (0.25) or a percentage (25%).

Result Fraction Decimal Percent

Step by step

How to use the probability calculator

  1. Pick a type of problem in Calculation: Single event (favourable ÷ possible), Complement (not A), Two events (A and B, A or B), Conditional probability (Bayes’ theorem), At least one success in n trials, Binomial distribution, Odds to probability, or Probability to odds.
  2. Fill in the fields. Probabilities can be typed as a fraction (1/6), a decimal (0.25) or a percentage (25%). Counts such as n – number of trials must be whole numbers.
  3. For two events, choose the Relationship between A and B: Independent, Mutually exclusive, or I know P(A and B). For odds, say whether they are Odds in favour (for) or Odds against.
  4. Results update as you type (the Calculate button does the same). Each result is shown as an exact Fraction, a Decimal and a Percent, and Step by step shows the formula with your numbers. Copy copies the result table as text.

The tool works with exact fractions: 1/6 stays 1/6 instead of becoming 0.1666…, so the answer to “at least one six in four rolls” is exactly 671/1296. When a fraction gets too long to read, only the decimal is shown.

The formulas used

  • Single event: P(A) = favourable outcomes ÷ possible outcomes, when all outcomes are equally likely.
  • Complement: P(not A) = 1 − P(A).
  • Independent events: P(A and B) = P(A) × P(B).
  • Mutually exclusive events: P(A and B) = 0, so P(A or B) = P(A) + P(B).
  • Addition rule (any events): P(A or B) = P(A) + P(B) − P(A and B).
  • Conditional probability: P(A | B) = P(A and B) ÷ P(B).
  • Bayes’ theorem: P(A | B) = P(B | A) × P(A) ÷ P(B), with P(B) = P(B | A) × P(A) + P(B | not A) × P(not A).
  • At least one success: 1 − (1 − p)ⁿ.
  • Binomial distribution: P(X = k) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ, with mean np and variance np(1 − p).
  • Odds: odds for a:b give P = a ÷ (a + b); odds against a:b give P = b ÷ (a + b).

Bayes’ theorem and the 2 × 2 table

The Bayes mode is built for questions like “a test is 95% sensitive with a 5% false positive rate, and 1% of people have the condition: what is the chance that a positive result is a true positive?” Enter P(A) – prior (base rate) = 1%, P(B | A) – true positive rate = 95% and P(B | not A) – false positive rate = 5%. The answer, P(A | B) = 19/118 ≈ 16.1%, surprises most people: because the condition is rare, false positives outnumber true ones. The 2 × 2 table of joint probabilities shows all four combinations (A and B, A and not B, not A and B, not A and not B) with their totals, and the steps restate it as natural frequencies out of 10,000 people.

Binomial results and large numbers

The binomial mode gives P(X = k), P(X < k), P(X ≤ k), P(X > k) and P(X ≥ k) together, plus the mean, variance and standard deviation. Up to 1,000 trials every value is computed exactly with big integers. From 1,001 to 100,000 trials the tool switches to floating-point arithmetic in log space and says so in the steps; the results are then accurate approximations. The “at least one success” mode accepts up to 1,000,000 trials and also tells you how many trials give a 50% and a 95% chance of at least one success.

Frequently asked questions

What is the difference between independent and mutually exclusive events?

Independent events do not influence each other: rolling a six does not change the next roll, so you multiply the probabilities. Mutually exclusive events cannot happen together, like rolling a 1 and a 2 on the same die, so P(A and B) = 0 and you add the probabilities.

How do I calculate the chance of at least one success?

Compute the chance of no success at all, (1 − p)ⁿ, and subtract it from 1. For four rolls of a die, 1 − (5/6)⁴ = 671/1296 ≈ 51.8%. Adding 1/6 four times would wrongly give 2/3.

What do odds of 3:2 mean?

Odds in favour of 3:2 mean 3 chances of winning for 2 of losing, out of 5 in total, so P = 3/5 = 60%. Odds against 3:2 mean the reverse: P = 2/5. Decimal odds, used by bookmakers, are 1 ÷ P.

Why is P(A | B) different from P(B | A)?

They answer different questions. P(positive | ill) is the sensitivity of a test, while P(ill | positive) also depends on how common the illness is. Confusing the two is a classic mistake, which is why the tool shows both the table and the formula.

Why does the tool show "–" in the Fraction column?

For some inputs, such as 500 trials with p = 0.37, the exact fraction has hundreds of digits. The value is still computed exactly, but only the decimal and percentage are displayed.