ThisCalculator

Everyday

How to Calculate Probability of A and B

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

This calculator finds the probability that both of two events, A and B, occur together, written as P(A and B) or P(A ∩ B). You enter the probability of each event and, if the events are not independent, the conditional probability of one given the other. The calculator returns the joint probability, with the formula and a worked example below.

Formula

The general formula for the probability that both A and B happen is:

P(A and B) = P(A) × P(B|A)

where:

  • P(A) is the probability that event A occurs (a number between 0 and 1).
  • P(B|A) is the conditional probability that B occurs given that A has already occurred (also between 0 and 1).

If A and B are independent (the occurrence of A does not change the probability of B), then P(B|A) = P(B), and the formula simplifies to:

P(A and B) = P(A) × P(B)

This is the multiplication rule of probability. It works for any two events, whether they are independent or not, as long as you use the correct conditional probability.

Worked Example

Using the default values from the calculator:

  • P(A) = 0.5
  • P(B) = 0.4
  • P(B|A) = 0.6

Step 1: Identify which formula to use. Since P(B|A) is given and differs from P(B), the events are not independent, so we use the general formula.

Step 2: Multiply P(A) by P(B|A):

P(A and B) = 0.5 × 0.6 = 0.30

Step 3: The calculator also shows what the joint probability would be if the events were independent:

P(A) × P(B) = 0.5 × 0.4 = 0.20

So, with the given values, the probability that both A and B occur is 0.30 (or 30%). The independent calculation gives 0.20 (20%), which is different because the events are not independent.

When to Use This

Use this calculation whenever you need the probability that two events both happen. Common situations include:

  • Drawing two cards from a deck without replacement (e.g., both are hearts).
  • Finding the probability that a randomly selected person is both female and left-handed, given conditional probabilities.
  • Combining probabilities in a sequence of events, like the chance of rain on two consecutive days.
  • Quality control: the chance that a product has two different defects.

The result is always a number between 0 and 1. Multiply by 100 to express it as a percentage. A result close to 0 means the joint event is very unlikely; close to 1 means it is almost certain.

Common Mistakes

  • Using the independent formula when events are not independent. This is the most frequent error. If P(B|A) is not equal to P(B), you must use the general formula.
  • Confusing P(A and B) with P(A or B). P(A or B) is the probability that at least one occurs, and uses addition, not multiplication.
  • Forgetting that probabilities are decimals. If you enter 50% as 50 instead of 0.5, the result will be wrong. Always convert percentages to decimals (divide by 100).
  • Assuming independence without checking. Just because two events seem unrelated does not mean they are independent. Verify that P(B|A) equals P(B) before using the simple product.
  • Misreading conditional probability. P(B|A) is not the same as P(A|B). Make sure you use the correct direction.

Tips

  • Write down what each symbol means before you start. This prevents mix-ups between P(A), P(B), and P(B|A).
  • Use the independent result as a check. If your general result is very different from the independent result, the events are strongly dependent.
  • If you have P(A and B) and need P(B|A), rearrange the formula: P(B|A) = P(A and B) / P(A).
  • Always check that your final probability is between 0 and 1. If it is not, you have likely made an arithmetic error.
  • When working with percentages, convert them to decimals first, then multiply, then convert back if needed.

Troubleshooting

My result is larger than 1. This means you probably entered percentages as whole numbers (e.g., 50 instead of 0.5). Divide all inputs by 100.

My result is 0 when it should not be. Check that none of your inputs are 0 unless they truly are. Also verify that you did not accidentally swap P(A) and P(B|A).

I do not know P(B|A). If the events are independent, use P(B) instead. If they are not independent, you need to find P(B|A) from data or a problem statement. Without it, the calculation cannot be done.

I get a different answer than the calculator. Double-check that you entered the numbers in the correct fields. The calculator uses P(A) × P(B|A) for the main result, not P(A) × P(B).

My events are mutually exclusive. If A and B cannot happen together, then P(A and B) = 0 by definition. The formula still works: P(B|A) would be 0, so the product is 0.

Frequently Asked Questions

Q: What is the difference between P(A and B) and P(A or B)?
A: P(A and B) is the chance that both happen. P(A or B) is the chance that at least one happens. P(A or B) = P(A) + P(B) − P(A and B).

Q: Can I use this for more than two events?
A: Yes, you can extend the multiplication rule. For three events, P(A and B and C) = P(A) × P(B|A) × P(C|A and B). The calculator handles two events, but the principle generalizes.

Q: What does “independent” mean in probability?
A: Two events are independent if the occurrence of one does not change the probability of the other. Mathematically, P(B|A) = P(B). For example, flipping a coin twice: the outcome of the first flip does not affect the second.

Q: How do I find P(B|A) if I only have P(A), P(B), and P(A and B)?
A: Use the definition: P(B|A) = P(A and B) / P(A). For example, if P(A and B) = 0.2 and P(A) = 0.5, then P(B|A) = 0.2 / 0.5 = 0.4.

Q: Is P(A and B) always less than P(A)?
A: Yes, because P(A and B) = P(A) × P(B|A), and P(B|A) is between 0 and 1. So P(A and B) ≤ P(A). The same holds for P(B).

Q: What if my probabilities are given as odds, like 3 to 1?
A: Convert odds to probability first. Odds of 3 to 1 mean probability = 3 / (3+1) = 0.75. Then use the calculator.

Related

Formula used
in p_a | P(A) | - | 0.5 | 0
in p_b | P(B) | - | 0.4 | 0
in p_b_given_a | P(B|A) | - | 0.6 | 0
out p_and | P(A and B) | - | p_a * p_b_given_a | 4
out p_and_ind | P(A and B) if independent | - | p_a * p_b | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.