16  Discrete RVs

Definition 16.1 (Discrete random variable) We say \(X\) is a discrete random variable if \(X\) can take a finite or countable number of values \(x_1,x_2, \ldots,x_n\).

Definition 16.2 (Support) The finite or countably infinite set of values \(x\) such that \(P(X=x)>0\) is called the support of \(X\).

Definition 16.3 (Probability mass function) If a random variable \(X\) has a discrete distribution, the probability mass function (PMF) of \(X\) is defined as the function \(f:\mathbb{R}\to[0,1]\) such that \[f(x) \equiv P(X=x).\]

Note that the PMF \(f(x)\) is a discrete function which can only take values in the support \(\{x_1,x_2, \ldots,x_n\}\).

Notation for PMF

Throughout this course, we use PMF to refer to the probability function for a discrete random variable. Some textbooks may call it the probability function (p.f.), while others may use the term mass function. All these terms describe the same concept.

Note that how \(f(x)\) differs from the probability function \(P(\cdot)\). \(f(x)\) is a real-valued function, whereas \(P(\cdot)\) is the probability operator. The two should not be confused even when the notation \(p(x)\) is used to represent a PMF.

We may want to use a subscript to distinguish PMFs for different RVs. For example, \(f_{X}\) is the PMF for random variable \(X\), \(f_{Y}\) is the PMF for random variable \(Y\).

Proposition 16.1 A probability mass function \(f:\mathbb{R}\to[0,1]\) satisfies

  1. \(f(x)\geq 0\) for all \(x\) and \(f(x)\neq 0\) if and only if \(x\) is in the support.
  2. \(\sum_{i} f(x_i)=1\) where \(i\) indexes every value in the support.

There are different ways to represent a PMF. We can (1) list all the possible values and their associated probabilities; (2) write a formula for the PMF; or (3) visualize it in a graph.

Example 16.1 (Bernoulli distribution) A random variable \(X\) is said to have the Bernoulli distribution if \(X\) has only two possible values, \(0\) and \(1\), and \(P(X=1)=p\), \(P(X=0)=1-p\).

The PMF of a Bernoulli random variable \(X\) is given by \[f(k)=\begin{cases} p & \textrm{if }k=1,\\ 1-p & \textrm{if }k=0. \end{cases}\] This can also be expressed as \[f(k)=p^{k}(1-p)^{1-k},\quad k\in\left\{ 0,1\right\} .\]

Example 16.2 A student is trying to connect to the campus Wi-Fi network. Each attempt is independent, and:

  • With probability \(p\) the attempt is successful.
  • With probability \(1-p\) the attempt fails, and the student tries again.

The student will keep trying until the first success.

  1. Define \(A_k\) = “the first successful connection occurs on the \(k\)-th attempt.” Find \(P(A_k)\).
  2. Define a random variable \(X\) = “the number of attempts needed until the first success.” What is the support of \(X\)?
  3. Derive the probability mass function (PMF) of \(X\).
  4. Show that this is a valid PMF (Proposition 16.1).