Random Variables & the Probability Mass Function
A random variable (Definition 12.1) is not a number but a function that reads each outcome of an experiment and reports a real value — the sum of two dice, a gambler's change in wealth, a count. Writing turns a question about values into an event with a probability , and the whole family of these probabilities is the probability distribution of (Definition 12.2). This lesson concentrates on discrete random variables (Definition 12.3), whose values form a finite or countably infinite list that carries all the probability. For them the distribution collapses to a single object, the probability mass function (Definition 12.4): every probability becomes a sum of masses, , and a function is a legitimate p.m.f. exactly when it is nonnegative and sums to . We build p.m.f.s and read probabilities off them for a pair of dice (Examples 12.1, 12.3), a wealth/payoff game (Examples 12.2, 12.4), and a biased spinner. (Continuous random variables and densities are left for a later lesson.)
Before you start — give these a try
Attempting first primes your brain for the lesson — even if you miss. Nothing is graded or saved; it's just a warm-up.
Which of the following functions is a valid probability mass function (nonnegative and summing to )?
Two fair dice are rolled and is their sum ( equally likely ordered outcomes). Find . Give your answer as a decimal to places.
What you’ll be able to do
- State Definition 12.1: a random variable is a function , taking the value at each outcome , and learn to read an experiment (a pair of dice, a payoff game) through such functions.
- Interpret the event for , and describe the probability distribution of as the family of probabilities (Definition 12.2).
- Recognise a discrete random variable (Definition 12.3) by its finite or countably infinite range with , and identify its possible values.
- Define and build the probability mass function (Definition 12.4), and use to compute probabilities such as and .
- Test whether a function is a valid p.m.f. by checking nonnegativity () and total mass (), and solve for a missing mass — using the dice (Examples 12.1, 12.3) and the wealth game (Examples 12.2, 12.4).
In your course
· MATH2015 · Linear Algebra & Probability- Definition 12.1Random variableA random variable is a function on a sample space ; its value at is .
- Definition 12.2Probability distributionThe collection of probabilities for subsets , where .
- Definition 12.3Discrete random variableis discrete if its range is finite or countably infinite, , with .
- Definition 12.4Probability mass functionon the possible values of ; then . Valid p.m.f.: and .
- Example 12.1A pair of dice:, , ; the event has .
- Example 12.2The wealth gameon , on , on ; possible values .
- Example 12.3p.m.f.s of andfor ; runs ; and .
- Example 12.4p.m.f. of the wealth game.
Random variables: functions on the sample space
A random variable (Definition 12.1) is neither a varying number nor random on its own — it is a function that attaches a real number to every outcome of an experiment. The randomness lives entirely in which outcome the experiment produces; once is fixed, the value is completely determined. By convention random variables wear uppercase letters , while denotes the value at a sample point. For a pair of dice, , and we may define (first die), (second die), and (the sum); for the outcome these give , , . A random variable thus repackages raw outcomes into the number we actually care about — a total, a payoff, a count — converting an experiment about dice faces into one about sums.
Events $\{X\in B\}$ and the probability distribution
Because is a function, we can ask how likely it is to land in a target set. For a subset , the shorthand (read ' lies in ') names the event consisting of every outcome whose -value falls in : Since this is a genuine subset of , it is an event in and carries a probability inherited from the underlying probability space. Useful special cases are (take ) and (take ). The probability distribution of (Definition 12.2) is the entire collection of these numbers as ranges over subsets of — a complete description of how spreads its probability along the real line. For the dice sum, collects , so .
Discrete random variables
A random variable is discrete (Definition 12.3) when its range — the set of values it can take — is finite or countably infinite, say , and these values carry all the probability: The values with are the possible values of . Discreteness is exactly what makes exact, by-hand computation possible: a discrete places all of its probability on a list of isolated points, so any probability about is a sum over those points, never an integral. The sum of two dice () and the wealth change () are discrete with finite range; a quantity that can in principle grow without bound (such as the number of tosses until the first head) is discrete with countably infinite range. Continuous random variables — whose probability is smeared over intervals and found by integration — are the subject of a later lesson.
The probability mass function (p.m.f.)
For a discrete the whole distribution is captured by one function. The probability mass function (p.m.f., Definition 12.4) is defined on the possible values of : it records how much probability 'mass' sits at each point. Knowing the p.m.f. is knowing everything, because for any set so every probability about is read off by summing masses (for instance ). A function is a valid p.m.f. precisely when it meets two conditions mirroring the probability axioms: it is nonnegative, for every (a probability is never negative), and it has total mass one, (all the probability is accounted for). Any meeting both defines a legitimate discrete random variable; fail either and it is not a p.m.f. For example the first die has for (six masses of summing to ), and the wealth game has .
Let be a sample space. A random variable is a function . Its value at a sample point is written , and random variables are denoted by uppercase letters such as , , .
For a random variable and a subset , the set is an event with probability . The probability distribution of is the collection of all these probabilities , taken over subsets .
A random variable is discrete if its range is a finite or countably infinite set and . The values for which are the possible values of .
The probability mass function (p.m.f.) of a discrete random variable is , defined on the possible values of . For any subset , . A function is a valid p.m.f. iff for all and .
Worked examples
Examples 12.2 & 12.4 (the wealth game). A fair die is rolled. The player's wealth changes by if the outcome is , , or ; by if it is ; and by if it is or . Let be the change in wealth. Describe as a random variable, find its probability mass function, check that it is valid, and compute .
- 1
as a function on . The sample space is , and the payoff rule defines , , — a function , hence a random variable.
- 2
Possible values. takes the values , so it is discrete with finite range.
- 3
Collect outcomes for each value. , , . The die is fair, so each face has probability and .
- 4
The p.m.f. , , .
- 5
Validity check. All three masses are , and , so is a valid p.m.f.
- 6
. Take , which catches the values and : .
Examples 12.1 & 12.3 (a pair of dice). Two fair dice are rolled, with ( equally likely outcomes). Let be the sum. Find the probability mass function of , and use it to compute and .
A biased spinner. A spinner shows one of the numbers . It lands on with probability , on with probability , on with probability , and on with the remaining probability. Let be the number shown. Find , confirm is a valid p.m.f., and compute .