How to Calculate Probability
Probability measures how likely an event is to occur, expressed as a number between 0 (impossible) and 1 (certain). It's the foundation of statistics, risk analysis, genetics, gambling, and machine learning.
The Basic Formula
P(A) = Number of favorable outcomes / Total number of possible outcomes
Example: Probability of rolling a 4 on a fair die: P(4) = 1/6 ≈ 0.167 (16.7%)
Complement Rule
P(not A) = 1 − P(A)
P(not rolling a 4) = 1 − 1/6 = 5/6 ≈ 83.3%
Compound Events
Independent Events (AND)
P(A and B) = P(A) × P(B)
P(flipping heads twice) = ½ × ½ = 1/4 = 25%
Mutually Exclusive Events (OR)
P(A or B) = P(A) + P(B)
P(rolling 1 or 2) = 1/6 + 1/6 = 2/6 = 33.3%
Non-Mutually Exclusive Events (OR)
P(A or B) = P(A) + P(B) − P(A and B)
P(card is red or face card): P(red) = 26/52, P(face) = 12/52, P(both) = 6/52 = 26/52 + 12/52 − 6/52 = 32/52 ≈ 61.5%
Conditional Probability
P(A | B) = probability of A given that B has occurred:
P(A | B) = P(A and B) / P(B)
Real-World Examples
- Medical testing: A test with 99% sensitivity and a disease prevalence of 0.1% has a surprisingly low positive predictive value (Bayes' theorem)
- Poker: Probability of being dealt a royal flush = 4 / 2,598,960 ≈ 0.000154%
Use our probability calculator for single and compound events.