Probability Calculator

Free probability calculator. Calculate the probability of single events, multiple independent events, and complement events with clear examples.

Free Tool Formerly CalcSolver No Sign-up Instant Results

Probability Calculator

P(Event) = Number of favorable outcomes ÷ Total possible outcomes

Probability
—
Percentage
—
Complement P(A')
—

Complete Guide to Probability Theory & Statistical Modeling

Explore the foundational axioms, analytical frameworks, core computation rules, and real-world Bayesian decision architectures.

1

Mathematical Foundations & Kolmogorov's Axioms

Probability theory is the mathematical framework dedicated to analyzing random phenomena and uncertainty. While everyday intuition equates probability with luck or chance, mathematical rigor treats probability as a normalized measure defined on a set of outcomes. At the heart of probability lies three foundational constructs:

  • Experiment: Any observable procedure or process whose outcome cannot be predicted with certainty in advance (e.g., flipping a coin, measuring atmospheric pressure, or querying server latency).
  • Sample Space ($S$ or $\Omega$): The exhaustive set of all conceivable elementary outcomes of an experiment. For a single fair six-sided die, $S = \{1, 2, 3, 4, 5, 6\}$.
  • Event ($E$): Any subset of the sample space ($E \subseteq S$). An event occurs if the realized outcome is an element of $E$. For instance, the event "rolling an even number" is $E = \{2, 4, 6\}$.

In 1933, the Russian mathematician Andrey Kolmogorov established the modern axiomatic basis of probability theory, synthesizing set theory and measure theory into three elegant axioms:

  1. Non-negativity: For any event $A$ in the event space, the probability is a non-negative real number: $P(A) \ge 0$.
  2. Unit Measure (Certainty): The probability of the entire sample space is identically one: $P(S) = 1$. This confirms that at least one outcome in the sample space must occur.
  3. Countable Additivity (Disjoint Events): If $A_1, A_2, A_3, \dots$ is a countable sequence of pairwise disjoint (mutually exclusive) events such that $A_i \cap A_j = \emptyset$ for all $i \ne j$, then the probability of their union is the sum of their individual probabilities: $P\left(\bigcup_{i=1}^\infty A_i\right) = \sum_{i=1}^\infty P(A_i)$.

From these three foundational rules, all analytical theorems of modern probability—including the complement law, conditional probability, and variance calculations—can be derived with absolute deductive certainty.

2

Three Interpretations: Classical, Empirical & Subjective (Bayesian)

Depending on the analytical discipline—whether theoretical mathematics, physical experimentation, or machine learning—statisticians view probability through three distinct lenses:

School of Thought Core Definition Formula / Formulation Ideal Applications
Classical (Theoretical) Assumes all elementary outcomes are equally likely (principle of indifference). Ratio of favorable events to total states. P(A) = |A| / |S| Fair games of chance, dice rolls, coin flips, lotteries, combinatorics.
Empirical (Frequentist) Calculates the relative frequency of an event across a very large number of repeated identical experimental trials. P(A) = lim (n→∞) [n(A) / n] Clinical drug trials, manufacturing defect rates, sensor calibration, weather observations.
Subjective (Bayesian) Interprets probability as a measure of degree of belief or epistemic confidence, updated continually as new evidence emerges. P(θ | D) ∝ P(D | θ) · P(θ) Artificial intelligence, spam classifiers, algorithmic stock trading, medical diagnosis.

The bridge connecting the classical and frequentist worlds is the Law of Large Numbers (LLN). Formulated initially by Jacob Bernoulli, the law states that as the number of independent, identically distributed trials $n$ approaches infinity, the observed empirical relative frequency $\frac{k}{n}$ converges with probability 1 toward the theoretical probability $p$.

3

Core Theorems, Laws & Calculation Rules

Solving multi-event probabilistic questions requires combining elementary events using set operations: union ($\cup$), intersection ($\cap$), and complementation ($A^c$ or $A'$).

1. The Complement Rule

The complement of event $A$ represents all outcomes in sample space $S$ that are not in $A$. Because $A \cup A' = S$ and $A \cap A' = \emptyset$, by Kolmogorov's axioms:

P(A') = 1 - P(A)   ⟺   P(A) = 1 - P(A')

Analytical Strategy: When evaluating questions involving "at least one" occurrence over $n$ trials, directly calculating the sum of 1, 2, 3, ..., $n$ outcomes is cumbersome. Applying the complement rule drastically simplifies the calculation: $P(\text{at least one success}) = 1 - P(\text{zero successes})$.

2. The General Addition Rule (Union)

The union $A \cup B$ signifies that event $A$ occurs, event $B$ occurs, or both occur simultaneously:

P(A ∪ B) = P(A) + P(B) - P(A ∩ B)

The term $P(A \cap B)$ is subtracted to avoid double-counting the overlap region where both events occur. If $A$ and $B$ are mutually exclusive (disjoint), their intersection is null ($P(A \cap B) = 0$), reducing the formula to the special addition rule: $P(A \cup B) = P(A) + P(B)$.

3. Conditional Probability & The General Multiplication Rule

Conditional probability measures the probability of event $A$ occurring given the prior knowledge that event $B$ has definitely occurred, denoted $P(A \mid B)$:

P(A | B) = P(A ∩ B) / P(B),   provided P(B) > 0

Rearranging this relationship gives the General Multiplication Rule for joint events: $P(A \cap B) = P(B) \times P(A \mid B) = P(A) \times P(B \mid A)$.

4. Statistical Independence

Two events $A$ and $B$ are statistically independent if and only if knowledge of one provides zero information about the likelihood of the other. Formally, $A$ and $B$ are independent if:

P(A ∩ B) = P(A) × P(B)   ⟺   P(A | B) = P(A)

5. Bayes' Theorem

Named after the Reverend Thomas Bayes, Bayes' Theorem provides the mathematical foundation for updating subjective probabilities based on newly acquired evidence:

P(H | E) = [P(E | H) × P(H)] / P(E)

Where $P(H)$ is the prior probability of hypothesis $H$, $P(E \mid H)$ is the likelihood of observing evidence $E$ given hypothesis $H$, $P(E)$ is the total marginal probability of the evidence across all hypotheses, and $P(H \mid E)$ is the updated posterior probability.

4

Comprehensive Step-by-Step Worked Case Studies

Case Study 1: Rolling Two Standard Six-Sided Dice

Problem Statement: Suppose you roll two fair six-sided dice simultaneously. What is the probability of: (a) rolling a sum of 7, and (b) rolling a sum greater than or equal to 10?

Step 1: Determine the total sample space size. Each die has 6 independent faces. The total number of ordered outcomes in the sample space $S$ is $|S| = 6 \times 6 = 36$.

Step 2: Enumerate favorable outcomes for sum = 7. The pairs $(d_1, d_2)$ that sum to 7 are:

E_7 = {(1,6), (2,5), (3,4), (4,3), (5,2), (6,1)} ⟹ |E_7| = 6 outcomes

Therefore: $P(\text{Sum} = 7) = \frac{6}{36} = \frac{1}{6} \approx 0.1667$ (or $16.67\%$).

Step 3: Enumerate favorable outcomes for sum $\ge 10$. The sum can be 10, 11, or 12:

  • Sum = 10: $(4,6), (5,5), (6,4)$ (3 outcomes)
  • Sum = 11: $(5,6), (6,5)$ (2 outcomes)
  • Sum = 12: $(6,6)$ (1 outcome)

Total favorable outcomes $|E_{\ge 10}| = 3 + 2 + 1 = 6$. Hence: $P(\text{Sum} \ge 10) = \frac{6}{36} = \frac{1}{6} \approx 16.67\%$.


Case Study 2: Sampling Without Replacement (Dependent Events)

Problem Statement: From a well-shuffled standard 52-card deck, two cards are drawn consecutively without replacement. What is the exact probability that both cards drawn are Aces?

Step 1: Calculate probability of the first card being an Ace ($A_1$). A standard deck contains 4 Aces among 52 total cards: $P(A_1) = \frac{4}{52} = \frac{1}{13}$.

Step 2: Calculate conditional probability of the second card being an Ace ($A_2 \mid A_1$). Because the first Ace was not returned to the deck, 51 cards remain, containing exactly 3 remaining Aces: $P(A_2 \mid A_1) = \frac{3}{51} = \frac{1}{17}$.

Step 3: Apply the multiplication rule for dependent events:

P(A_1 ∩ A_2) = P(A_1) × P(A_2 | A_1) = (4/52) × (3/51) = 12 / 2652 = 1 / 221 ≈ 0.004525 (0.4525%)

Notice that if cards had been drawn with replacement (independent events), the result would have been $(4/52) \times (4/52) = 1/169 \approx 0.005917$ ($0.592\%$).


Case Study 3: The Medical Screening Paradox (Bayesian Analysis)

Problem Statement: A rare condition affects 1 in 1,000 individuals in a population ($P(\text{Disease}) = 0.001$). A laboratory test has a $99\%$ sensitivity (true positive rate: $P(\text{Positive} \mid \text{Disease}) = 0.99$) and a $98\%$ specificity (true negative rate: $P(\text{Negative} \mid \text{No Disease}) = 0.98$, meaning a $2\%$ false positive rate). If an asymptomatic patient tests positive, what is the actual probability that they truly have the disease?

Step 1: Identify given probabilities:

  • Prior $P(D) = 0.001 \implies P(\neg D) = 0.999$
  • Sensitivity $P(+ \mid D) = 0.99$
  • False positive rate $P(+ \mid \neg D) = 1 - 0.98 = 0.02$

Step 2: Calculate the total marginal probability of testing positive $P(+)$ using the Law of Total Probability:

P(+) = [P(+ | D) × P(D)] + [P(+ | ¬D) × P(¬D)]
P(+) = (0.99 × 0.001) + (0.02 × 0.999) = 0.00099 + 0.01998 = 0.02097 (2.097%)

Step 3: Apply Bayes' Theorem to compute posterior probability $P(D \mid +)$:

P(D | +) = [P(+ | D) × P(D)] / P(+) = 0.00099 / 0.02097 ≈ 0.04721 (4.72%)

Conclusion: Even with a $99\%$ accurate test, a positive result indicates only a $4.72\%$ actual probability of having the disease. Because the base rate of the disease is so low ($0.1\%$), the false positives generated by the healthy majority ($2\%$ of $99.9\% \approx 2\%$) vastly outnumber the true positives ($0.99 \times 0.1\% \approx 0.099\%$). This highlights the immense importance of prior probabilities in diagnostic testing.

5

Real-World Engineering, Computational & Financial Applications

Modern society is fundamentally underpinned by probabilistic algorithms and risk models:

  • Cybersecurity & Spam Filtering: Naive Bayes classifiers evaluate the presence of specific keywords across millions of emails to calculate the posterior log-odds that an incoming payload is malicious.
  • Actuarial Science & Insurance Underwriting: Life and property insurance premiums are priced using mortality tables, Poisson distribution processes for rare catastrophe claims, and generalized linear models.
  • Financial Derivatives & Risk Modeling: The Black-Scholes-Merton option pricing model relies on geometric Brownian motion, representing asset prices through log-normal stochastic differential equations.
  • Distributed Systems & Network Reliability: High-availability cloud architectures use binomial reliability modeling to calculate 99.999% ("five nines") uptime across redundant microservice clusters: $P(\text{System Up}) = 1 - [P(\text{Server Failure})]^k$.
  • Genetics & Forensic DNA Testing: Forensic scientists compute match probabilities using Hardy-Weinberg equilibrium laws and allele frequencies across independent STR (Short Tandem Repeat) genetic loci.
6

Cognitive Biases & Counter-Intuitive Probability Paradoxes

Human intuition often fails when confronting randomness. Recognizing these standard psychological pitfalls is critical for accurate risk analysis:

1. The Gambler's Fallacy

The irrational conviction that if an independent random event has occurred more frequently than expected in the past, it is less likely to happen in future trials (or vice versa). If a fair roulette wheel lands on black 8 times consecutively, the probability of black on the 9th spin remains identically $\frac{18}{38} \approx 47.37\%$. The roulette wheel has no memory; independent trials never "compensate" for streaks.

2. The Birthday Paradox

In a random room of just 23 individuals, what is the probability that at least two share the same birth day and month? Intuition suggests the answer is tiny because a calendar year has 365 days. However, solving via the complement rule reveals:

P(No shared birthdays) = (365/365) × (364/365) × (363/365) × ... × (343/365) ≈ 0.4927
P(At least one shared birthday) = 1 - 0.4927 = 0.5073 (50.73%)

The probability exceeds $50\%$ with just 23 people because there are $\binom{23}{2} = \frac{23 \times 22}{2} = 253$ distinct pairs of people who could potentially share a birthday.

3. The Prosecutor's Fallacy

This legal error confuses $P(\text{Evidence} \mid \text{Innocence})$ with $P(\text{Innocence} \mid \text{Evidence})$. Even if a piece of forensic evidence has only a 1-in-100,000 chance of matching an innocent suspect by random coincidence, in a national database of 10,000,000 citizens, approximately 100 completely innocent individuals will match by pure chance alone.

7

Frequently Asked Questions About Probability

Can a probability ever be negative or exceed 1?

No. Under Kolmogorov's axioms, all probabilities are bounded strictly between 0 and 1 inclusive. A probability of 0 represents an impossible event within the sample space, while a probability of 1 represents absolute mathematical certainty. Any calculation yielding values outside $[0, 1]$ indicates an arithmetic or dimensional error.

What is the distinction between odds and probability?

Probability is the ratio of favorable outcomes to total possible outcomes ($P = \frac{m}{N}$). Odds represent the ratio of favorable outcomes to unfavorable outcomes ($\text{Odds} = \frac{m}{N - m} = \frac{P}{1 - P}$). For example, rolling a 4 on a standard die has a probability of $1/6$ ($16.67\%$), but the odds in favor of rolling a 4 are $1:5$ (one win for every five losses).

Are mutually exclusive events independent?

No; in fact, mutually exclusive non-zero events are highly dependent. If two events $A$ and $B$ are mutually exclusive, they cannot happen together ($P(A \cap B) = 0$). Therefore, if event $A$ occurs, the probability that event $B$ occurs drops immediately to exactly zero: $P(B \mid A) = 0 \ne P(B)$. Knowing that $A$ occurred provides total certainty that $B$ did not occur.

How do permutations and combinations connect with probability?

Permutations ($P(n, k)$) count ordered arrangements of items, while combinations ($C(n, k)$) count unordered selections. In classical probability, when sample spaces are too large to enumerate by hand, combinatorial formulas are used to calculate the exact size of both favorable sets $|A|$ and total outcomes $|S|$.