๐ฒ Probability Calculator
AND ยท OR ยท NOT ยท Conditional โ with union, intersection & complement rules
Probability Explained Simply: AND, OR, NOT, and When Events Mix
Imagine you have a bag with 10 coloured balls โ 4 red and 3 blue, and the rest are green. What are the chances of pulling out a red one? Simple enough: 4 out of 10, or 0.4. But what if you wanted to know the chances of pulling out either red or blue? Or what if two friends each pull from their own separate bags and you want to know the chance that both get red? That's where probability starts getting interesting โ and just a little more involved.
This guide breaks it all down in plain English, covering the four core probability operations that every stats student, data analyst, and curious mind should know: AND, OR, NOT, and conditional probability.
What Is Probability, Really?
Probability is just a number between 0 and 1 that tells you how likely something is to happen. Zero means impossible. One means certain. Everything in between is somewhere on that spectrum of likelihood. We often write it as a decimal (0.25), a fraction (1/4), or a percentage (25%). They all mean the same thing: this event happens about one time in four on average.
When we talk about events, we usually call them "Event A" and "Event B." An event is just some outcome we care about โ a coin landing heads, a student passing an exam, a train arriving on time. Once you have probabilities for individual events, the rules below let you combine them.
P(A AND B): Both Things Happen
The AND operation asks: what is the probability that both A and B occur? This is also called the intersection, written P(A โฉ B).
The answer depends on whether A and B are independent (one doesn't affect the other) or mutually exclusive (they can't both happen at the same time).
If independent: You simply multiply. P(A AND B) = P(A) ร P(B). Flipping a coin and rolling a die are independent โ the coin doesn't care what the die does. If there's a 0.5 chance of heads and a 1/6 โ 0.167 chance of rolling a 6, the chance of both is 0.5 ร 0.167 โ 0.083.
If mutually exclusive: They literally cannot both happen at the same time. Drawing a single card can't be both a heart AND a spade. So P(A AND B) = 0, always.
P(A OR B): At Least One of Them Happens
The OR operation asks: what's the probability that A happens, or B happens, or both happen? This is the union, written P(A โช B).
The general rule โ which always works โ is the Addition Rule:
P(A OR B) = P(A) + P(B) โ P(A AND B)
Why do we subtract? Because if we just added P(A) + P(B), we'd be counting the overlap (where both happen) twice. Subtracting P(A AND B) corrects that double-count.
For mutually exclusive events, there's no overlap at all, so the formula simplifies to P(A OR B) = P(A) + P(B). Drawing a heart or a spade: P(heart) = 13/52 = 0.25, P(spade) = 0.25, so P(heart or spade) = 0.5.
P(NOT A): The Complement
The NOT operation is the simplest of all. It asks: what is the probability that A does not happen? This is called the complement.
P(NOT A) = 1 โ P(A)
Since something either happens or it doesn't, and those two options together must cover everything (they add to 1), the complement is just whatever is left over. If there's a 30% chance of rain, there's a 70% chance of no rain. That's it โ the complement rule is probability's version of "if not this, then that."
It sounds obvious, but it's incredibly useful. Many tough probability problems are much easier to solve by calculating the complement (what you don't want) and subtracting from 1, rather than computing the event you do want directly.
P(B | A): Conditional Probability
Conditional probability is where things get genuinely deep. P(B | A) โ read as "the probability of B given A" โ asks: if we already know A has happened, what is the probability that B also happens?
P(B | A) = P(A AND B) / P(A)
Think of it like narrowing your world. You started with the full sample space, but now you're restricting your view to only the scenarios where A occurred. Within that smaller world, how often does B show up too?
Classic example: a bag has 4 red balls and 2 blue ones. You already know the ball drawn is red. What's the chance it's also striped, if 2 of the 4 red balls are striped? P(striped | red) = P(red AND striped) / P(red) = (2/6) / (4/6) = 2/4 = 0.5.
This idea powers everything from medical test accuracy (sensitivity, specificity) to spam filters, fraud detection, and Bayes' theorem โ the backbone of modern machine learning.
Independent vs. Mutually Exclusive: They Are NOT the Same Thing
This confusion trips up nearly every beginner, so it deserves its own spotlight.
- Independent events: The outcome of one doesn't change the probability of the other. You can calculate P(A AND B) by multiplying. Both events CAN happen simultaneously.
- Mutually exclusive events: They cannot happen at the same time. P(A AND B) = 0. Knowing one happened tells you with certainty the other didn't.
Here's the kicker: if two events are mutually exclusive and each has a positive probability, they are automatically NOT independent. Because knowing A happened (probability > 0) immediately tells you B didn't โ which changes B's probability from P(B) to 0. That's the very definition of dependence.
How to Use the Calculator
Using the probability calculator above is straightforward. Enter P(A) and P(B) as decimals between 0 and 1. Choose whether your events are independent or mutually exclusive using the toggle. If you know the actual joint probability P(A โฉ B) from real data (rather than a formula assumption), enter it in the optional override field โ the calculator will use your value instead of computing one.
Hit Calculate and you get all six results at once: P(A AND B), P(A OR B), P(NOT A), P(NOT B), P(B | A), and P(A | B). Below the result boxes, a step-by-step working shows every formula applied and every number substituted โ so you can follow along and learn the method, not just the answer.
A Real-Life Example to Try
Say there's a 60% chance you'll exercise today (Event A) and a 40% chance you'll eat healthy (Event B), and these habits are independent. Enter P(A) = 0.6, P(B) = 0.4, set the toggle to Independent, and click Calculate. You'll find: P(both) = 0.24, P(at least one) = 0.76, P(not exercising) = 0.40, P(not eating healthy) = 0.60, P(eating healthy given you exercised) = 0.4 (same as before โ independence at work!). Try switching to Mutually Exclusive and watch how every result shifts. That toggle is the best teacher in the tool.
Probability is the language the universe uses to talk about uncertainty. Once you understand AND, OR, NOT, and conditional rules, you've unlocked a toolkit that applies everywhere: games, medicine, finance, science, and everyday decisions. The maths is simpler than it looks โ and now you have a calculator to back you up every step of the way.