An order can pass through several processing routes, but for planning only one number matters, how many follow-up messages the order will need. Before the order is handled that number is uncertain, yet a probability model can say how likely each value is. This lesson defines a random variable as a numerical function of the outcomes and shows how a probability mass function and a cumulative distribution function describe its distribution. It also shows why the events and can have different probabilities.
Key terms
Random variable
Definition A random variable is a function that assigns a real number to each outcome of a sample space . For a set of real numbers, the event consists of the outcomes with in , and is its probability. In particular is the set of outcomes that maps to the number . A capital letter names the random variable and a lowercase letter names one of its possible values.
In plain words The randomness lies in which outcome occurs. The random variable is a fixed rule that reads one number off that outcome, and several outcomes can give the same number.
Example Five processing routes , , , and have probabilities , , , and . Let be the number of follow-up messages, with , and . The event is , so . The variable keeps only the count and sets the other details of the route aside.
Discrete random variable
Definition A random variable is discrete if there is a finite or countably infinite set of real numbers with . Countably infinite means that the values can be listed in a sequence that never ends.
In plain words A discrete random variable takes separate values that can be listed, such as and so on, and its probability sits on those individual values. Counts are the typical case. A quantity measured on a continuous scale, such as a waiting time, is usually modeled in a different way, with a density.
Example The follow-up count takes only the values , and , so it is discrete with finitely many values. Let be the number of tosses of a fair coin up to and including the first head. Its values are with , and these probabilities add to , so is discrete with countably infinitely many values.
Support
Definition The support of a discrete random variable is the set of values with . The probabilities of the values in the support add to , and every value outside the support has probability .
In plain words The support lists the values that the variable takes with positive chance. A value written in a table with probability is not part of it.
Example The follow-up count has support . If a table also listed the value with probability , the support would still be . The value is outside the support, so , even though it lies between two support values.
Probability distribution
Definition The probability distribution of a random variable is the rule that gives the probability for every set of real numbers, that is, how the total probability is spread over the possible values. For a discrete random variable the distribution is determined by the probabilities of the individual support values, through
where the sum runs over the support values that lie in . Different random variables can have the same distribution.
In plain words The distribution says which values can take and how likely every set of values is. It is a model for a value that has not been observed yet, not a table of frequencies in observed data.
Example The follow-up count has the distribution with probabilities , and at the values , and . Suppose 10 observed orders needed , and follow-ups , and times. The relative frequencies , and summarize those data, and they can be compared with the model, but they are not the model. For a second example, toss a fair coin once and let count heads and count tails. These are different random variables, since means they never take the same value. Yet each takes the values and with probability , so they have the same distribution.
Probability mass function
Definition The probability mass function, or PMF, of a discrete random variable is the function
defined for every real number . A function is the PMF of some discrete random variable exactly when for every , for at most countably many , and those positive values add to . Nonnegativity and the total of are separate requirements. A table with a negative entry can still total , and a table of nonnegative entries can fail to total .
In plain words The PMF puts a mass of probability on each possible value. To find the probability of any event about , list the values that satisfy it and add their masses.
Example For the follow-up count, , , and for every other . The masses are nonnegative and . The event contains the values and , so it has probability . The event contains only the value , so it has probability . The masses , and total but do not form a PMF, and neither do the masses , and , whose total is .
Cumulative distribution function
Definition The cumulative distribution function, or CDF, of a random variable is
for every real number . It is nondecreasing, it approaches as and as , and it is right-continuous, so its value at a point includes the probability at that point. For a discrete random variable the jump of at each value equals , and when the support values are spaced apart, as with counts, is a step function that is flat between them. For real numbers ,
and for every real the strict event has probability .
In plain words The CDF gives, for every cutoff , the probability that is at most . Moving the cutoff to the right can only add values, so the CDF never decreases. With discrete values the inequality sign matters, because a single value can carry positive probability.
Example For the follow-up count,
So , while . The difference is the probability of the values and . The event also has probability , but , because that difference is and leaves out the mass at .
Check yourself
- A random variable takes only the values , and , with and . Find and .
Show the answer
The masses must add to , so . The event contains the values and , so . This is not , which is the probability of the different event .
- For the random variable of question 1, find , and , and write out its CDF.
Show the answer
The strict event contains and , so its probability is . The inclusive event contains every support value, so its probability is . No support value lies between and , so . The CDF is
- Someone proposes the following function as the CDF of a count. Can it be one?
Show the answer
No. The function falls from to at , but a CDF never decreases, because the event is contained in the event . Reading the jump at as a probability mass would give , and a probability cannot be negative.