Skip to main content

Probability Calculations in One Toolkit

Compute probabilities, combinatorics, discrete distributions (Binomial, Geometric, Poisson, Hypergeometric), Bayes' theorem, and run Monte Carlo simulations.

Last Updated: February 13, 2026

Probability calculators turn abstract chance into concrete numbers—whether you need the odds of drawing two aces, the likelihood a medical test is correct, or the expected defects in a batch. A quality engineer analyzing a production line wanted to know: if the defect rate is 2%, what's the probability of finding exactly 3 defects in 100 items? She entered n=100, p=0.02, k=3 into the binomial mode and got 0.182. The common mistake is confusing "at least k" with "exactly k"—the first requires cumulative probability (CDF), the second uses the point probability (PMF). When reading results, check which you need: P(X=k) answers "exactly this many," while P(X≤k) or P(X≥k) answers "up to" or "at least."

Event Rules: Union, Intersection, Complement

Three operations cover most probability combinations. The complement P(A') = 1 − P(A) gives the probability something doesn't happen—often easier to compute than the direct probability. If there's a 30% chance of rain, there's a 70% chance of no rain.

Intersection P(A ∩ B) is the probability both events occur. For independent events, multiply: P(A) × P(B). Two independent coin flips both landing heads: 0.5 × 0.5 = 0.25. For dependent events, use the conditional formula: P(A ∩ B) = P(A) × P(B|A).

Union P(A ∪ B) is the probability at least one event occurs. The inclusion-exclusion formula prevents double-counting: P(A) + P(B) − P(A ∩ B). If P(rain) = 0.3 and P(traffic) = 0.4, and they're independent, P(rain or traffic) = 0.3 + 0.4 − 0.12 = 0.58.

Quick reference:

• Complement: P(A') = 1 − P(A)

• Independent intersection: P(A ∩ B) = P(A) × P(B)

• Union: P(A ∪ B) = P(A) + P(B) − P(A ∩ B)

Conditional Probability and Bayes in One Place

Conditional probability P(A|B) answers: given B happened, what's the chance of A? The formula is P(A|B) = P(A ∩ B) / P(B). If 40% of customers buy coffee and 30% buy both coffee and pastry, then among coffee buyers, P(pastry|coffee) = 0.30/0.40 = 0.75.

Bayes' theorem flips the conditioning: P(A|B) = P(B|A) × P(A) / P(B). This is essential when you observe evidence (B) and want to update belief about a cause (A). Medical diagnosis uses this heavily: given a positive test result, what's the probability of actually having the disease?

The base rate matters enormously. A test with 99% accuracy can still produce mostly false positives if the disease is rare. If disease prevalence is 1% and the test has 99% sensitivity and 95% specificity, a positive result gives only about 17% probability of disease—far from the 99% many assume.

Bayes formula: P(Disease|Positive) = [P(Positive|Disease) × P(Disease)] / P(Positive). The denominator expands using the law of total probability.

Independent vs Dependent: Quick Tests

Events A and B are independent if knowing one happened tells you nothing about the other. Mathematically: P(A|B) = P(A), or equivalently, P(A ∩ B) = P(A) × P(B). Coin flips are independent; cards drawn without replacement are not.

To test independence, check if the multiplication rule holds. If P(A) = 0.3, P(B) = 0.4, and P(A ∩ B) = 0.12, then 0.3 × 0.4 = 0.12 matches—events are independent. If P(A ∩ B) = 0.20 instead, they're dependent (positively correlated—knowing one increases the other's probability).

Common confusion: mutually exclusive events (cannot both occur) are maximally dependent, not independent. If A and B are mutually exclusive, P(A ∩ B) = 0, so P(A|B) = 0 ≠ P(A) unless P(A) itself is zero.

Warning: Mutually exclusive ≠ independent. In fact, mutually exclusive events with nonzero probabilities are dependent by definition.

Counting Shortcuts: Factorials to nCr

Probability often requires counting outcomes. Factorials (n!) count arrangements of n distinct items: 5! = 120 ways to arrange 5 books. Permutations (nPr) count ordered selections: how many ways to award gold, silver, bronze to 3 of 10 athletes? P(10,3) = 720.

Combinations (nCr) count unordered selections: how many 5-card hands from 52 cards? C(52,5) = 2,598,960. The formula C(n,r) = n! / [r!(n−r)!] divides out the arrangements within each selection.

With repetition allowed, formulas change. Permutations with repetition: n^r (like 4-digit PINs: 10^4 = 10,000). Combinations with repetition use the stars-and-bars formula: C(n+r−1, r).

Counting formulas:

• Permutation: P(n,r) = n! / (n−r)!

• Combination: C(n,r) = n! / [r!(n−r)!]

• With repetition: n^r (ordered), C(n+r−1,r) (unordered)

Distribution Picks: When to Use Which

Binomial: Fixed number of independent trials (n), constant success probability (p), counting successes (k). Example: 10 coin flips, probability of exactly 7 heads. Use when trials are fixed and outcomes are binary.

Poisson: Counting events in a fixed interval when events occur at a known average rate (λ) independently. Example: 5 calls per hour on average, probability of exactly 8 calls this hour. Use for rare events or counts without a fixed number of trials.

Geometric: Trials until first success. Example: how many calls before first sale if conversion rate is 10%? Expected value is 1/p = 10 calls. Use when asking "how many tries until success."

Hypergeometric: Sampling without replacement from a finite population. Example: drawing 5 cards, probability of exactly 2 hearts. Use instead of binomial when sampling fraction is large (more than 5% of population).

Quick decision: Fixed trials + replacement → Binomial. Rates/counts per interval → Poisson. Trials to first success → Geometric. Without replacement → Hypergeometric.

Probability Shortcuts Q&A

What's the difference between PMF and CDF?

PMF (probability mass function) gives P(X=k)—the probability of exactly that value. CDF (cumulative distribution function) gives P(X≤k)—the probability of that value or less. For "at least k," compute 1 − P(X≤k−1).

When does P(A or B) = P(A) + P(B)?

Only when A and B are mutually exclusive (can't both happen). Otherwise you must subtract the intersection to avoid double-counting: P(A) + P(B) − P(A ∩ B).

How do I know if events are independent?

Check if P(A ∩ B) = P(A) × P(B). If equal, independent. If not, dependent. Physical intuition helps: does knowing one event's outcome change your belief about the other?

Why does my Bayes result seem counterintuitive?

Usually because base rates matter more than you expect. A 99% accurate test applied to a 1% prevalence disease yields many false positives. The posterior probability depends heavily on the prior probability, not just test accuracy.

What if my combinatorial numbers overflow?

Factorials grow astronomically fast (20! exceeds 2 quintillion). Use logarithms for large calculations, or exploit cancellation in C(n,r) by computing iteratively rather than factorials directly. Many calculators handle this internally.

Limitations & Assumptions

• Model Assumptions: Standard probability formulas assume well-defined sample spaces, known probabilities, and often independence. Real-world scenarios may violate these assumptions in ways that affect calculated probabilities.

• Independence Matters: Many formulas assume independent events. Dependent events require different calculations involving conditional probabilities or copulas. Don't assume independence without justification.

• Computational Limits: Factorials and combinations grow rapidly. Very large values may exceed calculator precision or overflow. Results for extreme parameters should be verified.

• Theoretical vs Empirical: Calculated probabilities describe idealized models. Actual frequencies in finite samples may deviate from theoretical values due to random variation.

Disclaimer: This calculator demonstrates probability concepts for learning purposes. It is not designed for gambling decisions, financial risk assessment, medical diagnosis, or professional actuarial analysis. Always verify important probability calculations independently and consult qualified professionals for consequential applications.

Sources & References

Probability formulas and concepts follow standard references:

Frequently Asked Questions

Common questions about probability, combinations, permutations, distributions, Bayes theorem, and simulations.

When are A and B independent?

Two events are independent if the occurrence of one does not affect the probability of the other. Mathematically, events A and B are independent if and only if P(A ∩ B) = P(A) × P(B). In other words, the joint probability equals the product of individual probabilities. Equivalently, P(A|B) = P(A), meaning knowing B occurred doesn't change the probability of A. Examples of independent events include: flipping two coins (outcome of first flip doesn't affect second), rolling two dice, or drawing cards with replacement. Non-independent (dependent) events include: drawing cards without replacement, weather on consecutive days, or the probability of traffic accidents given icy road conditions.

What's the difference between combinations and permutations?

Combinations (nCr) count selections where order does NOT matter, while permutations (nPr) count arrangements where order DOES matter. For example, choosing 3 people from 5 for a committee uses combinations (5C3 = 10) because the order of selection doesn't matter—{Alice, Bob, Carol} is the same committee as {Carol, Alice, Bob}. However, assigning 3 people from 5 to President, Vice President, and Secretary positions uses permutations (5P3 = 60) because order matters—Alice as President with Bob as VP is different from Bob as President with Alice as VP. Formula difference: nCr = n!/(r!(n-r)!) divides by r! to eliminate order, while nPr = n!/(n-r)! keeps all orderings. Generally, nPr ≥ nCr with equality only when r=1.

Which discrete distribution should I use?

Choose based on your scenario: (1) Binomial Distribution: Use when you have a fixed number of independent trials (n), each with constant success probability (p), and you're counting successes. Examples: coin flips, quality control with fixed sample size, survey yes/no responses. (2) Poisson Distribution: Use for counting rare events occurring in a fixed interval of time/space, with events happening independently at a constant average rate (λ). Examples: customer arrivals per hour, network failures per day, typos per page. (3) Geometric Distribution: Use when counting trials until the first success in repeated independent trials. Examples: number of product tests until first defect, lottery tickets until first win, sales calls until first conversion. (4) Hypergeometric Distribution: Use when sampling without replacement from a finite population with two categories. Examples: drawing cards without replacement, quality control sampling without replacement, polling without replacement. Key distinction: Binomial uses replacement (constant p), Hypergeometric doesn't (changing probabilities).

Why do I see scientific notation for large values?

Large factorial, combinatorial, or power calculations produce extremely large numbers that exceed typical decimal display limits. For example, 100! ≈ 9.33 × 10^157 (a number with 158 digits), and 1000C500 is astronomically large. Scientific notation (e.g., 1.23e+45 meaning 1.23 × 10^45) provides a compact, readable format that prevents overflow errors and maintains precision. This notation consists of a mantissa (significant digits) and an exponent (power of 10). To interpret: 5.2e+8 = 520,000,000 and 3.1e-4 = 0.00031. You can switch to scientific notation in the display settings when working with large n values (typically n > 100) to ensure all results display correctly. This is standard practice in statistical software and scientific computing.

Why might my CDF values show tiny mismatches?

Small discrepancies in cumulative probability calculations typically result from floating-point precision limitations inherent in computer arithmetic. Computers represent numbers with finite precision (typically 64-bit doubles with ~15-17 significant digits), which can accumulate small rounding errors through repeated addition or subtraction operations. For example, CDF values are computed by summing PMF probabilities: P(X ≤ k) = P(X=0) + P(X=1) + ... + P(X=k). Each addition can introduce a tiny error (~10^-15), and these errors can accumulate slightly. You might see P(X ≤ 100) = 0.999999999999998 instead of exactly 1.0. These differences are negligible for practical purposes (typically < 10^-12) and don't affect the validity of statistical conclusions. If you need exact arithmetic, symbolic computation tools can be used, but for nearly all real-world applications, the precision provided is more than sufficient.

How does Bayes Theorem work?

Bayes' Theorem updates prior probability P(H) of a hypothesis H into a posterior probability P(H|E) after observing evidence E. The formula is: P(H|E) = [P(E|H) × P(H)] / P(E), where P(E|H) is the likelihood of observing evidence E given hypothesis H is true, P(H) is the prior probability before seeing evidence, P(E) is the total probability of observing the evidence (normalizing constant), and P(H|E) is the posterior probability after incorporating evidence. Example: Medical testing. Prior: P(disease) = 0.01 (1% prevalence). Likelihood: P(positive test | disease) = 0.95 (sensitivity). We also need P(positive test | no disease) = 0.10 (false positive rate = 1 - specificity). Then P(positive test) = P(positive | disease)×P(disease) + P(positive | no disease)×P(no disease) = 0.95×0.01 + 0.10×0.99 = 0.1085. Finally, P(disease | positive test) = (0.95 × 0.01) / 0.1085 ≈ 0.0876 or 8.76%. Despite a positive test, the probability of having the disease is only ~9% due to the low base rate (1% prevalence). This counterintuitive result demonstrates the importance of considering base rates in diagnostic reasoning.

What does the Random Simulator do?

The Random Simulator performs Monte Carlo trials to approximate probabilities through repeated random sampling, demonstrating the Law of Large Numbers and providing empirical validation of theoretical results. It generates thousands of random outcomes based on your probability model and calculates the observed frequency of events. As the number of trials increases, the simulated probability converges to the theoretical value. For example, flipping a fair coin 10 times might give 6 heads (60%), but 10,000 flips will likely yield very close to 50% heads. This tool is valuable for: (1) Approximating complex probabilities where analytical formulas are intractable, (2) Validating theoretical calculations by comparing with empirical results, (3) Visualizing probability convergence and variability, (4) Teaching concepts like sampling distributions and the Law of Large Numbers, (5) Estimating probabilities in games, competitions, or scenarios with complex rules. The simulator shows both the convergence plot (how probability stabilizes with more trials) and histogram (distribution of outcomes), providing visual insight into random processes.

Related Statistics & Probability Tools

Probability Toolkit: nCr/nPr, Bayes & Distributions