Random variables · Definition

Probability mass function

probabilityrandom variables

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.

\[p_X(x)=P(X=x)\]

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

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