Unit 4, lesson 26

Probability Mass Functions

How a probability mass function lists the probability of each value of a discrete random variable, how to check nonnegative masses and total mass one, find a normalizing constant, and add masses to get event probabilities.

  • Video 26
  • Random Variables and Their Distributions

The rule of a random variable tells you which number to record, but the rule alone does not say how likely each number is. Suppose a small editing task needs 00, 11 or 33 corrections. Before you can answer a question such as how likely at least one correction is, you need the probability that belongs to each of those values. This lesson introduces the function that holds that information, shows how to check that a proposed table of probabilities is valid, and turns any question about the variable into a sum of the right masses.

Key terms

Probability mass function

Definition Let XX be a discrete random variable. Its probability mass function, or PMF, is the function pXp_X defined for every real number xx by

pX(x)=P(X=x).p_X(x) = P(X = x).

It is positive exactly at the values in the support of XX and equal to 00 at every other real number. The input xx stands for a value of XX and can be any real number, and the output pX(x)p_X(x) is a probability.

In plain words For any number you name, the PMF reports how likely the random variable is to equal exactly that number. Values and masses are different kinds of numbers, which is why a PMF table keeps them in separate rows.

Example In a constructed teaching model, let XX be the number of corrections an editing task needs, with the following PMF.

xx001133
pX(x)p_X(x)15\tfrac{1}{5}12\tfrac{1}{2}310\tfrac{3}{10}

So pX(1)=12p_X(1) = \tfrac{1}{2}, and the value 33 is a number of corrections whose probability is 310\tfrac{3}{10}. The value 22 is not in the support, so pX(2)=0p_X(2) = 0, and likewise pX(−1)=0p_X(-1) = 0 and pX(2.5)=0p_X(2.5) = 0. The table assigns probability to three values and zero to every other real number.

Nonnegative masses

Definition A function pp on the real numbers is the PMF of some discrete random variable exactly when three conditions hold. Every mass is nonnegative, so p(x)≥0p(x) \ge 0 for all real xx. The set of values with p(x)>0p(x) > 0 is finite or countably infinite. The masses on that set add to one,

∑x : p(x)>0p(x)=1.\sum_{x \,:\, p(x) > 0} p(x) = 1.

The last condition is called normalization. Together the conditions give p(x)≤1p(x) \le 1 for every xx, since one nonnegative term cannot exceed a sum of nonnegative terms that equals 11.

In plain words No probability can be negative, and the masses must account for all of the probability, no more and no less. The nonnegativity check and the total check each catch mistakes that the other one misses.

Example The correction table passes both checks. All three masses are positive, and written in tenths they add to one,

210+510+310=1.\tfrac{2}{10} + \tfrac{5}{10} + \tfrac{3}{10} = 1.

A proposed table with masses 0.40.4, 0.70.7 and −0.1-0.1 sums to 11 but has a negative mass, so it is not a PMF. A table with masses 0.20.2, 0.50.5 and 0.20.2 has no negative entry but sums to 0.90.9. If its three values are claimed to be all the possible values, 0.10.1 of the probability is unaccounted for and the table is not a PMF. A table that openly lists only some of the values may total less than 11, but it is then a partial report, not a complete distribution.

Normalizing constant

Definition Sometimes masses are known only up to a constant factor, p(x)=c g(x)p(x) = c\,g(x) for xx in a stated finite or countably infinite set SS and p(x)=0p(x) = 0 otherwise. If g(x)≥0g(x) \ge 0 on SS and the sum of gg over SS is finite and positive, normalization forces

c=1∑x∈Sg(x),c = \frac{1}{\sum_{x \in S} g(x)},

and this value is the normalizing constant. It is positive, so every mass c g(x)c\,g(x) is then nonnegative. When the proposed formula can take negative values, solving the normalization equation is not enough, and every resulting mass still has to be checked.

In plain words Write the masses with an unknown scale, add them, and choose the scale that makes the total 11. Then confirm that no mass came out negative.

Example A variable takes the values −1-1, 00 and 22 with masses cc, 2c2c and 3c3c. Normalization gives c+2c+3c=6c=1c + 2c + 3c = 6c = 1, so c=16c = \tfrac{1}{6}, and the masses are 16\tfrac{1}{6}, 13\tfrac{1}{3} and 12\tfrac{1}{2}, all nonnegative with total 11. The same method works on a countably infinite support. For masses c(12)kc\left(\tfrac{1}{2}\right)^{k} at k=0,1,2,…k = 0, 1, 2, \dots the geometric series gives

∑k=0∞c(12)k=c1−12=2c,\sum_{k=0}^{\infty} c\left(\tfrac{1}{2}\right)^{k} = \frac{c}{1 - \tfrac{1}{2}} = 2c,

so c=12c = \tfrac{1}{2} and the masses are 12\tfrac{1}{2}, 14\tfrac{1}{4}, 18\tfrac{1}{8} and so on. Now try p(x)=c(x−1)p(x) = c(x - 1) for x=0,1,2,3x = 0, 1, 2, 3. Normalization gives c(−1+0+1+2)=2c=1c(-1 + 0 + 1 + 2) = 2c = 1, so c=12c = \tfrac{1}{2}, but then p(0)=−12p(0) = -\tfrac{1}{2}. Since normalization allows no other value of cc, this formula defines no PMF.

Event probability as a sum of masses

Definition Let XX be a discrete random variable with PMF pXp_X and support SS. For every set BB of real numbers,

P(X∈B)=∑x∈B∩SpX(x).P(X \in B) = \sum_{x \in B \cap S} p_X(x).

The set B∩SB \cap S is finite or countably infinite, and the events {X=x}\{X = x\} for its elements are mutually exclusive, so their probabilities add. The values in BB outside the support contribute 00 together, because XX lies in SS with probability 11. When BB contains no support value the sum is empty and the probability is 00.

In plain words Mark the support values that satisfy the condition, then add their masses. Words such as at least, at most, fewer than and greater than decide whether an endpoint belongs in the sum.

Example For the correction count, at least one correction means XX is 11 or 33, so

P(X≥1)=pX(1)+pX(3)=12+310=45.\begin{aligned} P(X \ge 1) &= p_X(1) + p_X(3) \\[0.4em] &= \tfrac{1}{2} + \tfrac{3}{10} = \tfrac{4}{5}. \end{aligned}

The complement agrees, since 1−pX(0)=1−15=451 - p_X(0) = 1 - \tfrac{1}{5} = \tfrac{4}{5}. Fewer than three corrections includes 00 and 11 but not 33, so P(X<3)=15+12=710P(X < 3) = \tfrac{1}{5} + \tfrac{1}{2} = \tfrac{7}{10}. At most three includes all three support values, so P(X≤3)=1P(X \le 3) = 1. Now let KK have the countably infinite PMF found above, with masses (12)k+1(\tfrac{1}{2})^{k+1} at k=0,1,2,…k = 0, 1, 2, \dots. The complement of {K≥3}\{K \ge 3\} is {K<3}\{K < 3\}, which contains the support values 00, 11 and 22. That gives P(K≥3)=1−(12+14+18)=18P(K \ge 3) = 1 - (\tfrac{1}{2} + \tfrac{1}{4} + \tfrac{1}{8}) = \tfrac{1}{8}.

Finite uniform distribution

Definition Let SS be a set of n≥1n \ge 1 distinct real numbers. A random variable XX has the uniform distribution on SS if pX(x)=1np_X(x) = \tfrac{1}{n} for every xx in SS and pX(x)=0p_X(x) = 0 otherwise. Then for every set BB of real numbers

P(X∈B)=∣B∩S∣n,P(X \in B) = \frac{\lvert B \cap S \rvert}{n},

where ∣B∩S∣\lvert B \cap S \rvert is the number of elements of SS that lie in BB. The word uniform refers to equal masses on SS. The values need not be evenly spaced, and numbers that lie between elements of SS but are not in SS receive no probability.

In plain words Every listed value is equally likely, so the probability of an event is the fraction of the listed values it contains. When the masses are unequal, that fraction need not equal the probability.

Example Four tickets labeled 22, 55, 99 and 1212 are in a box, and one is drawn with each ticket equally likely. Its label XX is uniform on {2,5,9,12}\{2, 5, 9, 12\}, so each value has mass 14\tfrac{1}{4} and P(X>4)=34P(X > 4) = \tfrac{3}{4}. Although 77 lies between 22 and 1212, the probability P(X=7)P(X = 7) is 00. Even spacing does not make a distribution uniform either. The values 00, 11 and 22 are evenly spaced, but a variable with masses 0.50.5, 0.30.3 and 0.20.2 on them is not uniform.

Probability bar chart

Definition A probability bar chart of a discrete distribution places a vertical bar or spike at each support value xx on a horizontal axis of values, with height pX(x)p_X(x). Values outside the support get no bar. The heights are probabilities and add to 11 over the whole support, and the widths of the bars carry no meaning.

In plain words Read a PMF chart by the heights of its bars, not by their areas. A gap in the chart means zero probability at that value.

Example The chart for the correction count has bars at 00, 11 and 33 with heights 0.20.2, 0.50.5 and 0.30.3. The tallest bar is at 11, the most likely value, and there is no bar at 22 because pX(2)=0p_X(2) = 0. Drawing the bars wider or narrower changes nothing about the distribution. Later in the course, density curves are read by area. A PMF bar chart is read by height.

Check yourself

  1. A ticket is drawn from four tickets labeled 22, 55, 99 and 1212, each equally likely, and XX is its label. Find P(X=7)P(X = 7), P(X≤9)P(X \le 9) and P(4<X<10)P(4 < X < 10).
Show the answer

Each of the four labels has mass 14\tfrac{1}{4}, and 77 is not a label, so P(X=7)=0P(X = 7) = 0. The labels with X≤9X \le 9 are 22, 55 and 99, so P(X≤9)=34P(X \le 9) = \tfrac{3}{4}. The labels strictly between 44 and 1010 are 55 and 99, so P(4<X<10)=24=12P(4 < X < 10) = \tfrac{2}{4} = \tfrac{1}{2}. Treating the labels as if they filled the interval from 22 to 1212 and computing 9−212−2=0.7\tfrac{9 - 2}{12 - 2} = 0.7 for P(X≤9)P(X \le 9) would be wrong, because the distribution puts mass only on the four labels.

  1. A score XX takes the values 00, 22, 44 and 66 with masses kk, 2k2k, 2k2k and kk. Find kk. Then find P(X≤2)P(X \le 2), P(2<X≤6)P(2 < X \le 6) and the probability that XX is odd.
Show the answer

The masses add to 6k6k, so k=16k = \tfrac{1}{6} and the masses are 16\tfrac{1}{6}, 13\tfrac{1}{3}, 13\tfrac{1}{3} and 16\tfrac{1}{6}, all nonnegative. The event X≤2X \le 2 includes 00 and 22, so

P(X≤2)=16+13=12.P(X \le 2) = \tfrac{1}{6} + \tfrac{1}{3} = \tfrac{1}{2}.

The event 2<X≤62 < X \le 6 excludes 22 and includes 44 and 66, so P(2<X≤6)=13+16=12P(2 < X \le 6) = \tfrac{1}{3} + \tfrac{1}{6} = \tfrac{1}{2}. No support value is odd, so the probability of an odd score is 00. As a check, the first two events are disjoint and together cover the support, and their probabilities add to 11.

  1. For which constant cc is p(x)=c(3−x)p(x) = c(3 - x) for x=0,1,2,3,4x = 0, 1, 2, 3, 4, with p(x)=0p(x) = 0 for every other xx, a PMF?
Show the answer

For no value of cc. At x=0,1,2,3,4x = 0, 1, 2, 3, 4 the factor 3−x3 - x equals 33, 22, 11, 00 and −1-1, which add to 55. Normalization therefore requires

∑x=04c(3−x)=5c=1,\sum_{x=0}^{4} c(3 - x) = 5c = 1,

so c=15c = \tfrac{1}{5} is the only candidate. With that value p(4)=−15p(4) = -\tfrac{1}{5}, which is negative, so the formula fails nonnegativity. If the formula were used only for x=0,1,2,3x = 0, 1, 2, 3, normalization would give 6c=16c = 1 and the masses 12\tfrac{1}{2}, 13\tfrac{1}{3}, 16\tfrac{1}{6} and 00, a valid PMF whose support is {0,1,2}\{0, 1, 2\}.

How this lesson connects