Probability quantifies how likely an event is to occur, expressed as a number from 0 (impossible) to 1 (certain). Whether you are flipping coins, inspecting factory output, or planning a card game, probability gives you a rigorous framework for reasoning under uncertainty. This guide covers the key formulas, when to use each mode, and how to interpret the results.

Basic Probability and the Complement Rule

The simplest form of probability is the ratio of favorable outcomes to total equally-likely outcomes: P(A) = favorable / total. This applies when every outcome is equally likely — rolling a specific number on a fair die, drawing a specific card from a shuffled deck, or selecting a specific ball from a bag.

The complement rule states P(A') = 1 − P(A). If there is a 30% chance of rain, there is a 70% chance of no rain. Odds convert probability into a ratio: odds for an event = favorable : (total − favorable). A 1/6 probability corresponds to 1:5 odds.

Binomial Distribution: Repeated Independent Trials

The binomial distribution models experiments with n independent trials, each resulting in success (probability p) or failure (probability 1−p). The probability of exactly k successes is P(X=k) = C(n,k) × p^k × (1−p)^(n−k). This formula has three components: C(n,k) counts the number of ways k successes can occur, p^k is the probability of k successes, and (1−p)^(n−k) is the probability of the remaining failures.

The cumulative probability P(X≤k) sums all probabilities from 0 to k and is especially useful for quality control (reject if more than k defects) and hypothesis testing (p-value calculation). The expected value E(X) = n×p is the average number of successes you would observe over many repetitions of the experiment.

Combinations and Permutations: Counting Without Calculating Every Case

Combinations (nCr) count the number of ways to select k items from n items when order does not matter. Permutations (nPr) count ordered arrangements. The key distinction: choosing a committee of 3 from 10 people is a combination (C(10,3) = 120), but awarding first, second, and third place from 10 finalists is a permutation (P(10,3) = 720). Permutations always ≥ combinations for the same n and k, because each combination can be arranged in k! ways.

Both formulas use factorials and are limited by floating-point precision for n > 170 (where n! exceeds JavaScript's number range). For larger values, use logarithms of factorials or specialized big-number libraries.