Definition of Random Variable
On a probability space , a real random variable is a function such that for every real . This measurability condition makes the probabilities below meaningful.
Probability functions
A discrete variable has a countable set with . Its probability mass function is . Countable additivity on the disjoint events gives
An absolutely continuous distribution has a nonnegative integrable density such that, for every Borel set ,
Taking gives total integral one; taking a singleton gives . Density values at individual points do not affect probabilities. Having infinitely many possible values does not imply existence of a density. Mixed distributions have both atoms and a continuous part; singular continuous distributions also exist, so PMFs and PDFs do not exhaust all distributions. In the examples below, “continuous” means absolutely continuous.
Cumulative distribution function
Every real random variable has a CDF:
For a discrete variable it is the sum of masses at ; when a density exists it is the integral of that density over .
is nondecreasing and right-continuous, with limits zero at and one at . Moreover,
First derive continuity of probability from countable additivity. If , partition into and the disjoint increments . The partial sums show . Taking complements proves the analogous result for decreasing events.
The events are nested, giving monotonicity. As , the events decrease to , proving right-continuity (monotonicity then handles every approach from the right). The events increase to and decrease to the empty set because is finite-valued. These give the two limits. Subtract the probabilities of nested events to obtain the interval formula. Finally increases to , so its limiting probability is ; subtracting from gives the atom formula.
See Expectation and Variance for integrals of random variables.
Some Examples
Below are some examples of random variables in different contexts: discrete, continuous, and mixed.
Discrete Random Variable
Consider a simple example of rolling a fair six-sided die. The sample space consists of the outcomes . We can define a random variable that maps each outcome to its value. For example, if we roll a die and get a 3, then . The probability distribution of this random variable is uniform, meaning each outcome has an equal probability of .
PMF: for
For detailed calculations of expected value and variance, see Expectation and Variance.
For a fair die, the CDF accumulates the six equal probability masses into a staircase.
Continuous Random Variable
A normal variable can be negative. To model nonnegative rainfall, let have the conditional distribution of given . Write and for the standard normal density and CDF. Conditional probability gives
because by normal symmetry. Integrating gives
The limits are zero and one, verifying normalization. For example,
The parameters and describe the normal variable before truncation; they are not exactly the mean and standard deviation of .
This separate uniform-distribution example shows probability as area under a density, and the CDF as accumulated area.
Mixed Random Variable
A customer receives immediate service with probability . Otherwise the waiting time has an exponential distribution with rate . For , partitioning by the immediate-service event gives
For , . The jump at zero has size , so . On the continuous part has density and total mass . Its integral alone cannot describe the atom; the full distribution is
Comparison: Discrete and Absolutely Continuous Distributions
| Aspect | Discrete | Absolutely continuous |
|---|---|---|
| Defining property | Probability one on a countable set | Probabilities are integrals of a density |
| Individual points | Atoms may have positive mass | Every point has probability zero |
| CDF | Sum of masses at values at most | Integral of density up to |
| Expectation, when integrable | Sum of value times mass | Integral of value times density |
Joint Random Variables
Random variables on the same probability space define a random vector . Their joint distribution assigns a probability to each Borel subset of .
For discrete variables, . Disjointness of the point events gives total mass one and the marginal formulas
If the joint distribution has a density , its integral over a set is the probability of that set. Integrating out a coordinate gives
Indeed, integrate either expression over a Borel set ; Tonelli's theorem for nonnegative integrands identifies the result with the probability of or . Tonelli is a measure-theoretic prerequisite not proved here. Individual densities do not guarantee a joint density: if is uniform and , all joint mass lies on the diagonal, whose planar area is zero, contradicting any putative density formula.
Independence means for all Borel sets . In the discrete case this is equivalent to : necessity follows using singletons, and sufficiency by summing over . For joint densities, factorization almost everywhere is sufficient by iterated integration. Necessity uses uniqueness of probability measures determined by rectangles and uniqueness of densities almost everywhere; these measure-theoretic results are prerequisites not proved here.
Consider rolling two fair six-sided dice. Let be the outcome of the first die and be the outcome of the second die.
Joint PMF: for
Marginal PMFs:
Since , the dice rolls are independent.
Consider the relationship between height and weight of adults. These are typically not independent.
In a model admitting a joint density, describes how height and weight are distributed together in the population.
- The marginal density gives the distribution of heights regardless of weight
- The marginal density gives the distribution of weights regardless of height
Since height and weight are correlated, .
Exercises
One of the 256 subsets of is chosen uniformly at random. Let be the number of elements in this subset. Let be 1 if the subset is empty and the least element of the subset otherwise.
- Are the events "" and "" independent?
- Are the random variables and independent?
- What is ?
Since each of the subsets is equally likely, each is chosen with probability .
- Independence of Events and :
We check whether .
- There are subsets with exactly 1 element, so .
- A subset has least element 3 if and only if it contains 3 and a subset of , giving subsets. Thus .
- The event " and " corresponds to the unique subset , so . Since
, the events are independent.
-
Independence of Random Variables and : Consider and .
- (only the full set ).
- (only the singleton ).
- However, a subset cannot simultaneously have 8 elements and have 8 as its minimum element, so . Therefore, and are not independent random variables.
-
Conditional Probability :
- The subsets with minimum element are subsets of (excluding , which has ). There are such subsets: . Thus .
- The total number of subsets with is . Among these 37 subsets, those with are the 6 non-empty subsets with at most 2 elements from : . Therefore, the number of subsets with and is .
A common pitfall in part 3 is attempting to count subsets with and by multiplying . This overcounts sets where both elements are , because pairs like would be counted twice depending on which element is picked first.
Two fair six-sided dice are rolled independently. Let denote the product of the two face values. Determine the probability mass function for all possible values of .
There are equally likely outcomes with . Counting the factor pairs for each product :
Five men and five women are ranked according to their examination scores, with all possible rankings equally likely and no tied scores. Let denote the highest rank achieved by a woman (e.g. if a woman finishes first). Find the PMF of .
The woman with the highest rank can finish anywhere from rank 1 to rank 6 (since if all 5 men take the top 5 spots, the top woman finishes 6th).
For (), the first positions must be occupied by men, position must be occupied by a woman, and the remaining positions are filled by the remaining 4 women and men.
Equivalently, choosing the 5 positions for women out of 10 total positions: the top woman at position means the remaining 4 women must be chosen from the positions below rank . Therefore:
Explicit probabilities:
Comments