# Probability Mass Function

Probability Mass function is the function that maps the values of a discrete random variable to their probabilities.

Suppose x_{1}, x_{2}, ......._{} are possible values of a discrete random variable X. Then p(x_{i}) is called the probability mass function of the random variable X if,

- p(x) ≥ 0 for all i = 1,2,3.....
- $\sum_{i}p(x_{i})$ = 1.

In the simple example of the random variable X assuming the number of heads in a single toss of a coin,

X = {0, 1}

p(x) is the function that gives the probabilities of X = 0 and X = 1 in a single toss.

p(0) = p(1) = $\frac{1}{2}$ and p(0) + p(1) = $\frac{1}{2}$ + $\frac{1}{2}$ = 1