Of the 8 fields below, fill in only the two you know. Treating the two events as independent, all the remaining probabilities are worked out backward.
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
- Two events come with 8 probabilities: that each one happens or does not, that both happen, \(P(A \cap B)\), that at least one happens, \(P(A \cup B)\), and more. Enter the two you know, and all the rest are worked out backward
- It is built for "backward" questions that an ordinary calculator cannot easily answer, such as "At least one happens 58% of the time and both happen 12% of the time. What is the probability of each?"
- It shows not just the answers but every step of the work, so you can use it to check homework or your own calculations
- 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?
From a survey result such as "58% of people know at least one of products A and B, and 12% know both", you can work out the awareness of each product (30% and 40%). (This is a model calculation that treats awareness of the two as independent.)
In marketing you often have only the combined, summarized numbers. This backward calculation helps when you want to pull the individual numbers out of them.
"On 14.5% of days in the year, at least one of two machines broke down. On 0.5% of days, both broke down at the same time." From these records you can work out the failure rate of each machine (5% and 10%).
Real data often records only the combined results, so estimating the individual probabilities from them is a common idea in equipment maintenance and process improvement.
Two people check documents. Past results show that "at least one of them finds a mistake 90% of the time, and both find it 40% of the time". From this you can work out each person's detection rate (80% and 50%). (This is a model calculation that treats their checks as independent.)
You can estimate each checker's skill from past results without testing them one by one, so you can rethink the setup (who should work with whom, or whether one person is enough) based on numbers.
From a survey result such as "85% of people own at least one of a smartphone and a tablet, and 35% own both", you can work out the ownership rate of each (70% and 50%). (This is a rough estimate that treats owning the two as independent.)
Published statistics sometimes give only numbers in the form "at least one" and "both". You can use this to pull out the individual rates you want to know.
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. Drawing a second ticket without putting the first one back is not independent, because the first result changes the probability of the second. The backward calculation on this page is only for independent events. |
| complement | The opposite event, that the event does not happen. If the probability of happening is 0.3, the probability of not happening (the probability of the complement) is \(1 - 0.3 = 0.7\). |
| system of equations | A way to find two unknown numbers by combining two equations. The backward calculation on this page solves a system of equations in the two unknowns \(P(A)\) and \(P(B)\). |
| quadratic equation | Finding "two numbers that add up to \(S\) and multiply to \(P\)" leads to a quadratic equation. Most of the backward calculations on this page end up in this form. |
| quadratic formula | The formula that solves any quadratic equation step by step, \(x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}\). The quadratic equations that the calculations on this page end up with are solved with it. |
| discriminant | The part under the square root in the quadratic formula, \(b^2 - 4ac\). If it is positive there are two solutions, if it is 0 there is exactly one, and if it is negative no number fits (no real solution). A negative discriminant is the most common reason this page shows "no solution". |
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.
| Basic probability (Grade 7) |
|
| Probability of two independent events (a companion page on this site) |
|
| Linear equations (Grades 7–8) |
|
| Quadratic equations and the quadratic formula (Algebra 1) |
|
How to calculate it in Excel
| Both happen, P(A∩B) | 0.12 |
| At least one happens, P(A∪B) | 0.58 |
| P(A) (the smaller solution) | =(B1+B2-SQRT((B1+B2)^2-4*B1))/2 |
| P(B) (the larger solution) | =(B1+B2+SQRT((B1+B2)^2-4*B1))/2 |
It uses the relations P(A) + P(B) = P(A∪B) + P(A∩B) and P(A) × P(B) = P(A∩B), and solves the resulting quadratic equation with the quadratic formula.
SQRT is the function for the square root. Inputs that make the number under the square root negative have no solution and show an error (#NUM!).
For other combinations (for example, when you know P(A) and P(A∪B)), use the "Step by step" section that this page's calculator shows as a guide.
How to calculate it in Google Sheets
| Both happen, P(A∩B) | 0.12 |
| At least one happens, P(A∪B) | 0.58 |
| P(A) (the smaller solution) | =(B1+B2-SQRT((B1+B2)^2-4*B1))/2 |
| P(B) (the larger solution) | =(B1+B2+SQRT((B1+B2)^2-4*B1))/2 |
How to calculate it in Python
import math
p_both = 0.12 # both happen, P(A∩B)
p_at_least_one = 0.58 # at least one happens, P(A∪B)
sum_of_pa_pb = p_at_least_one + p_both # P(A) + P(B)
product_of_pa_pb = p_both # P(A) × P(B)
discriminant = sum_of_pa_pb ** 2 - 4 * product_of_pa_pb # discriminant of the quadratic equation
if discriminant < 0:
print("No solution (no probabilities fit this combination)")
else:
sqrt_of_discriminant = math.sqrt(discriminant)
p_a = (sum_of_pa_pb - sqrt_of_discriminant) / 2
p_b = (sum_of_pa_pb + sqrt_of_discriminant) / 2
print(f"P(A) = {p_a}, P(B) = {p_b}")
How to write it in LaTeX and other math languages (copy and paste)
P(A∩B) = P(A) × P(B), P(A∪B) = P(A) + P(B) − P(A)×P(B)
P(A \cap B) = P(A)\,P(B), \quad P(A \cup B) = P(A) + P(B) - P(A)\,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>
<mi>P</mi><mo>(</mo><mi>B</mi><mo>)</mo>
<mo>,</mo>
<mspace width="1em"></mspace>
<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>P</mi><mo>(</mo><mi>B</mi><mo>)</mo>
</mrow>
</math>
P(A nn B) = P(A) P(B), P(A uu B) = P(A) + P(B) - P(A) P(B)
Solve[{pa*pb == 0.12, pa + pb - pa*pb == 0.58}, {pa, pb}]
solve({pa*pb = 0.12, pa + pb - pa*pb = 0.58}, {pa, pb});
syms pa pb; sol = solve(pa*pb == 0.12, pa + pb - pa*pb == 0.58, pa, pb);
P(A∩B) = P(A) × P(B), P(A∪B) = P(A) + P(B) - P(A)×P(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). For two independent events A and B, we know that the probability that both happen is P(A∩B) = 0.12, and the probability that at least one happens is P(A∪B) = 0.58. Find P(A) and P(B). Then also find the probability that each one does not happen, the probability that exactly one happens, P(AΔB), and the probability that neither happens. If there are two solutions, show both. Show the formulas you used and the execution results 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.
