From the probabilities of two events that do not affect each other (independent events), this finds the probability that both happen, that at least one happens, and more. Enter each probability as a number from 0 to 1 (for example, 30% is 0.3).
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and figures
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter the probability of each of two events, and you get the probability that both happen, \(P(A \cap B)\), and that at least one happens, \(P(A \cup B)\), on the spot
- It also calculates the probability that exactly one happens, \(P(A \Delta B)\), that neither happens, that only A happens, and more, all at once
- Questions like "There is a 50% chance of sun on day 1 of my trip and a 30% chance on day 2. What is the chance of sun on both days?" are solved in one step
- A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
If there is a 50% chance of sun on day 1 and a 30% chance on day 2, the chance of sun on both days is only \(0.5 \times 0.3 = 0.15\) (15%). (This is a rough estimate that treats the two days' weather as independent.)
Because you multiply the probabilities, the chance that "both go well" is often much smaller than you expect. Having a feel for this number changes how you make plans.
If you apply to your first-choice college with a 50% chance of admission and to a second college with a 30% chance, the chance of getting into at least one is \(0.5 + 0.3 - 0.15 = 0.65\) (65%). (This assumes the two decisions are independent.)
For a big life choice, you can check with numbers, not just gut feeling, how much adding another option raises your overall chance of success.
If you store the same data on two disks that each have a 1% chance of failing in a year, the chance of losing both at once drops to \(0.01 \times 0.01 = 0.0001\) (1 in 10,000), as long as the failures are independent.
"Double your safeguards and the risk shrinks by multiplication." This idea is the basis of every kind of preparation, from backing up your photos to storing emergency supplies in more than one place.
If you are told "the surgery has a 90% success rate, and there is a 95% chance of no complications afterward", the chance that both go well is \(0.9 \times 0.95 = 0.855\) (85.5%). (This is a guide that treats the two as independent.)
For critical life decisions such as choosing a treatment, being able to calculate the overall outlook when several probabilities combine helps you make a decision you are comfortable with.
In a product that uses two parts, each good 99% of the time, the probability that both parts are good is \(0.99 \times 0.99 = 0.9801\) (98.01%).
Quality control staff in manufacturing repeat this calculation for every part to estimate the pass rate of the whole product, and work backward to find the defect rate allowed for each part.
Formulas and figures
Symbols and terms
Symbols
| \(P(A)\) | P of A | The probability that event A happens. P is the first letter of "probability". |
| \(A'\) | A prime (complement) | The event "A does not happen", called the complement of A. Also written \(A^c\) or \(\overline{A}\). It is found with \(P(A') = 1 - P(A)\). |
| \(\cap\) | cap (intersection) | The symbol for "and". \(A \cap B\) is the event "both A and B happen". In a Venn diagram it is the part where the two circles overlap. |
| \(\cup\) | cup (union) | The symbol for "or". \(A \cup B\) is the event "at least one of A and B happens". In a Venn diagram it is everything inside the two circles. |
| \(\Delta\) | delta (symmetric difference) | The symbol for "exactly one". \(A \Delta B\) is the event "exactly one of A and B happens (not both)". |
Terms
| event | Something that either happens or does not, such as "rolling a 6" or "rain tomorrow". In probability, such outcomes are called events and are given names like A and B. |
| independent | When the result of one event does not change how likely the other is. A die roll and a coin toss are independent. Drawing a second ticket without putting the first one back is not, because the first result changes the probability of the second. This calculator is only for independent events. |
| complement | The opposite event, that the event does not happen. If the probability of happening is 0.2, the probability of not happening (the probability of the complement) is \(1 - 0.2 = 0.8\). |
| intersection | Both of two events happen. The symbol is \(A \cap B\) (read "A and B"). For independent events, the probability is the product \(P(A) \times P(B)\). |
| union | At least one of two events happens. The symbol is \(A \cup B\) (read "A or B"). Its probability is the sum minus the overlap \(P(A \cap B)\), subtracted once. |
| symmetric difference | Exactly one of two events happens (not both). The symbol is \(A \Delta B\). In logic it is called "exclusive or" (XOR). |
| mutually exclusive | Two events that cannot happen at the same time. Example - on a single die roll, "an even number" and "an odd number" are mutually exclusive. Be careful - this is a different idea from "independent". |
| inclusion-exclusion principle | A counting rule for "or" probabilities. Simply adding counts the "both happen" case twice, so you subtract the overlap once. It is the basis of the union formula \(P(A \cup B) = P(A) + P(B) - P(A \cap B)\). |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over the topics in this list is the fastest way forward.
| Basic probability (Grade 7) |
|
| Percents and decimals (Grade 6) |
|
| Multiplying fractions (Grade 5) |
|
| Sets and Venn diagrams (high school) |
|
How to calculate it in Excel
| Probability of A, P(A) | 0.2 |
| A does not happen, P(A') | =1-B1 |
| Probability of A, P(A) | 0.5 |
| Probability of B, P(B) | 0.3 |
| Both happen, P(A∩B) | =B1*B2 |
| Probability of A, P(A) | 0.5 |
| Probability of B, P(B) | 0.3 |
| At least one happens, P(A∪B) | =B1+B2-B1*B2 |
| Probability of A, P(A) | 0.5 |
| Probability of B, P(B) | 0.3 |
| Exactly one happens, P(AΔB) | =B1+B2-2*B1*B2 |
In a formula, "B1" and "B2" mean "use the number in that cell", and "*" is multiplication. Just replace the input numbers with your own probabilities.
In the second table, for example, B3 shows 0.5 × 0.3 = 0.15. Only the first table (the complement) has a single input in B1, with the result in B2.
How to calculate it in Google Sheets
| Probability of A, P(A) | 0.2 |
| A does not happen, P(A') | =1-B1 |
| Probability of A, P(A) | 0.5 |
| Probability of B, P(B) | 0.3 |
| Both happen, P(A∩B) | =B1*B2 |
| Probability of A, P(A) | 0.5 |
| Probability of B, P(B) | 0.3 |
| At least one happens, P(A∪B) | =B1+B2-B1*B2 |
| Probability of A, P(A) | 0.5 |
| Probability of B, P(B) | 0.3 |
| Exactly one happens, P(AΔB) | =B1+B2-2*B1*B2 |
Just replace the input numbers with your own probabilities.
How to calculate it in Python
p_a = 0.5 # probability that event A happens
p_b = 0.3 # probability that event B happens
p_both = p_a * p_b # both happen, P(A∩B)
p_at_least_one = p_a + p_b - p_both # at least one, P(A∪B)
p_exactly_one = p_a + p_b - 2 * p_both # exactly one, P(AΔB)
p_neither = 1 - p_at_least_one # neither happens
print(f"Both happen: {p_both}")
print(f"At least one happens: {p_at_least_one}")
print(f"Exactly one happens: {p_exactly_one}")
print(f"Neither happens: {p_neither}")
How to write it in LaTeX and other math languages (copy and paste)
P(A′) = 1 − P(A)
P(A') = 1 - P(A)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>P</mi><mo>(</mo>
<msup><mi>A</mi><mo>′</mo></msup>
<mo>)</mo>
<mo>=</mo>
<mn>1</mn>
<mo>−</mo>
<mi>P</mi><mo>(</mo><mi>A</mi><mo>)</mo>
</mrow>
</math>
P(A') = 1 - P(A)
1 - pA
pNotA := 1 - pA;
p_not_a = 1 - p_a;
P(A′) = 1 - P(A)
P(A∩B) = P(A) × P(B)
P(A \cap B) = P(A) \times P(B)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>P</mi><mo>(</mo><mi>A</mi><mo>∩</mo><mi>B</mi><mo>)</mo>
<mo>=</mo>
<mi>P</mi><mo>(</mo><mi>A</mi><mo>)</mo>
<mo>×</mo>
<mi>P</mi><mo>(</mo><mi>B</mi><mo>)</mo>
</mrow>
</math>
P(A nn B) = P(A) xx P(B)
pA*pB
pAandB := pA*pB;
p_a_and_b = p_a*p_b;
P(A∩B) = P(A) × P(B)
P(A∪B) = P(A) + P(B) − P(A∩B)
P(A \cup B) = P(A) + P(B) - P(A \cap B)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>P</mi><mo>(</mo><mi>A</mi><mo>∪</mo><mi>B</mi><mo>)</mo>
<mo>=</mo>
<mi>P</mi><mo>(</mo><mi>A</mi><mo>)</mo>
<mo>+</mo>
<mi>P</mi><mo>(</mo><mi>B</mi><mo>)</mo>
<mo>−</mo>
<mi>P</mi><mo>(</mo><mi>A</mi><mo>∩</mo><mi>B</mi><mo>)</mo>
</mrow>
</math>
P(A uu B) = P(A) + P(B) - P(A nn B)
pA + pB - pA*pB
pAorB := pA + pB - pA*pB;
p_a_or_b = p_a + p_b - p_a*p_b;
P(A∪B) = P(A) + P(B) - P(A∩B)
P(AΔB) = P(A) + P(B) − 2P(A∩B)
P(A \Delta B) = P(A) + P(B) - 2P(A \cap B)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>P</mi><mo>(</mo><mi>A</mi><mo>Δ</mo><mi>B</mi><mo>)</mo>
<mo>=</mo>
<mi>P</mi><mo>(</mo><mi>A</mi><mo>)</mo>
<mo>+</mo>
<mi>P</mi><mo>(</mo><mi>B</mi><mo>)</mo>
<mo>−</mo>
<mn>2</mn>
<mi>P</mi><mo>(</mo><mi>A</mi><mo>∩</mo><mi>B</mi><mo>)</mo>
</mrow>
</math>
P(A Delta B) = P(A) + P(B) - 2 P(A nn B)
pA + pB - 2*pA*pB
pAxorB := pA + pB - 2*pA*pB;
p_a_xor_b = p_a + p_b - 2*p_a*p_b;
P(AΔB) = P(A) + P(B) - 2P(A∩B)
How to have ChatGPT do the calculation
You are a probability calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). Event A has probability 0.5 and event B has probability 0.3. A and B are independent. Find each of the following: 1. The probability that both A and B happen, P(A∩B) 2. The probability that A or B (at least one) happens, P(A∪B) 3. The probability that exactly one of them happens, P(AΔB) 4. The probability that neither happens Show the formulas you used and the numbers from the execution result in a table.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
