Probability Calculator
Combinatorics · conditional · Bayes · unions
Result
Enter values and click Calculate
Compute probability using basic rules, conditional probability, or Bayes’ theorem.
Python Compiler
Probability Fundamentals
Probability measures the likelihood of an event occurring, expressed as a number between 0 (impossible) and 1 (certain). It is the foundation of statistics, machine learning, and decision-making.
Complement Rule
P(¬A) = 1 − P(A). The probability an event does not happen.
Addition Rule (OR)
P(A ∪ B) = P(A) + P(B) − P(A ∩ B). Subtract the overlap.
Multiplication Rule (AND)
P(A ∩ B) = P(A) × P(B|A). For independent events: P(A) × P(B).
Conditional Probability & Bayes’ Theorem
P(+) = 0.95 × 0.01 + 0.05 × 0.99 = 0.059
P(Disease|+) = (0.95 × 0.01) / 0.059 = 0.161 (16.1%)
Despite a “95% accurate” test, there is only a 16% chance of having the disease!
Independent vs. Mutually Exclusive Events
| Property | Independent Events | Mutually Exclusive Events |
|---|---|---|
| Definition | One event does not affect the other | Events cannot both occur |
| P(A ∩ B) | P(A) × P(B) | 0 |
| P(A ∪ B) | P(A) + P(B) − P(A)P(B) | P(A) + P(B) |
| Example | Coin flip and die roll | Drawing a red or blue ball |
| Can both occur? | Yes | No |
Real-World Applications
Medical Diagnosis
Bayes’ theorem updates disease probability after test results, accounting for base rates and test accuracy.
Spam Filtering
Naïve Bayes classifiers compute the probability an email is spam given the words it contains.
Insurance & Risk
Actuaries use conditional probabilities to assess risk and calculate premium rates.
Games & Sports
Poker odds, win probability given the current game state, expected value of bets.