This sheet follows the thirteen units of the course in order. Each unit starts with the big idea in a few sentences, then gives the definitions, formulas and rules you will look up most often, with the conditions they need. When you want the full explanation, a proof or more examples, follow the lesson links under each topic.
Events are sets of outcomes in a sample space , with complement , empty event , intersection and union . A conditional probability is defined only when . Random variables are capital letters such as , and lowercase letters such as stand for their values. A discrete variable has the PMF , a continuous one has a density , and every random variable has the CDF . Expectations are written , together with , and , and a formula that contains an expectation assumes it is finite unless it says otherwise. For observations the partial sum is and the sample mean is , also written .
Distributions are written , , , and . The exponential distribution is written with its rate , so its mean is , and the second entry of is the variance. The standard normal CDF is . Geometric and negative binomial waiting times count the trials up to and including the success they wait for. Markov chains use a row-stochastic transition matrix and row vectors of state probabilities. Logarithms are natural, and decimals from , or long products are rounded.
Probability Foundations
A probability is a number attached to an event under a stated model. The model lists the possible outcomes and assigns probabilities that obey three axioms, and every other rule, such as the complement rule and the addition rule, follows from those axioms.
Models, outcomes and events
An experiment is a procedure together with a rule for what is recorded, and a trial is one run of it. An outcome is one complete recorded result, the sample space is the set of all outcomes, and an event is a set of outcomes. An event occurs on a trial when the observed outcome belongs to it. In a finite model it is enough to give each outcome a probability so that these numbers add to , and then every event has
Three kinds of probability are easy to mix up.
| Kind | What it is | Where it comes from |
|---|---|---|
| Theoretical | the value in a stated model | the assumptions of the model |
| Empirical relative frequency | when occurred on of recorded trials | one finite record, which can change from run to run |
| Subjective | a degree of belief that occurs, coherent when it obeys the rules of probability | the information available, revised as evidence arrives |
For independent trials in which has the same probability , for every fixed positive margin the chance that the relative frequency misses by more than that margin tends to as grows. This is the law of large numbers. At a fixed the relative frequency can still differ from .
Lessons Probability Models and Uncertainty
Describing events
| Words | Event |
|---|---|
| or , with the inclusive or | |
| and | |
| not | |
| but not | |
| neither nor | |
| not both | |
| exactly one of and | |
| happens only if happens | the statement , not an event |
De Morgan’s laws hold for any events,
and for any number of events in the same way. Events are disjoint, or mutually exclusive, when . Nonempty, pairwise disjoint events whose union is form a partition, so every outcome lies in exactly one of them. For a count with integer values and an integer , at least means and includes , and its complement is . One outcome that lies in but not in is a counterexample that disproves the claim .
Lessons Sample Spaces and Events, Translating Event Language
The axioms and basic rules
A probability gives a number to every event and satisfies three axioms.
- Nonnegativity. Every event has .
- Normalization. The certain event has .
- Countable additivity. For pairwise disjoint events the probability of the union is the sum .
The other basic rules follow from these.
| Rule | Statement | Condition |
|---|---|---|
| Empty event | always | |
| Finite additivity | ||
| Complement rule | always | |
| Monotonicity | ||
| Difference | ||
| Range | always |
The complement rule is the usual way to handle at least one. The complement of at least one of is none of them, so
This step needs no independence. Independence enters only when is written as the product of the factors , a step that mutual independence of the events justifies.
Lessons Probability Axioms and Basic Rules, The Complement Rule
The addition rule
For any two events,
The overlap is subtracted once because counts it twice. Two events split into the four disjoint regions , , and , and every event built from and is a union of some of them. Exactly one of the two events occurs with probability , and neither occurs with probability . When the overlap is unknown, the union bound still gives
and for two events , with equality on the right exactly when . For example, if , and , then , exactly one occurs with probability and neither occurs with probability .
Lessons The Addition Rule
Equally likely outcomes
If is finite and nonempty and all of its outcomes are equally likely, then every event has
where is the number of outcomes in . Equal likelihood is an assumption about the experiment, and it can hold at one level of detail and fail at a coarser one. Count the event and the sample space at the same level, one where the outcomes are equally likely, which is often the level of ordered sequences. Two fair dice rolled independently have equally likely ordered outcomes, so a total of has probability , while the eleven possible totals are not equally likely. Three tosses of a fair coin have equally likely sequences, and exactly two heads has probability .
Lessons Equally Likely Outcomes
Simulation
A simulation generates outcomes from a model, repeats the experiment times and reports the relative frequency
where is the number of simulated trials in which the event occurred. A pseudorandom generator is deterministic, so the same algorithm, seed and sequence of calls reproduce the same run, and a different seed usually gives a different estimate. For independent simulated trials the estimate varies around the model probability, and for every fixed positive margin the chance of a miss larger than that margin tends to as grows. A simulator built on the wrong model estimates the probability of the event in that wrong model, and running it longer does not remove the difference from the intended probability. How large the sampling error is likely to be is worked out in the unit on repeated sampling.
Lessons Probability Simulation
Counting and Equally Likely Models
When the outcomes are equally likely, a probability is a ratio of two counts. Every counting method starts from what one outcome records, then asks whether order matters, whether items can repeat and which objects can be told apart.
Sum and product rules
- Product rule. Suppose each outcome is built by successive choices, the choice at stage has options whatever the earlier choices were, and different sequences of choices give different outcomes. Then there are outcomes. The options themselves may depend on the earlier choices, as long as their number does not.
- Sum rule. If a set splits into pairwise disjoint cases, its size is the sum of the sizes of the cases. For two overlapping sets, .
- Cases and trees. When the number of options differs from path to path, split into cases at the stage where it differs, count each case and add. In a decision tree each outcome is one leaf.
- Restrictions. Give each stage only the options that satisfy every restriction, and it often helps to fill the most restricted stage first.
A code of digits has possibilities, and of them repeat no digit.
Lessons Sum and Product Rules for Counting
Permutations and combinations
Choose objects from distinct objects.
| Selection | Order matters | Order ignored |
|---|---|---|
| Without replacement, | ||
| With replacement, | multisets |
Here for , and . There are arrangements of distinct objects in a row, and for there are arrangements around a circle when rotations count as the same. Without replacement no selection exists when . Counting multisets is not the same as finding their probabilities, because unordered records of independent draws are usually not equally likely, as the last topic of this unit shows.
For the binomial coefficient counts the subsets of size of a set of elements. It satisfies , the rows of Pascal’s triangle add up to , and Pascal’s identity
holds for . For every integer the binomial theorem states
with read as . From people, a chair and a secretary can be chosen in ways and a committee of three in ways.
Lessons Permutations, Combinations and Binomial Coefficients
Repeated objects
Suppose objects come in types, with objects of type that cannot be told apart and . The number of distinct arrangements in a row is the multinomial coefficient
The same number counts the ways to split distinct objects into named groups of sizes , and it is the coefficient of in , so these coefficients add up to . Choosing the positions of each type in turn gives the same count as the product . Whether two objects can be told apart depends on what the outcome records. The letters of LEVEL have arrangements, and those of MISSISSIPPI have .
Lessons Repeated Objects and Multinomial Counting
Inclusion-exclusion
For three events , and , write for the sum of the single probabilities, for the sum of the three pairwise intersection probabilities and . These three sums give the probabilities in the table.
| Event | Probability |
|---|---|
| at least one, | |
| exactly one | |
| at least two | |
| exactly two | |
| all three |
For events, with the sum of the probabilities of all intersections of of them,
The same identities hold for the sizes of finite sets, and none of them needs independence or equally likely outcomes. Among the integers to , the number divisible by , or is .
Lessons Inclusion-Exclusion
Birthday and collision problems
Suppose each of individuals receives one of categories, independently and with probability for each category. A collision means that at least two individuals share a category, and its complement has probability
- With equally likely birthdays, a shared birthday has probability about for people and about for .
- A pair named in advance matches with probability whatever is. A collision is the union of such pair events, which can occur together, so the sum gives only the bound .
- If , a collision is certain by the pigeonhole principle, whatever the category probabilities.
- With unequal category probabilities , two independent individuals match with probability . For any , independent individuals who share these probabilities collide at least as often as under equal probabilities.
Lessons Birthday and Collision Problems
Choosing a counting method
- Write down what one outcome records, and check that these outcomes are equally likely under the way the selection is actually made.
- Decide whether order matters, whether repetition is allowed and which objects can be told apart, then use the table of selections above or the multinomial coefficient.
- Count the event and the sample space at the same level of detail.
- When an event such as at least one splits into many cases, count its complement instead.
Erasing order can destroy equal likelihood. For two fair dice the unordered record of a and a comes from the two ordered outcomes and and has probability , while a double comes only from and has probability , so the unordered records are not equally likely. A record produced by of the equally likely outcomes of has probability .
Lessons Choosing a Counting Method
Conditioning, Independence and Evidence
Conditioning on an event with keeps only the outcomes in and rescales their probabilities to total . Independence is a product rule, not a statement about overlap, and Bayes’ theorem reverses a conditional probability by combining the evidence with the base rate.
Conditional probability
For events and with ,
If , the ratio is and the conditional probability is undefined, which is different from . With equally likely outcomes, . For a fixed the rule is itself a probability, so for example . Reversing the condition changes the denominator. When and , the probabilities and are equal exactly when or .
In a two-way table of counts with one member drawn uniformly at random, a cell divided by the grand total is a joint probability and a row or column total divided by the grand total is a marginal probability. A cell divided by its row total is a conditional probability given the row, and a cell divided by its column total is a conditional probability given the column. In the constructed table below, , and .
| Defective | Not defective | Total | |
|---|---|---|---|
| Tagged | |||
| Not tagged | |||
| Total |
Lessons Conditional Probability, Conditional Probability Tables
Independence
Events and are independent when
- When this is equivalent to , and when to .
- If and are independent, so are and , and , and and .
- An event of probability or is independent of every event.
- Events are mutually independent when the product rule holds for every subcollection of two or more of them. Pairwise independence, the rule for every two, does not imply mutual independence.
- For mutually independent events, none of them occurs with probability , and at least one occurs with probability .
Disjoint and independent are different properties.
| Relation between and | Independent exactly when |
|---|---|
| disjoint, | or |
| nested, | or |
| overlapping | the product rule holds, which the overlap alone cannot show |
So disjoint events with positive probabilities are always dependent, since . Overlapping events can go either way. For one fair die the events and are independent, because their intersection has probability . The union of independent events still needs the overlap term,
Lessons Independent Events, Disjoint Events and Independence
Trees and the chain rule
The multiplication rule holds whenever , with or without independence. Repeating it gives the chain rule. If , then
In a probability tree the branches leaving a node are the disjoint and exhaustive outcomes of the next stage. Each carries its probability given the history at that node, so the branches from one node add to . The probability of a path is the product of its branch probabilities, and the probability of an event is the sum over the paths that make it up. Two cards drawn without replacement from a standard deck are both aces with probability .
Lessons Probability Trees and the Chain Rule
Total probability and Bayes’ theorem
Let be a partition of with every . For every event ,
a weighted average of the rates in the groups, with the group probabilities as weights. If a partition also has groups of probability , they contribute nothing to , so they are left out and the sum runs over the groups of positive probability. Bayes’ theorem reverses the condition. If and , then
and when also , the partition , gives the denominator
For a test, let be the event that the condition is present and the event of a positive result.
| Term | Probability |
|---|---|
| Prior probability, or base rate | |
| Sensitivity, the true positive rate | |
| Specificity, the true negative rate | |
| False positive rate | , which is minus the specificity |
| Posterior probability after a positive result |
Sensitivity and specificity condition on the true state, so neither of them is the posterior probability, and judging the posterior without the base rate is base rate neglect. With , sensitivity and false positive rate , a positive result has probability , and
Lessons The Law of Total Probability, Bayes’ Theorem and Base Rates
Conditional independence and odds
For an event with , events and are conditionally independent given when . Conditional independence and ordinary independence do not imply each other. Two reports that both respond to the same hidden state can be conditionally independent given each value of the state and still be dependent overall. To process evidence one piece at a time, use the current posterior as the next prior and condition each new likelihood on everything already observed. Under conditional independence given each hypothesis, the single-report likelihoods can be reused, while a report that only copies another one adds no evidence.
For , the odds in favor of an event with probability are , and conversely . Odds of in favor, with and , mean . For a hypothesis with and evidence with , write for the prior odds and for the posterior odds. The odds form of Bayes’ theorem is
In the test example the prior odds times the likelihood ratio give posterior odds , which is the probability again. For pieces of evidence that are conditionally independent given and given , the likelihood ratios multiply.
Lessons Conditional Independence and Sequential Evidence, Probability and Odds
Discrete Random Variables and Expected Value
A random variable assigns a number to each outcome, and its distribution says how probability is spread over those numbers. Expected value is the probability-weighted average of the values, a single summary that need not be a possible value.
Random variables and PMFs
A random variable is a function from to the real numbers, and is the event of the outcomes at which its value lies in . It is discrete when for some finite or countably infinite set . Its support is the set of values with positive probability, and its probability mass function is
for every real . A function is a PMF exactly when for every , finitely or countably many values have , and those masses add to . For a discrete and every set of real numbers
where only the support values in contribute. If the masses are known only up to a factor, on a set with and a finite positive total, then . For on this gives .
Lessons Discrete Random Variables, Probability Mass Functions
Cumulative distribution functions
The CDF of any random variable is for every real . It is nondecreasing and right-continuous, it tends to as and to as , and its left limit is . The jump of at is , so the CDF of a discrete variable jumps exactly at its support values, and with finite support it is a step function. For ,
| Event | Probability |
|---|---|
For a discrete variable, including or excluding an endpoint matters exactly when the endpoint has positive probability. When is continuous it never matters.
Lessons Cumulative Distribution Functions
Functions of a random variable
For with discrete, each value of passes its mass to its output, and masses with the same output add,
A map that is one-to-one on the support moves the masses without merging them. When two support values have the same output their masses merge, and when takes that output its value does not determine the value of . If is uniform on , then has and . The positive part moves the mass of every negative value to .
Lessons Functions of Discrete Random Variables
Expected value
For a discrete , the expected value, or mean, is
a finite number when , which always holds for finite support. Each value is weighted by its own probability, and for finite support the mean lies between the smallest and the largest value. A fair die has , which is not a possible roll. For a function with ,
and the value can differ from , as it does for and a fair die.
- Infinite mean. A variable with no negative values has either a finite mean or . If for , every term of the series equals and the mean is infinite. This needs infinitely many values.
- Undefined mean. If the positive and the negative values both contribute infinite sums, is undefined.
- Conditional mean. For an event with , the mean computed with the conditional masses is .
- Mode. A mode is a value with the largest mass. There can be several, and a mode can differ from the mean.
Lessons Expected Value
Expected value and decisions
If an action pays a random amount and costs a fixed amount , the net payoff has . The fair price, the fee that makes the expected net payoff , is . A ticket that costs and pays with probability and nothing otherwise has expected net payoff , which is at the break-even probability , a probability only when . A $2 ticket that pays $10 with probability has expected net payoff dollars, and it would break even at .
Choosing the action with the largest expected payoff, or the smallest expected cost, is one decision criterion among several. Others protect the worst case or limit the probability of exceeding a budget, and different criteria can rank the same actions differently. An expected value describes the model it was computed from, so a sensitivity check under other plausible inputs is one guard against model risk.
Lessons Expected Value and Decisions
Expectation, Spread, Sums and Averages
Expectation is linear whether or not the variables are independent, which turns expected counts into sums of probabilities. Variance measures spread around the mean, the variances of independent variables add, and together these facts give the mean and the standard error of a sample mean.
Linearity and indicators
If have finite expectations, and are constants and is fixed, then
with no independence needed. The product rule is a different statement. It holds for independent and with finite expectations, and it can also hold for dependent variables, so it does not show independence.
The indicator of an event equals on and elsewhere, with , and . If counts how many of the events occur, then and
even when the events are dependent. If hats are handed back to their owners in a uniformly random order, each owner gets their own hat with probability , so the expected number of matches is for every . Six rolls of a fair die show on average different faces.
Lessons Linearity of Expectation, Indicator Random Variables
Variance and standard deviation
For with finite mean ,
The variance is finite exactly when , and then . It equals exactly when . Variance is in squared units, and the standard deviation is in the units of . For a fair die , so and . For constants and and finite variance,
| Quantity | Value for |
|---|---|
| Mean | |
| Variance | |
| Standard deviation |
A shift leaves the spread unchanged, and a change of units with factor multiplies the standard deviation by . The mean absolute deviation is another measure of spread, and it never exceeds .
Lessons Variance, Standard Deviation and Changing Scale
Sums of random variables
For discrete and on the same sample space, with joint masses , the sum has
In general the separate distributions of and do not determine the distribution of the sum. For independent and the joint masses factor, and the formula becomes the discrete convolution
The mean always adds, . With finite variances,
where the covariance, defined in the unit on joint laws, is for independent variables. So the variances of independent variables add, while their standard deviations do not. The total of two fair dice rolled independently has and .
Lessons Sums of Discrete Random Variables
Sample means
A random sample of size is a list of independent and identically distributed, or IID, random variables. A statistic is computed from the sample by a fixed rule, and its sampling distribution is its distribution under the model. If the are IID with mean and finite variance , then
The mean needs only a common mean. The variance needs uncorrelated observations with a common variance, which IID observations have. The standard deviation of a statistic is called its standard error. A histogram of simulated values of a statistic only approximates its sampling distribution.
Lessons Sample Means and Sampling Distributions
Discrete Probability Distributions
A few families of discrete distributions describe the most common random mechanisms, and each family belongs to a particular experiment. Its formulas apply only when that experiment’s conditions hold, so check the conditions before using a formula.
Families at a glance
In the binomial, geometric and negative binomial rows, the trials are independent and every trial is a success with the same probability .
| Family | Experiment | Values | Mean | Variance |
|---|---|---|---|---|
| Discrete uniform on | one of consecutive integers, all equally likely | |||
| one trial, success coded | ||||
| successes in trials | ||||
| Geometric, | trials up to and including the first success | |||
| Negative binomial, and | trials up to and including success number | |||
| Hypergeometric | marked items among drawn without replacement from items, of them marked | see below | for | |
| a count over an exposure |
A discrete uniform variable on a set of values gives each of them the mass , so an event containing of the values has probability . The mean and variance in the table hold for consecutive integers, and for evenly spaced values with gap the variance is . A fair die has mean and variance . No distribution gives the same positive mass to infinitely many values, because the masses would add to more than .
Lessons The Discrete Uniform Distribution
Bernoulli and binomial distributions
A variable with has and . Every indicator is . The variance is at most , with equality only at , and it is when is or .
A count of successes is when the number of trials is fixed in advance, each trial records one clearly defined success, the trials are independent and every trial has the same success probability . Then, for ,
with read as . Writing with one indicator per trial, the mean follows from linearity alone, while the variance uses independence. Tail probabilities are finite sums, and the complement rule gives . For , .
Lessons The Bernoulli Distribution, The Binomial Distribution
Geometric and negative binomial distributions
With independent trials and success probability , let be the number of the trial on which the first success occurs. Then
the first for every integer and the second for every integer . For the geometric distribution is memoryless, for all integers . The number of failures before the first success is , with mean and the same variance, and some books call that variable geometric, so state the convention with every formula. With , and .
For a positive integer , let be the number of the trial on which success number occurs. For every integer ,
because trial succeeds and the first trials hold exactly successes. This is a sum of independent geometric waits, which gives the mean and variance in the table of families. The th success has come by trial exactly when the first trials hold at least successes, so with . With and , .
Lessons The Geometric Distribution, The Negative Binomial Distribution
Hypergeometric distributions
Draw items uniformly without replacement from items of which are marked, where and . The number of marked items drawn has
for every integer with , and probability elsewhere. The draws are dependent, yet linearity still gives . The variance is the binomial variance with multiplied by the finite population correction . When is small compared with , the distribution is close to . With , and , , and .
Lessons Hypergeometric Distributions
Poisson distributions
For , a variable has
for , and is the point mass at . The masses add to because of the exponential series, and . When is not an integer the most likely count is , and when is a positive integer the counts and tie. Under a model with a constant rate per unit of exposure and a Poisson count, the count over an exposure is , with and in matching units. With , and .
For many trials with a small success probability, is close to . If and , Le Cam’s inequality gives for every set of counts. For , , while , well within the bound .
Lessons Poisson Distributions
Joint Discrete Laws and Conditional Averages
A joint distribution records how two variables occur together, and everything in this unit is computed from it. Margins forget how the values pair up, conditional distributions renormalize one row or column, and conditional means combine into the overall mean and variance.
The examples in this unit use the constructed joint table below.
Joint and marginal distributions
The joint PMF of discrete and on the same sample space is . A table of numbers is a joint PMF exactly when no entry is negative and the entries add to . For a set of pairs, is the sum of the cells in . The marginal PMFs are the row and column totals,
where each sum must include every value that can occur with the fixed one. The margins do not determine the joint table in general, because different tables can have the same totals. A function collects the cells with the same value of . In the table, .
Lessons Joint Probability Mass Functions, Marginal Probability Distributions
Conditional distributions
For a value with , the conditional PMF of given is
which divides row of the table by its total. It is a PMF in , and its mean is the conditional mean . In the other direction , and adding over gives the law of total probability . Conditioning the other way round divides by a column total instead, and the two are linked by Bayes’ theorem. In the table, given the values , and of have probabilities , and , so , while .
Lessons Conditional Probability Mass Functions
Independent random variables
Discrete and are independent exactly when
for every pair , which is equivalent to for all sets and . For variables of any type, independence means that the joint CDF equals for all real and . One cell where the product fails proves dependence, and a cell with mass whose row and column totals are positive is such a cell. In the table , while , so and are dependent. If and are independent, so are and for any functions and . Variables are mutually independent when their joint PMF is the product of all marginal PMFs, which is stronger than pairwise independence.
Lessons Independent Random Variables
Covariance and correlation
For and with finite second moments and means and ,
- Rules. The covariance satisfies and for constants , , and , it is when one of the variables is constant, and it adds over sums in each argument.
- Variance of a sum. For finitely many variables, is the sum of the variances plus twice the sum of over all pairs . The variances add exactly when those covariances add to , for example when the variables are pairwise uncorrelated.
- Correlation. When both variances are positive, has no unit and lies in by the Cauchy-Schwarz inequality. It equals or exactly when with probability for constants and , with the sign of .
- Uncorrelated is weaker than independent. Independent variables with finite second moments have covariance , but the converse fails. If is uniform on and , then , although is a function of .
In the table , and , so . With and , the correlation is about .
Lessons Covariance, Correlation and Sums
Conditional expectation and total variance
The conditional mean function , defined where , turns into the random variable . If , the law of total expectation, or tower rule, states
If , the law of total variance splits the variance into the variation within the groups and the variation between the group means,
and is the best predictor of from in mean squared error. In the table, . The within-group part is and the between-group part is , which add to .
Lessons Conditional Expectation and the Tower Rule, The Law of Total Variance
Random sums
Let have mean , and let a count with values be independent of the whole sequence. The random sum is when . Then
The mean formula needs identically distributed terms with a finite mean and . The variance formula needs IID terms with finite variance and , and it follows from the law of total variance with as the group label. If the number of claims is and each claim has mean and variance , the total has mean and variance .
Lessons Random Sums with Independent Counts
Repeated Sampling and the Discrete Law of Large Numbers
An average of many independent draws from one distribution is likely to land near the mean. Chebyshev’s inequality turns the variance of the average into a bound on the probability of a miss, which proves a law of large numbers and also measures the error of a simulation.
Mean and variance of the sample mean
If every has the same mean , then , so the sample mean is unbiased, with or without independence. With finite variances, , where
For uncorrelated observations with a common variance , in particular IID ones, and the standard error of the mean is . Dividing the standard error by takes times as many observations, and the standard error is at most exactly when . With , a sample of gives a standard error of , and halving it takes observations.
Lessons Mean and Variance of the Sample Mean
Markov and Chebyshev inequalities
| Inequality | Statement | Conditions |
|---|---|---|
| Markov | with probability , finite mean, | |
| Chebyshev | finite mean and variance , | |
| Chebyshev in standard deviations | , |
Chebyshev’s inequality is Markov’s inequality applied to with threshold . Both bounds hold for every distribution with the stated information, and both are sharp, since whenever a bound is at most some distribution attains it. A bound of or more says nothing, so the last form is informative only for . It guarantees that at least of the probability lies strictly within standard deviations of the mean, at least for , where a normal distribution has about .
Lessons Markov and Chebyshev Inequalities
The weak law of large numbers
A sequence converges in probability to a constant when for every . If are IID with mean and finite variance , Chebyshev’s inequality gives, for every and every ,
so converges in probability to . The bound is at most when , a sufficient sample size that can be much larger than necessary. For the relative frequency of an event with probability , the variance is , so works for every , which is for . The law also holds for IID variables with a finite mean and infinite variance, with a different proof. It is a statement about probabilities at each . At a fixed with the average differs from with positive probability, and nothing makes one observed run approach step by step.
Lessons Law of Large Numbers for Discrete Variables
Streaks and the gambler’s fallacy
For independent trials with a known success probability , where records a success on trial , every record of the first trials with leaves . The gambler’s fallacy is the belief that a streak makes the opposite outcome more likely. The law of large numbers does not work by compensation. After successes in trials, the expected excess of successes over times the number of trials stays however many further trials follow, while the expected proportion after further trials is
which tends to because the early excess is diluted. A run of heads on tosses chosen in advance has probability for a fair coin, but a run of at least heads somewhere in tosses has probability about . When is unknown, a long record is evidence about , and updating with Bayes’ theorem is learning, not the fallacy.
Lessons Streaks and the Gambler’s Fallacy
Simulation error
For independent simulated trials of an event with probability , the estimate has and standard error
Multiplying by halves the standard error, and trials give a standard error of at most . The plug-in standard error puts in place of , so it is itself random, and it is whenever all trials agree. A standard error is not a largest possible error. Chebyshev’s inequality gives the guarantee for every . A replication is a new run with independent random inputs, while rerunning with the same seed only reproduces the same numbers. Model error and implementation error do not shrink as grows.
To study a statistic, repeat the whole sampling procedure times and compare the empirical distribution of the values with exact benchmarks such as . The sample size decides which distribution is studied, and the number of replications decides how precisely it is estimated. A probability estimated from independent replications has standard error , and an empirical variance should say whether it divides by or by .
Lessons Simulation Error and Number of Trials, A Repeated-Sampling Investigation
Continuous Probability and Its Mathematical Tools
A continuous random variable spreads probability over intervals rather than single values. Probabilities become areas under a density, the CDF accumulates that area, and where the density is continuous the derivative of the CDF gives the density back.
Integrals and area
For on with , split into pieces of widths and pick a point in each. The definite integral is the limit of the Riemann sums as the widest piece shrinks to , when that limit is the same whatever points are chosen. The limit exists when is continuous on , and also when is bounded with finitely many jumps. For it is the area under the graph.
| Rule | Formula | Condition |
|---|---|---|
| Power rule | integer | |
| Constant multiple | integrable | |
| Sum | and integrable | |
| Adjacent intervals |
For a nonnegative, nondecreasing the left Riemann sum is at most the area and the right sum is at least the area. For example .
Lessons Integrals and Probability as Area
Derivatives and the density-CDF connection
The derivative of at is
when the limit exists, the slope of the tangent line. For a positive integer the derivative of is , a constant has derivative , and derivatives respect sums and constant multiples. Let be continuous on . The fundamental theorem of calculus says that has for , and that if is continuous on with on , then .
For a CDF with a density this gives at every where is continuous. Conversely, if is continuous and, outside finitely many points, differentiable with a continuous derivative, then is a density, with any nonnegative values at the exceptional points. A CDF with a jump has no density, and continuity of alone is not enough either.
Lessons Derivatives and the Density-CDF Connection
Densities and CDFs
A density is a function with total integral , and has density when for all . Then
is continuous, and .
- Single values. Every single value has , so including or excluding endpoints never changes a probability. Probability does not mean impossible.
- Density values. A density value is probability per unit of , not a probability, and it can be larger than . Only the area over an interval is a probability.
- Normalizing. If has finite positive total area , then is a density.
- Change of units. For with , the density is .
The density on , and elsewhere, has for , so , and its value is larger than . The function on has area , so is a density there.
Lessons Probability Densities and CDFs
Point masses and mixed distributions
A value with is an atom, or point mass, and its mass equals the jump of the CDF. A distribution has at most countably many atoms. A mixed distribution in the sense of this course has atoms with masses of total , where , and a continuous part with area , so that for
A mixed variable has no density, and the endpoints of an event matter again at the atoms, as in . An event of probability need not be empty, and an event of probability is said to happen almost surely. If with probability and otherwise is uniform on , then on , , and .
Lessons Point Probabilities and Mixed Distributions
Continuous expectation and variance
All integrals here run over the whole real line.
| Quantity | Formula | Finite when |
|---|---|---|
| Mean | ||
| Function of | ||
| Variance | ||
| Mixed distribution | both parts converge absolutely |
The second row is the law of the unconscious statistician, and the variance also equals . A density that is outside a bounded interval has finite moments of every order. A nonnegative variable can have an infinite mean, as the density on does, and the mean is undefined when the positive and the negative parts are both infinite. The density on has , and . The mixed example above has .
Lessons Continuous Expectation and Variance
Uniform distributions
For , a variable has density on and elsewhere, and for
For , , with either endpoint included or not. The mean is and the variance is . Given that lies in a subinterval, is uniform on that subinterval. A constant density needs a bounded interval, so no uniform distribution exists on the whole line or on .
For , the -quantile of any is the smallest with , also called the th percentile. A median is a number with and . For the -quantile is and the median is the midpoint. For the mean is , the variance is and the -quantile is .
Lessons Uniform Distributions
Exponential and Normal Models
Waiting times are often modeled by exponential distributions and measurement errors by normal ones. The exponential distribution has no memory, and every normal probability or quantile reduces to the standard normal CDF .
Exponential distributions
For a rate , a variable has density
and for .
| Quantity | Value |
|---|---|
| Survival probability , for | |
| CDF , for | |
| Mean and standard deviation | |
| Variance | |
| -quantile, for | |
| Median |
The rate is measured per unit of time, so has no unit, and the mean is a time. Some books use the scale instead. The exponential distribution is memoryless, since for all
and among nonnegative variables with a density it is the only memoryless one. With per minute, the mean wait is minutes, and the median is minutes.
Lessons Exponential Distributions
The normal distribution
For a real and , a variable has density
for every real , mean , variance and standard deviation . The density is symmetric about , highest there and has inflection points at . Standardizing gives , and conversely . More generally for constants and . The standard normal CDF has no elementary formula, satisfies and has .
For every normal distribution and , , which is about , and for , and . These values are facts about normal distributions only. For other distributions with finite variance, Chebyshev’s inequality guarantees only that this probability is at least .
Lessons The Normal Distribution
Normal probabilities and quantiles
For and ,
with the same value when either inequality is not strict. For a threshold with z-score , the upper tail is . For the -quantile is , where and . For , the central interval with probability is .
For , , and the th percentile is .
Lessons Normal Probabilities and Quantiles
Choosing a continuous model
| Model | Values | What it assumes | Tails |
|---|---|---|---|
| subintervals of equal length are equally likely | none outside | ||
| a waiting time with no memory | |||
| every real number | symmetric variation around | very thin, |
State the parameter convention with every model, because other books write the exponential distribution with its mean and the normal distribution with its standard deviation. Multiplying by a constant , as in a change of units, gives
for , and . Judge a model by its support, its mechanism and its tails, and check the probabilities that a decision depends on, rather than the look of a curve. Models that agree near the center can differ greatly in the tails.
Lessons Choosing a Continuous Probability Model
Transformations, Approximations and Monte Carlo
The distribution of a function of a random variable follows from its CDF, and uniform random numbers can be turned into draws from any distribution. The central limit theorem explains why sums and averages are approximately normal, and every exact, approximate or simulated answer carries its own kind of error.
The CDF method and inverse-CDF sampling
For , the CDF method computes
for every real . Find the values that can take, solve on every branch, compute the probability, and differentiate when a density is wanted.
- Increasing maps. For a continuous, strictly increasing , . For a strictly decreasing one, .
- Squares. For a continuous and , .
- Unbounded densities. For , the square has and density on , which is unbounded and still a valid density.
For any CDF , the generalized quantile is for . If , then has CDF , which is inverse-CDF sampling, and when is continuous and strictly increasing. For this gives . In the other direction when is continuous, but not for discrete distributions.
Lessons Transformations and Inverse-CDF Sampling
The law of large numbers for continuous variables
The Chebyshev bound uses only the mean, the variance and independence, so the weak law holds for every IID sequence with finite variance, discrete or continuous. For observations, , and a miss of at least has probability at most once . The bound is conservative, and for this model the actual probability is far smaller. Independence matters. If every observation equals the same variable , then for every and averaging does not concentrate anything. A running average plotted against is one path, not a picture of the sampling distribution.
Lessons The Law of Large Numbers for Continuous Variables
The central limit theorem
Let be IID with mean and variance . Then for every real
that is, the standardized sum converges in distribution to . It equals the standardized mean . For large this justifies
but the theorem gives no bound on the error at any fixed . If the observations are themselves normal, these laws are exact for every . With infinite variance the theorem does not apply, and the average of IID standard Cauchy variables is again standard Cauchy for every . For observations with and , the standard error is and .
Lessons The Central Limit Theorem
Poisson and normal approximations
| Approximation of | Use it when | Error control |
|---|---|---|
| is large and is small | for every set | |
| with continuity correction | and are both large | none from the theorem at a fixed , and rules such as and are rough guides |
The continuity correction lets each integer stand for the interval from to . For integers it approximates by for the normal with the same mean and variance. Rewrite strict inequalities first, so becomes and then .
The absolute error of an approximation to an exact probability is , and its relative error is , the right measure for small tail probabilities. For , the exact . The corrected normal value is off by about percent, and the uncorrected by about percent.
Lessons Poisson and Normal Approximations
Monte Carlo estimation
To estimate with , draw independently from the model and average,
The estimator is unbiased, and it converges in probability to . A probability is the expectation of an indicator, so its estimate is the fraction of draws in which the event occurs. If is finite, the standard error is , and in practice is estimated by the sample standard deviation of the values . Halving the standard error takes four times as many draws, and the standard error is at most when .
For large the central limit theorem motivates the approximate percent interval , whose coverage is not guaranteed at a fixed . When , Chebyshev’s inequality guarantees for every and every . Estimating as the fraction of uniform points in the unit square that land in the quarter disk, points give a standard error of about . Record the generator, the seed and so that a run can be reproduced.
Lessons Monte Carlo Probability and Expectation
Exact, approximate or simulated answers
Every reported number carries some kind of error, and each kind means something different. Here is the exact probability in the model.
| Error | Where it comes from | What is known about it |
|---|---|---|
| Rounding | writing a decimal | at most half a unit in the last digit shown |
| Approximation | replacing the model by a simpler law, value | one fixed number for the given model, event and method, known only when checked or bounded |
| Simulation | finitely many runs, value | random, with mean and standard error for independent runs |
| Model and inputs | assumptions or inputs that differ from the real process | not reduced by any calculation inside the model |
Use the exact answer when it can be computed. Use an approximation when the exact answer is impractical and the approximation can be checked for the event in question. Use simulation when the model is easy to simulate and hard to calculate, and report its standard error. Recomputing the target over the plausible range of each uncertain input shows how much the conclusion depends on it.
Lessons Choosing Exact, Approximate or Simulated Answers
Random Processes and Introductory Markov Chains
A random process is a family of random variables indexed by time. Bernoulli processes and random walks are built from independent steps, a Poisson process counts arrivals in continuous time, and a Markov chain moves between states by a transition matrix whose powers give probabilities several steps ahead.
Bernoulli processes and random walks
A Bernoulli process is a sequence of independent trials with . The count is , and the first success time is geometric, with and so . Counts over disjoint blocks of trials are independent, while the cumulative counts are dependent, with for .
A simple random walk starts at a fixed integer and moves by independent steps equal to with probability and with probability , so . For and steps to the right, .
| Quantity, for | Value |
|---|---|
| , for | |
| Possible positions | |
| Drift | |
| Mean | |
| Variance |
A path with steps to the right has probability . For the symmetric walk, with , . Visiting a position at some time up to is a different event from ending there at time .
Lessons Bernoulli Processes, Simple Random Walks
Poisson processes
A counting process counts the arrivals in . It is a homogeneous Poisson process with rate when
- it starts at ,
- the count in every interval is , which makes the increments stationary, and
- the counts in disjoint intervals are independent, which makes the increments independent.
A Poisson count in one interval does not by itself make a Poisson process, because the third condition is part of the definition. The rate is the expected number of arrivals per unit time, . At least one arrival in an interval of length has probability , which is less than for . Overlapping counts are dependent, with for .
The waiting times follow from , where is the time of arrival number .
- First arrival. Since , the first arrival time is .
- Gaps. The times between consecutive arrivals are independent, each , and from any fixed time the wait until the next arrival is whatever happened before.
- Later arrivals. The time is a sum of gaps, with mean and variance , so it is not exponential for .
The count in is , so the waiting time for arrival number has
With per hour, no arrival in minutes has probability , and the second arrival comes within an hour with probability .
Lessons Poisson Process Basics, Arrival Counts and Waiting Times
Markov chains and transition matrices
A sequence with values in a finite or countable state space is a Markov chain when the next state depends on the past only through the present state. For every , all states and and every event that fixes , whenever ,
The chain is time-homogeneous when these probabilities do not depend on , a separate assumption. The transition matrix has row for the current state and column for the next state, nonnegative entries and rows that add to . With the row vector of the probabilities ,
| Quantity | Formula |
|---|---|
| Path probability | |
| One step | |
| steps | |
| -step transition probability | |
| Chapman-Kolmogorov relation |
Under the column convention of some books every matrix and vector is transposed, and the two conventions must not be mixed. The probability of being in at time is an entry of , while for a start the probability of visiting at some time up to is at least as large and is found by making absorbing. For two states and with
a chain that starts in is in two steps later with probability .
Lessons Markov Chains and Transition Matrices, Multi-Step Markov Probabilities
Stationary distributions
A row vector is a stationary distribution of a chain on a finite state space when
A chain started from keeps the distribution at every step. The equations are the balance equations. One of them always follows from the others, and the normalization takes its place. Equivalently, at every state the probability flow out to other states equals the flow in from other states. The pairwise condition , called detailed balance, is sufficient but not necessary.
For a finite chain,
- at least one stationary distribution exists,
- if the chain is irreducible, so that every state can be reached from every other state, the stationary distribution is unique, and
- if the chain is irreducible and aperiodic, then from every initial distribution.
The period of a state is the greatest common divisor of the step counts with , and a state with has period . The identity matrix makes every distribution stationary, and the matrix that swaps two states has the unique stationary distribution , yet from a fixed start it alternates forever. A two-state chain with and , where , has
and . For the two-state matrix of the previous topic, and , so and the gap halves at every step.
Lessons Stationary Distributions
Hitting times and absorption
For a nonempty set of target states, the hitting time is the first time the chain is in , with if it never gets there. A state is absorbing when . Write and for a chain started at . Conditioning on the first step gives linear equations.
| Quantity | Boundary values | Equation for outside |
|---|---|---|
| Hitting probability | on , and where cannot be reached | |
| Expected hitting time | on |
On a finite state space the probability equations with both kinds of boundary values have exactly one solution, and if can be reached from every state, every is finite. If , then , so check finiteness before solving for expected times. For the symmetric walk on absorbed at and , the walk started at reaches before with probability , and the expected time to absorption is . For and these are and .
Lessons Hitting Times and Absorption
Choosing and checking Markov models
- State and time step. A state definition gives each observation time exactly one label from a fixed list, and the time step says what separates from . A matrix for one step does not determine a matrix for a shorter step.
- Markov assumption. The Markov property is a claim about the real process under the chosen states, and no matrix or diagram can prove it. A refined state that records more of the history can make it hold.
- Empirical matrix. If state is followed by state in of the observed departures from , the estimate is for every with . These estimates carry sampling error.
- Checks. Split the departures from one state by time period to check time homogeneity, or by earlier history to check the Markov assumption, and compare the estimated rows. A difference may be sampling variation, and agreement does not prove the assumption.
- Limits. Every output is exact for the model and describes the real process only as far as the states, the time step and the assumptions fit it. A simulation of the model checks the program, not the model.
Lessons Choosing and Checking Markov Models
Integrated Probability Investigations
The last two lessons build complete models from stated assumptions. Each one computes exact answers, checks part of the model by simulation and says what the model cannot show.
Building and checking a complete model
- Specify. Name the experiment, the events and random variables with their supports, the numerical inputs and the assumptions that link them, such as independence, replacement and rates. Everything else is an output, not a free choice.
- Build the joint model. Turn conditional rates into joint probabilities with the multiplication rule, then use total probability and Bayes’ theorem.
- Combine parts carefully. Multiply probabilities across parts of the model only where independence was assumed. A fixed batch of items gives a binomial count, while a fixed time window of a Poisson process holds a random, Poisson number of items.
- Compute exactly. Derive each answer from the specification and keep its conditions with it.
- Test sensitivity. Change one input or assumption at a time and see which conclusions move.
- Check by simulation. Simulate a submodel with a recorded generator and seed, and compare the estimate with the exact value using its Monte Carlo standard error. Agreement supports the program, not the claim that the model describes a real system.
In the constructed inspection model of the first investigation, an item is faulty with probability , and an alert is raised with probabilities and . Then and . A review takes minutes for a faulty alerted item, minutes for any other alerted item and none without an alert, so the expected review time per item is minutes. Among independent items the number of alerts is , with mean , and at least one alert occurs with probability .
Lessons A Discrete Probability Investigation, A Complete Introduction to Probability Investigation