Tools · Math & Statistics

Probability Calculator

Give two probabilities and get every figure they imply: the complements, the chance of both, the chance of either, both conditional probabilities, and the odds form of each. Then see what happens when the first event is repeated — the number that catches almost everyone out.

Independence is asked for, never assumed silentlyHow it worksInputs stay on this device
Your inputs

Two events, and a repeat count

A number from 0 to 1, where 0.5 is a coin flip. A percentage divided by 100 — 25% is 0.25.

The second event, on the same 0-to-1 scale.

Leave this blank and the tool multiplies P(A) by P(B), which is only correct when the two events are independent. If you know they move together — rain today and rain tomorrow, two loans in the same industry — put the real figure here instead.

How many times A gets its chance. Used only for the at-least-once figures below.

Your inputs are calculated locally and are not stored.
At least one of A or B — P(A ∪ B)0.65

65% of the time. Both happen 15% of the time, taken as P(A) × P(B) because no joint probability was given — that assumes the two events are independent. Across 10 repeats, A happens at least once 99.9% of the time.

At least one A in 10 trials
99.9%
No A at all in 10 trials
0.09766%
Expected number of A
5
Neither A nor B — P(A′ ∩ B′)
0.35
Joint probability
Assumed independent
Every probability this pair of events implies, as a decimal, a percentage, and the odds in favour
EventProbabilityPercentOdds for
A happens — P(A)0.550%1 : 1
A does not happen — P(A′)0.550%1 : 1
B happens — P(B)0.330%1 : 2.333
B does not happen — P(B′)0.770%2.333 : 1
Both happen — P(A ∩ B)0.1515%1 : 5.667
At least one happens — P(A ∪ B)0.6565%1.857 : 1
A, given that B happened — P(A|B)0.550%1 : 1
B, given that A happened — P(B|A)0.330%1 : 2.333
Formula & methodology

Five rules, and one assumption worth arguing about

Everything on this page comes out of the same handful of identities. Only one of them depends on a claim about the world, and that one is the reason the tool has an optional third input.

P(A′) = 1 − P(A)  •  P(A ∩ B) = P(A) × P(B)  •  P(A ∪ B) = P(A) + P(B) − P(A ∩ B)  •  P(A|B) = P(A ∩ B) ÷ P(B)  •  P(≥1 in n) = 1 − (1 − p)ⁿ
P(A′)
The complement — the chance A does not happen
P(A ∩ B)
The intersection — both happen. The × form holds only for independent events
P(A ∪ B)
The union — at least one of the two happens
P(A|B)
Conditional — the chance of A once B is known to have happened
n, p
How many independent repeats, and the chance on each one

Why multiplication is a claim, not a rule

P(A ∩ B) = P(A) × P(B) is the definition of independence, not a general law. It holds when knowing that B happened leaves your estimate of A untouched, and it fails whenever the two events share a cause. Two coin flips qualify. Rain on Tuesday and rain on Wednesday do not. Neither do two loans to firms in the same industry, two hard drives from the same production batch, or two flights routed through the same airport in the same storm.

The failure is not symmetric, which is what makes it dangerous. Real events are far more often positively correlated than negatively, so multiplying independently almost always understates the chance that both go wrong at once. That is the arithmetic behind a good deal of underestimated risk — from portfolio models to redundant systems that turn out to share a power supply. Leave the third field blank here and the tool will multiply, but it will say on screen that it did.

Why the union subtracts the overlap

Add P(A) and P(B) and everything that counts as both has been counted twice. Subtracting P(A ∩ B) removes the duplicate. It is the same inclusion–exclusion step you would use to count students taking French or German without double-counting the ones taking both. If the answer ever comes out above 1, the overlap was not subtracted.

Why 1 − (1 − p)ⁿ is not computed as written

For a small p, the quantity 1 − p rounds to a double that has already lost the information p carried, and the final subtraction then cancels the digits that survived. This calculator evaluates the same expression as −expm1(n × log1p(−p)), which stays accurate for probabilities down to the smallest a computer can represent and still returns exactly 1 at p = 1 and exactly 0 at p = 0.

Worked example

A 1-in-100 risk, run 100 times

A part fails on 1% of installations, so p = 0.01. You are about to install 100 of them. How many failures should you expect, and what is the chance of getting through with none?

The expected count is the easy one: 100 × 0.01 = 1 failure. That number is exact and it is also almost useless on its own, because it says nothing about how likely one actually is.

For that, work with the complement. Each installation survives with probability 1 − 0.01 = 0.99. All hundred survive with probability 0.99¹⁰⁰ = 0.366. So the chance of at least one failure is 1 − 0.366 = 0.634, or 63.4%. Put the other way round: a 1-in-100 risk repeated 100 times leaves you failure-free 36.6% of the time — not 0%, which is what the expected count of 1 suggests to most people, and not 100% either.

Now a second event. Suppose the installer is also short-staffed that week, with probability 0.3, and you treat the two as independent. Then both happen 0.01 × 0.3 = 0.003 of the time, and at least one happens 0.01 + 0.3 − 0.003 = 0.307 of the time. Given a short-staffed week, the chance of a part failure is P(A|B) = 0.003 ÷ 0.3 = 0.01 — unchanged, which is exactly what independence means. If you believe rushed installations break parts, that assumption is wrong, and the fix is to put a larger joint probability in the third field and watch every other figure move.

Assumptions

What this calculator assumes

  • Probabilities are decimals from 0 to 1, not percentages. Divide a percentage by 100 first: 25% goes in as 0.25.
  • When the joint probability is left blank, the two events are taken to be independent. That is an assumption about your situation and the tool cannot check it — the result panel says whenever it has been made.
  • A supplied joint probability is checked against the Fréchet bounds, so it cannot exceed either event nor fall below P(A) + P(B) − 1. Values outside that window describe no pair of events and are rejected rather than silently used.
  • The repeated-trials figures assume the n repeats are independent of each other and that p is the same every time. Neither holds for something that wears out, learns, or gets fixed after the first failure.
  • Odds are quoted in favour — p to (1 − p). Betting markets usually quote odds against, so the same 3 to 1 means a very different thing on a betting slip.
  • Figures are rounded to twelve significant figures rather than a fixed number of decimals, so a one-in-a-million intersection still comes back as 0.000001 and not as zero.
Common questions

Probability FAQ

How do I work out the probability of A or B?

Add the two probabilities and subtract the overlap: P(A or B) = P(A) + P(B) − P(A and B). The subtraction is the whole trick. Anything that counts as both A and B has been added twice — once in P(A) and once in P(B) — so it has to come out once. Skipping that step is why probabilities sometimes come out above 1, which is a signal the arithmetic is wrong rather than a very likely event.

What is the difference between P(A and B) and P(A given B)?

P(A and B) is the chance that both happen, measured against everything that could happen. P(A|B) is the chance A happens once you already know B did, measured against the smaller world where B is true. They are related by P(A|B) = P(A and B) ÷ P(B) — dividing by P(B) is exactly the act of shrinking the denominator to the cases where B occurred. A test that is positive 5% of the time and correct 90% of the time when positive gives 0.05 and 0.90 for those two figures respectively; confusing them is the classic base-rate error.

If something has a 1% chance, does it happen once in 100 tries?

Not reliably. The expected count is exactly 1, but the chance of it happening at least once is 1 − 0.99^100 = 63.4%, which means it fails to happen at all more than a third of the time. Expected value and probability are different questions, and this is the case where the difference bites hardest. The tool reports both side by side for that reason.

How do I convert a probability into odds?

Odds in favour are p ÷ (1 − p). A probability of 0.75 is 3 ÷ 1, quoted as 3 to 1 on. A probability of 0.3 is 0.3 ÷ 0.7 = 0.4286, which reads better as 1 to 2.333 — roughly 1 in 3.33. Going the other way, a probability is odds ÷ (odds + 1). Note that gambling odds are usually quoted against, so 3 to 1 on a betting slip normally means a probability of 0.25, not 0.75.

What does it mean for two events to be independent?

That knowing one happened tells you nothing about the other: P(A|B) = P(A). Two dice are independent. Two coin flips are independent. Rain today and rain tomorrow are not. Nor are two mortgages in the same town, two servers in the same rack, or two flights on the same weather front. Independence is a claim about the world, so the tool asks for the joint probability rather than assuming it, and says on screen whenever it has assumed it for you.

Why did the calculator reject the joint probability I entered?

Because no pair of events could have it. P(A and B) can never exceed either individual probability — the overlap of two sets is no larger than the smaller set — and it can never fall below P(A) + P(B) − 1, because two events that between them cover more than the whole sample space must overlap by at least the excess. Those are the Fréchet bounds, and a value outside them describes nothing.

Primary sources

Sources and review notes

  1. NIST/SEMATECH e-Handbook of Statistical Methods — the reference definitions of probability, independence and conditional probability used here
  2. NIST/SEMATECH e-Handbook §1.3.6 — probability distributions, including the repeated-Bernoulli case behind the at-least-once figure
  3. JCGM publications (BIPM) — the measurement-uncertainty guides, for readers who need probability attached to a measured quantity rather than a counted event

The identities on this page are definitional and have no data behind them to go stale. The sources are cited for vocabulary and for the standard statements of the rules, not for any figure the calculator produces.