gizmobench

Event Probability Calculator

Enter P(A) and P(B) as decimals, percentages or fractions, then say how the two events relate: independent, mutually exclusive, or with P(A and B), P(A given B) or P(B given A) typed in. Independence is never assumed for you. The page works out the intersection, the union, both complements, four conditional probabilities, A only, B only, neither and exactly one, each derived line printed with its formula and your numbers in it, and the two-event arithmetic is kept in exact fractions, so 0.1 + 0.2 comes out as 0.3. Entries that cannot all be true together are refused against the bounds max(0, P(A) + P(B) - 1) and min(P(A), P(B)), with the range that would work. A Venn diagram whose circle and overlap areas are drawn to scale follows the numbers, a repeat section gives the chance of an event at least once, every time or never in up to 1,000 independent tries, and the diagram downloads as SVG or PNG.

eventsA and B

Type each probability as a decimal (0.25), a percentage (25%) or a fraction (1/4).

How A and B relate

Type the probability that A and B both happen.

Event repeated

Each try repeats the whole experiment, independently of the others, with the same probabilities.

Feasible P(A and B) for these entries

from max(0, 0.5 + 0.4 - 1) = 0 to min(0.5, 0.4) = 0.4

Venn diagramAB0.30.20.2
Circles A and B overlap. A only 0.3, A and B 0.2, B only 0.2, outside both 0.3, total 1. The circles and their overlap are drawn to scale with each other; the box around them stands for everything else and is not to scale.
resultsfrom your entries, ≈ marks rounding
P(A and B)
0.2, entered
P(A or B)
0.5 + 0.4 - 0.2 = 0.7
P(not A)
1 - 0.5 = 0.5
P(not B)
1 - 0.4 = 0.6
P(A given B)
0.2 / 0.4 = 0.5
P(B given A)
0.2 / 0.5 = 0.4
A only
0.5 - 0.2 = 0.3
B only
0.4 - 0.2 = 0.2
Neither
1 - 0.7 = 0.3
Exactly one
0.7 - 0.2 = 0.5
P(A given not B)
0.3 / 0.6 = 0.5
P(B given not A)
0.2 / 0.5 = 0.4
A at least once in 2 tries
1 - (1 - 0.5)^2 = 1 - 0.25 = 0.75
A in all 2 tries
(0.5)^2 = 0.25
A in none of the 2 tries
(1 - 0.5)^2 = 0.25

With these entries A and B are independent: P(A and B) = 0.2 equals P(A) x P(B) = 0.5 x 0.4 = 0.2.

Binomial, normal and Poisson questions have their own calculators: binomial, normal and Poisson.

Show as
P(A and B)
0.2
P(A or B)
0.7
P(A given B)
0.5
Neither
0.3
  • P(A) 0.5, P(B) 0.4independent, selected
    P(A and B) = 0.5 x 0.4 = 0.2; P(A or B) = 0.5 + 0.4 - 0.2 = 0.7
  • P(A and B) entered as 0.45P(A) 0.5, P(B) 0.4
    rejected: P(A and B) = 0.45 cannot be larger than P(B) = 0.4, because A and B together cannot happen more often than B alone. For these entries P(A and B) runs from 0 to 0.4.
  • At least one success in 2 triesindependent, p = 0.5 each
    1 - (1 - 0.5)^2 = 1 - 0.25 = 0.75
Accuracy. Every figure is exact fraction arithmetic on your entries, and a result that needs rounding for display is shown to six significant figures and marked ≈; a repeat count too long for exact fractions is worked in floating point and marked ≈ the same way. The page describes your assumptions and predicts nothing about real events: A and B are treated as independent only when you select it, and entries that cannot all hold together are refused with the range that would work. Binomial, normal and Poisson questions belong to the distribution calculators linked under the results.

Common questions

How do you calculate the probability of A or B?
P(A or B) = P(A) + P(B) - P(A and B). Adding the two probabilities counts the overlap twice, so it is taken away once. With P(A) = 0.5, P(B) = 0.4 and P(A and B) = 0.2 that is 0.5 + 0.4 - 0.2 = 0.7. For mutually exclusive events the overlap is 0 and the rule becomes a plain sum. The page prints this line with your own numbers in it.
How do you find the probability of A and B?
It depends on how the events relate, which is why the page asks. For independent events P(A and B) = P(A) x P(B), so 0.5 and 0.4 give 0.2. For mutually exclusive events it is 0. From a conditional it is P(A given B) x P(B), or P(B given A) x P(A). If you already know P(A and B), you can type it in directly.
What is the difference between independent and mutually exclusive events?
Independent events do not change each other's chances: P(A given B) equals P(A), and P(A and B) equals P(A) x P(B). Mutually exclusive events cannot happen together: P(A and B) is 0. Two events that each have a probability above 0 cannot be both. When you type in P(A and B) or a conditional, the page checks whether your numbers make A and B independent and says which, with the product it compared against.
How do I calculate conditional probability?
P(A given B) = P(A and B) / P(B): the share of B's probability in which A also happens. With P(A and B) = 0.2 and P(B) = 0.4, P(A given B) is 0.5. It is not defined when P(B) is 0, and the page says undefined rather than dividing by zero. The same entries also give P(B given A), P(A given not B) and P(B given not A).
Why does the calculator say my numbers are impossible?
Two probabilities limit how much the events can overlap. P(A and B) cannot be larger than the smaller of P(A) and P(B), and when P(A) + P(B) is more than 1 the events must overlap by at least P(A) + P(B) - 1. With P(A) = 0.5 and P(B) = 0.4, P(A and B) has to lie between 0 and 0.4, so 0.45 is refused. The message gives the range that would work, and a conditional you type is checked against the same bounds.
What is the probability of something happening at least once?
For independent tries it is 1 minus the chance it never happens: 1 - (1 - p)^n. For p = 0.5 and 2 tries that is 1 - 0.25 = 0.75, and for a 1/6 chance over 3 tries it is 91/216, about 0.421296. The repeat section works this out for A, B, both together or either one, for 1 to 1,000 tries, beside the chance of it happening every time and never.
Can I enter fractions or percentages?
Yes. Each probability can be a decimal such as 0.25, a percentage such as 25% or a fraction such as 1/4, and all three are read as exactly 1/4. Decimals with an exponent, such as 2.5e-7, are read too. Results can be shown as decimals, fractions or percentages. Any value that does not end within twelve decimal places, whether a result or a number inside a line of working, is rounded to six significant figures and marked ≈. The fraction view shows each value exactly, except a fraction longer than 60 characters and a repeat too long for exact fractions, which appear as marked decimals.
Is the Venn diagram drawn to scale?
The two circles have areas in the ratio P(A) to P(B), and the region where they overlap has the area of P(A and B) on the same scale. The box around them stands for everything else and is not to scale, because a circle with the same area as the box would not fit inside it. The diagram downloads as an SVG or a PNG on a white background, with your entries above it and all four region values written underneath.

Every figure is exact fraction arithmetic on your entries, and a result that needs rounding for display is shown to six significant figures and marked ≈; a repeat count too long for exact fractions is worked in floating point and marked ≈ the same way. The page describes your assumptions and predicts nothing about real events: A and B are treated as independent only when you select it, and entries that cannot all hold together are refused with the range that would work. Binomial, normal and Poisson questions belong to the distribution calculators linked under the results.