A probability mass function (pmf) is a function over the sample space of a discrete random variable $X$ which gives the probability that $X$ is equal to a certain value.
Let $X$ be a discrete random variable on a sample space $S$. Then the probability mass function $f(x)$ is defined as
\[f(x) = \mathrm{P}[X=x].\]
Each probability mass function satisfies the following two conditions:
\begin{align} \text{ (i) }& \qquad f(x) \geq 0 \text{ for all }x \in S \text{,} \\ \text{ (ii) }& \qquad \sum\limits_{x\in S} f(x) = 1\text{.} \end{align}
i.e. for all $x$ in the sample space, $f(x)$ is never negative and the sum of $f(x)$ over the entire sample space will always be $1$.
Let $S$ be the set of integers and $f(x)$ be defined as \[f(x) = \begin{cases} k(7x+3) & \text{if } x= 1, 2 \text{ or } 3\text{,} \\[6pt] 0 & \text {otherwise.}\end{cases}\]
For what value of $k$ is $f$ a pmf?
To ensure that (i) holds we need $f(x) \geq 0$, so we see that $k$ cannot be negative. We also need to show that (ii) holds, i.e. $ \sum\limits_{x\in S} f(x) = 1.$ So \[f(1)+f(2)+f(3) = 1.\] Hence \begin{align} 1 &= k(7+3) +k(14+3)+k(21+3) \\ &= 51k\\ k &= \dfrac{1}{51}. \end{align}
Let $S$ be the set of integers and $g(x)$ be defined as \[g(x) = \begin{cases} (1 + \theta)^{-n} \binom nx \theta^x & \text{if } x =0, 1, 2, \ldots, n \text{ and} \\[6pt] 0 & \text{otherwise}\end{cases}\] where $\theta > 0$.
Show that $g(x)$ is a probability mass function.
As $\theta > 0$ we have $(1+\theta)^{-n}>0$ and $\theta^x > 0$. Also $\binom ab >0$ for all $a,b \in \mathbb{N}$ so, as $g(x)$ is the product of three positive numbers, $g(x)\geq 0$ for all $x$ so (i) holds. Thus it remains to show \[\sum\limits_{x\in S} g(x) = 1.\] In this case that means \[\sum\limits_{x=0}^n (1 + \theta)^{-n} \binom nx \theta^x = 1.\] First observe \[\sum\limits_{x=0}^n (1 + \theta)^{-n} \binom nx \theta^x = \frac{1}{(1 + \theta)^{n} } \sum\limits_{x=0}^n \binom nx \theta^x .\] Now note that the binomial expansion of \begin{align} (1+\theta)^n &= 1+n\theta + \frac{n(n-1)\theta ^2}{2!} + \frac{n(n-1)(n-2)\theta ^3}{3!} + \cdots + n\theta^{n-1} + \theta^n \\ &= 1+ \binom n1 \theta + \binom n2 \theta^2 + \binom n3 \theta^3 + \cdots + \binom n{n-1} \theta^{n-1} + \binom nn \theta^n\\ &= \sum\limits_{x=0}^n \binom nx \theta^x .\end{align}
Substituting this back in yields \[\sum\limits_{x=0}^n (1 + \theta)^{-n} \binom nx \theta^x = \frac{1}{(1 + \theta)^{n} } \sum\limits_{x=0}^n \binom nx \theta^x = \frac{1}{(1 + \theta)^{n} }\times (1+\theta)^n= 1\] as required. So $g(x)$ is a pmf.
In this video, Daniel Organisciak verifies that the probability mass function of a the binomial distribution is indeed a probability mass function.
Test yourself: Numbas test on probability mass functions