Probability Calculator (A and B, A or B)
Probability is a number from 0 to 1 that measures how likely an event is. For independent events with P(A) = 0.3 and P(B) = 0.5, P(A and B) = 0.15, P(A or B) = 0.65, and P(neither) = 0.35.
Last updated · By S. Dilshan · Runs in your browser, nothing is uploaded
Step-by-Step Solution
What Is Probability?
Probability measures the chance that something happens, on a scale from 0 (impossible) to 1 (certain). A probability of 0.25 means the event is expected to occur about one time in four over many repetitions. You can also express it as a percentage, 25%, or as odds.
When you combine two events, A and B, the answer depends on how they relate. If knowing that A happened tells you nothing about B, the events are independent, like two separate coin flips. If A and B cannot both happen at the same time, they are mutually exclusive, like rolling a 2 and a 5 on a single die roll. This calculator handles both relationships.
Independent vs Mutually Exclusive Events
| Independent events | Mutually exclusive events | |
|---|---|---|
| Meaning | One outcome does not affect the other | Both cannot happen together |
| P(A and B) | P(A) × P(B) | 0 |
| P(A or B) | P(A) + P(B) − P(A) × P(B) | P(A) + P(B) |
| Example | Heads on two different coins | A single card being a heart and a spade |
| With P(A) = 0.3, P(B) = 0.5 | and = 0.15, or = 0.65 | and = 0, or = 0.8 |
Note that mutually exclusive events with non-zero probabilities are never independent, because if one happens the other becomes impossible.
Probability Rules and Formulas
P(A)andP(B)are the probabilities of the individual events, each between 0 and 1.- The subtraction in the general addition rule stops the overlap, where both happen, from being counted twice.
- For equally likely outcomes, P(event) = favourable outcomes ÷ total outcomes.
Conditional Probability and Odds
The probability of A given that B has happened is P(A | B) = P(A and B) ÷ P(B). For the independent events above, 0.15 ÷ 0.5 = 0.3, which is just P(A). That equality is the definition of independence: learning about B tells you nothing new about A.
Probability can also be quoted as odds. A probability of 0.25 corresponds to odds of 1 to 3 in favour, since 0.25 ÷ 0.75 = 1 ÷ 3.
Worked Example: Two Independent Events
Let P(A) = 0.3 and P(B) = 0.5, and assume they are independent.
- Both happen: 0.3 × 0.5 = 0.15.
- At least one happens: 0.3 + 0.5 − 0.15 = 0.65.
- Neither happens: 1 − 0.65 = 0.35. As a check, (1 − 0.3) × (1 − 0.5) = 0.7 × 0.5 = 0.35.
- Exactly one happens: 0.65 − 0.15 = 0.50.
- Complements: P(not A) = 0.7 and P(not B) = 0.5.
Example with Playing Cards
Draw one card from a standard 52-card deck. P(heart) = 13 ÷ 52 = 0.25 and P(king) = 4 ÷ 52 = 0.0769. These events overlap, because the king of hearts is both. So P(heart or king) = 13 ÷ 52 + 4 ÷ 52 − 1 ÷ 52 = 16 ÷ 52 = 0.3077. Without the subtraction you would count the king of hearts twice.
Example with Two Dice
The chance that two dice sum to 7 is 6 ÷ 36 = 0.1667, since six of the 36 equally likely pairs give 7.
How to Use This Probability Calculator
- Choose whether the events are independent or mutually exclusive.
- Enter P(A) and P(B) as decimals between 0 and 1. Divide a percentage by 100 first.
- Read the probability of both, either, neither and exactly one event, plus the complements.
- Open the steps to see the rule applied.
If you need the probability of A given that B happened, use the Bayes’ theorem calculator. To count arrangements and selections, see the permutation and combination calculator.
Real-World Uses of Probability
- Insurance and risk: estimating the chance of claims or system failures.
- Engineering reliability: if two independent components each work with probability 0.9, a system needing both has probability 0.81.
- Medicine: estimating the chance of side effects or of a test being right.
- Games and decisions: working out odds in card games, lotteries and sports betting.
- Data science: probability is the foundation of statistical inference and machine learning.
What Are the Most Common Mistakes With the Probability Calculator (A and B, A or B)?
- Adding probabilities of overlapping events. Subtract the overlap unless the events are mutually exclusive.
- Assuming independence. Drawing cards without replacement or repeated visits by the same customer are not independent.
- Confusing exclusive and independent. They are different ideas.
- Entering percentages. Convert 30% to 0.3.
- The gambler’s fallacy. A coin that has landed heads five times is still 50% likely to land heads next.
- Impossible inputs. For mutually exclusive events, P(A) + P(B) cannot exceed 1.
Where Can You Verify These Formulas?
The definitions and formulas on this page follow standard references. Check them against these sources:
Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.
Frequently Asked Questions
How do you calculate the probability of two events both happening?
For independent events, multiply their probabilities: P(A and B) = P(A) × P(B). For dependent events, multiply P(A) by the probability of B given A.
What is the formula for P(A or B)?
P(A or B) = P(A) + P(B) − P(A and B). For mutually exclusive events the last term is zero, so it simplifies to P(A) + P(B).
What is the difference between independent and mutually exclusive events?
Independent events do not influence each other. Mutually exclusive events cannot happen at the same time. Two events with non-zero probability cannot be both.
How do I find the probability that neither event happens?
Subtract the probability of at least one event from 1: P(neither) = 1 − P(A or B). For independent events it also equals (1 − P(A)) × (1 − P(B)).
Can a probability be greater than 1 or negative?
No. Probabilities always lie between 0 and 1 inclusive. A result outside that range indicates an error in the inputs or the formula.
How do I convert a probability to a percentage?
Multiply by 100. A probability of 0.15 is 15%. To convert back, divide by 100.