Random variables · Definition
Probability mass function
Before you start you need to know
It is the standard way to describe completely how probability is spread over the values of a discrete variable.
Definition
The probability mass function \(p_X\) of a discrete random variable \(X\) gives, for each value \(x\) it can take, the probability \(P\) that it takes it.
Think of probability as one unit of mass spread over the possible values of \(X\). The mass \(p_X(x)\) is the share that goes to the value \(x\). That is why every mass function satisfies two conditions: \(p_X(x)\ge 0\) for all \(x\) and \(\sum_x p_X(x)=1\). Any list of numbers meeting both is the mass function of some variable.
With it, the probability of any event is computed by adding masses: \(P(X\in A)=\sum_{x\in A}p_X(x)\). If \(p(0)=0.1\), \(p(1)=0.3\), \(p(2)=0.4\) and \(p(3)=0.2\), then \(P(1\le X\le 2)=0.3+0.4=0.7\). Outside the possible values the mass is zero, so for instance \(p(1.5)=0\).
In an experiment with equally likely outcomes it is obtained by counting: for the sum \(X\) of two dice, \(p_X(7)=\tfrac6{36}\) because there are six pairs with sum 7. When the mass is given with an unknown constant, such as \(p(x)=kx\) for \(x=1,\dots,4\), the condition that everything adds up to 1 lets you solve for it: \(10k=1\).
A mass function never exceeds 1, unlike the density of a continuous variable, which can. A common mistake is to forget a possible value when adding, or to add masses of values the event does not include.
Think about it
If \(X\) takes only the values 1, 2 and 3 and \(p(1)=0.5\), \(p(2)=0.3\), what is \(p(3)\)?
It is 0.2, because the masses must add up to 1.
Why can a mass function not take the value 1.4 at any point?
Because each mass is a probability, and a probability never exceeds 1.
Exercises 10
- A variable \(X\) takes the values 0, 1 and 2 with \(p(0)=0.2\), \(p(1)=c\) and \(p(2)=0.5\). What is \(c\)?
- With two dice, \(X\) is the sum. What is \(p_X(7)\)?
- Which of these tables can be the probability mass function of a variable with values 1, 2 and 3 (probabilities of \(x=1,2,3\))?
- Let \(p(x)=kx\) for \(x=1,2,3,4\) and 0 otherwise. What value must \(k\) have?
- With \(p(x)=\tfrac{x}{10}\) for \(x=1,2,3,4\), compute \(P(X\ge3)\).
- Three fair coins are tossed and \(X\) is the number of heads. Compute \(p_X(2)\).
- Which statement about a probability mass function is correct?
- \(X\) takes the values 0, 1, 2, 3 with masses 0.1, 0.3, 0.4, 0.2. Compute \(P(1\le X\le 2)\).
- Let \(p(x)=\left(\tfrac12\right)^x\) for \(x=1,2,3,\dots\). Compute the probability that \(X\) is even.
- Let \(p(x)=c\cdot2^x\) for \(x=0,1,2,3\). Compute \(p(3)\).
References
- Joseph K. Blitzstein, Jessica Hwang, Introduction to Probability, 2nd edition, CRC Press, 2019. §3.2
- Sheldon Ross, A First Course in Probability, 10th edition, Pearson, 2019. §4.2
- Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying Ye, Probabilidad y estadística para ingeniería y ciencias, 9.ª edición, Pearson, 2012. §3.2