Sample Spaces and Complements
Section titled “Sample Spaces and Complements”A sample space lists the possible outcomes of a random experiment. When these outcomes are equally likely,
The equally-likely condition matters. The sums of two dice are not equally likely, but the ordered pairs of face values are.
Example. Two fair six-sided dice are rolled. Find the probability that at least one die shows a six.
Use the complement, where neither die is a six. Each die then has five allowed outcomes, so
Adding the two probabilities without correction would count the outcome twice.
Conditional Probability and Independence
Section titled “Conditional Probability and Independence”Conditional probability restricts attention to an event already known to have happened:
Events are independent if . Disjoint events cannot happen together; independent events do not change each other’s probabilities. These are different conditions.
Example. Two fair dice are rolled, and their sum is known to be even. Find the probability that both dice show odd numbers.
There are odd–odd pairs and even–even pairs, so the conditional sample space has equally likely outcomes. Exactly satisfy the requested event. The probability is .
For sequential sampling without replacement, multiply conditional probabilities. For example, if a bag has three red and two blue balls, the probability of drawing two reds is , since the composition changes after the first draw.
For a partition into cases , total probability gives . Bayes’ formula reverses the conditioning:
Use it when the outcome is known but the case that produced it is unknown.
Random Variables and Expected Value
Section titled “Random Variables and Expected Value”A random variable assigns a number to each outcome. Its expected value is the probability-weighted average:
An expectation need not be an attainable value. A fair die has expected value even though no face shows .
For random variables with finite expectations, linearity of expectation states
No independence is required. This makes it possible to average a complicated total without finding its entire distribution.
Example. Six fair dice are rolled. Find the expected sum of their face values.
Each die has mean . Add the six expectations to get .
Indicator Variables
Section titled “Indicator Variables”An indicator equals one when event occurs and zero otherwise. Therefore . If counts how many events occur, write it as a sum of indicators.
Example. A uniformly random permutation of distinct objects is chosen. Find the expected number of fixed points.
Let if position contains its original object. Exactly of the permutations fix that position, so . Thus
The indicators are dependent, but linearity still applies.
Example. Each of five people independently chooses one of four rooms uniformly. Find the expected number of nonempty rooms.
For a particular room, the probability everyone avoids it is . Its nonempty indicator therefore has expectation . Summing over rooms gives
Expected Waiting Times and States
Section titled “Expected Waiting Times and States”If independent trials each succeed with fixed probability , the expected waiting time for the first success is . Let be that expected time. After one trial, success finishes the experiment, while failure returns to the starting situation:
For patterns, success chances depend on recent outcomes. Define a state containing just enough history to describe the next transition.
Example. A fair coin is tossed repeatedly. Find the expected number of tosses needed to see two consecutive heads.
Let be the remaining expectation when there is no trailing head, and the expectation after one trailing head. Count the next toss in each equation:
The zero corresponds to another head, which completes the pattern. The first equation gives . Substituting into the second yields . We start in state zero, so the answer is six tosses.
Choosing Between Binomial and Hypergeometric Models
Section titled “Choosing Between Binomial and Hypergeometric Models”Repeated independent trials with the same success probability produce a binomial count. Exactly successes in trials have probability
Choose the success positions, then multiply the probabilities along that specified pattern. Independence and a fixed probability are both required.
Sampling without replacement from a finite population gives a different model. If of objects are marked and objects are chosen uniformly, exactly marked objects occur with probability
This is the hypergeometric formula. The numerator chooses the marked and unmarked portions of the sample. Unlike sequential multiplication, it avoids keeping track of the changing composition after each draw.
Example. Five objects are chosen uniformly without replacement from eight red and seven blue objects. Find the probability of exactly three reds.
A sample is an unordered five-element subset, so the probability is
The binomial expression would describe replacement sampling instead and is not correct for this experiment.
Bayes’ Formula with a Hidden Choice
Section titled “Bayes’ Formula with a Hidden Choice”When an experiment first selects a source and then produces an observation, condition on the source before calculating the observation probability. Bayes’ formula then updates the source probabilities after the observation is known.
Example. Urn A is chosen with probability one-third and contains white balls with proportion two-thirds. Urn B is chosen with probability two-thirds and has white proportion one-quarter. A ball drawn from the selected urn is white. Find the probability that A was chosen.
The two disjoint ways to observe white have probabilities
Thus , and
The posterior is greater than one-third because a white ball is more likely under A. This directional check helps catch an inverted conditional probability.
The observation mechanism matters. If a host or observer chooses what to reveal, their rule can change the conditional sample space. State the rule before assigning probabilities; “one possibility was removed” does not automatically make the remaining possibilities equally likely.
Indicators for Pairs and Positions
Section titled “Indicators for Pairs and Positions”Indicators are useful even when the total is not visibly a count of separate objects. A count of pairs suggests one indicator per pair; a count of adjacency events suggests one per edge or neighboring position.
Example. A uniformly random permutation of is chosen. Find the expected number of inversions, pairs whose values occur in reverse order.
For each pair of distinct values , let its indicator be one when appears before . The two relative orders are equally likely, so each indicator has expectation one-half. There are pairs, giving
Dependence among the pair indicators does not matter for this expectation.
Example. In a random permutation of with , find the expected number of pairs of consecutive values that occupy adjacent positions.
For a specified pair , treat the values as a block. There are permutations placing them together, so the probability is . Summing the indicators for the consecutive-value pairs gives
A run containing three consecutive values may contribute two indicators, which is appropriate because the requested quantity counts pairs, not runs.
This last distinction is important. If the problem asks for maximal runs, an indicator for every adjacent match counts the wrong object. Define the random variable before choosing its decomposition.
Tail Sums and Coupon Collection
Section titled “Tail Sums and Coupon Collection”For a nonnegative integer-valued random variable,
whenever the expectation is finite, with the same identity allowing infinity. An outcome with value contributes one to exactly the first tail indicators. This representation is useful when the probability of exceeding a threshold is easier than the probability of one exact value.
Another useful decomposition splits a waiting process into stages. Collecting a new type after several types are already known is a geometric wait with a changing success probability.
Example. A fair six-sided die is rolled until every face has appeared. Find the expected number of rolls.
After distinct faces have appeared, the next roll introduces a new face with probability . The expected wait for that next new face is . Add the six stage expectations:
The stage waiting times need not be proved independent to add their expectations. What matters is that they sum to the total collection time and each stage has the stated geometric distribution.
For equally likely types, the same argument gives , where . If the types have different probabilities, the success chance depends on which types are missing, not just how many. A single count state no longer determines the process.
Hitting Probabilities and Expected Duration
Section titled “Hitting Probabilities and Expected Duration”State recurrences can calculate either a probability or an expectation, but the equations differ. A hitting probability averages the next-state probabilities. An expected remaining duration adds one for the next move before averaging.
Consider a fair random walk on integers , stopping at either endpoint. Let be the probability of reaching first from state . Then
The interior equation says consecutive differences are equal, so .
For expected duration , the equations are
A quadratic trial gives . It satisfies both boundary values and the recurrence. The finite absorbing system has a unique solution; absorption has finite expectation because every block of sufficiently many moves has a fixed positive chance of reaching a boundary.
Example. A player starts with three dollars and repeatedly wins or loses one dollar with equal probability, stopping at zero or ten dollars. Find the probability of reaching ten and the expected number of games.
Take . The hitting probability is , while the expected number of games is . These are different random quantities and come from different state equations.
Variance and Dependence
Section titled “Variance and Dependence”Expectation describes the average, while variance measures spread:
For a Bernoulli indicator with success probability , the variance is because . For independent random variables, variances add. Without independence, covariance terms appear:
This is why linearity of expectation cannot be copied blindly into a variance calculation. For example, if , then , not twice the variance. A contest problem asking for a second moment usually requires analyzing pairs of indicators and the probability that both events occur.
A Second Moment for Fixed Points
Section titled “A Second Moment for Fixed Points”Second moments show precisely where dependence enters an indicator calculation. For a random permutation of objects, let count fixed points and write .
Since ,
A specified pair of positions is fixed in of the permutations, so its joint probability is . Therefore
The mean is one, hence .
This result does not follow by adding the individual indicator variances, because those indicators are not independent. The pair terms supplied the missing information. At the fixed-point count is constantly one and has variance zero, so that boundary case must be excluded from the formula.
The same expansion works for counts of collisions, adjacent matches, or intersecting pairs. Separate pairs of indicators by whether their underlying objects overlap, calculate each joint probability, and combine the categories.
Expected Number of Permutation Cycles
Section titled “Expected Number of Permutation Cycles”A uniform permutation of objects can be built from a uniform permutation of objects in cycle notation. Insert the new object after any one of the existing objects, or let it form its own cycle. These are equally weighted choices, and deleting the new object reverses the construction uniquely.
Only the singleton choice increases the cycle count. Therefore
and the initial value one gives .
The expected count grows slowly even though a permutation can have anywhere from one to cycles. This is another example where a recursive construction makes the expectation easier than the entire distribution.
Uniformity is the key justification: selecting an insertion position with arbitrary unequal probabilities would not generate a uniform permutation and would change the calculation.