2.2 Discrete Random Variables
Definition 2.2.1. A random variable \(X\) is said to be discrete if its range \(R_X\) is either finite or countably infinite. This means the possible values can be listed in a sequence \(x_1, x_2, x_3, \dots \).
Definition 2.2.2 (Probability Mass Function (PMF)). The probability distribution of a discrete random variable is described by a probability mass function, denoted as \(f_X(x)\) or \(P(X=x)\). This function assigns a probability to each possible value in the range of \(X\) such that:
- 1.
- \(f_X(x) \geq 0\) for all \(x\).
- 2.
- \(\sum _{x \in R_X} f(x) = 1\).
Example 2.2.3. Let the random variable \(X\) represent the number of heads obtained in three independent tosses of a fair coin.
- 1.
- Tabular Representation. The distribution can be summarized in a probability table, which provides a clear view of the entire probability mass:
- 2.
- Functional Representation (The Formula). For a balanced coin, the probability of heads \(p = 1/2\). The probability of observing exactly \(x\) heads in 3 trials follows the Binomial logic: \[\begin {aligned} P(X=x) &= \binom {3}{x} \left ( \frac {1}{2} \right )^x \left ( \frac {1}{2} \right )^{3-x} \\ &= \binom {3}{x} \left (\frac {1}{2} \right )^3 \\ & = \frac {\binom {3}{x}}{8}, \quad x = 0, 1, 2, 3 \end {aligned}\]
There are special discrete probability functions which do arise in many experiments and will discuss them later. There are Bernoulli, Binomial, Poisson, Geometric, Hypergeometric, discrete uniform e.te.c
2.2.1 Practice problems
Problem 2.2.1. [Tutorial Sheet 2] The probability distribution of a random variable \(X\) is given by
| \(x\) | 0 | 1 | 2 | 3 |
| \(P(X=x)\) | \(c\) | \(c^2\) | \(c^2+c\) | \(3c^2+2c\) |
Find
- (a).
- the value of the constant \(c\);
- (b).
- \(E(X)\) and \(\operatorname {Var}(X)\);
- (c).
- the cumulative distribution function of \(X\);
- (d).
- \(P(X\geq 2)\);
- (e).
- \(P(0 < X \leq 2)\).
Show solution
Solution. (a). The probabilities must sum to 1: \[c + c^2 + (c^2+c) + (3c^2+2c) = 5c^2+4c = 1,\] so \(5c^2+4c-1 = 0\), that is \((5c-1)(c+1) = 0\), giving \(c = \tfrac 15\) or \(c = -1\). A probability cannot be negative, so \[c = \frac {1}{5}.\] This gives the distribution \[P(0) = \frac {5}{25},\quad P(1) = \frac {1}{25},\quad P(2) = \frac {6}{25},\quad P(3) = \frac {13}{25},\] which sums to \(\tfrac {25}{25}=1\), as it must.
(b). \begin {align*} E(X) &= 0\cdot \tfrac {5}{25}+1\cdot \tfrac {1}{25}+2\cdot \tfrac {6}{25}+3\cdot \tfrac {13}{25} = \frac {0+1+12+39}{25} = \frac {52}{25} = 2.08,\\ E(X^2) &= 0\cdot \tfrac {5}{25}+1\cdot \tfrac {1}{25}+4\cdot \tfrac {6}{25}+9\cdot \tfrac {13}{25} = \frac {1+24+117}{25} = \frac {142}{25},\\ \operatorname {Var}(X) &= E(X^2)-[E(X)]^2 = \frac {142}{25}-\left (\frac {52}{25}\right )^{2} = \frac {3550-2704}{625} = \frac {846}{625} = 1.3536. \end {align*}
(c). The c.d.f. accumulates the probabilities: \[F(x) = \begin {cases} 0 & x<0\\ \frac {5}{25} = \frac {1}{5} & 0\leq x<1\\ \frac {6}{25} & 1\leq x<2\\ \frac {12}{25} & 2\leq x<3\\ 1 & x\geq 3. \end {cases}\] Sketched, this is a step function rising by \(P(X=x)\) at each of \(x=0,1,2,3\), constant between the steps, and continuous from the right.
(d). \[P(X\geq 2) = P(2)+P(3) = \frac {6}{25}+\frac {13}{25} = \frac {19}{25}.\]
(e). The inequality is strict on the left, so \(x=0\) is excluded and \(x=2\) is included: \[P(0<X\leq 2) = P(1)+P(2) = \frac {1}{25}+\frac {6}{25} = \frac {7}{25}.\] For a discrete variable the difference between \(<\) and \(\leq \) matters, unlike the continuous case where single points carry no probability.
2.2.2 Practice problems
Problem 2.2.2. [Assignment] A car agency has \(0,1,2,3,4\) or \(5\) cars returned each day, with probabilities \(\frac {1}{6}\), \(\frac {1}{6}\), \(\frac {1}{3}\), \(\frac {1}{12}\), \(\frac {1}{6}\) and \(\frac {1}{12}\) respectively. Let \(X\) be the number of cars returned each day. Find
- (a).
- the mean and variance of \(X\);
- (b).
- \(P(1<X\leq 3)\);
- (c).
- \(P(X\leq 4)\).
Show solution
Solution. First check the distribution is legitimate. Writing everything over 12, \[\frac {2}{12}+\frac {2}{12}+\frac {4}{12}+\frac {1}{12}+\frac {2}{12}+\frac {1}{12} = \frac {12}{12} = 1. \quad \checkmark \]
(a). \begin {align*} E(X) &= \frac {0(2)+1(2)+2(4)+3(1)+4(2)+5(1)}{12} = \frac {26}{12} = \frac {13}{6} \approx 2.17,\\ E(X^{2}) &= \frac {0(2)+1(2)+4(4)+9(1)+16(2)+25(1)}{12} = \frac {84}{12} = 7,\\ \operatorname {Var}(X) &= 7-\left (\frac {13}{6}\right )^{2} = \frac {252-169}{36} = \frac {83}{36} \approx 2.31. \end {align*}
(b). The left inequality is strict, so \(X=1\) is excluded and \(X=2,3\) are counted: \[P(1<X\leq 3) = P(2)+P(3) = \frac {4}{12}+\frac {1}{12} = \frac {5}{12}.\]
(c). Easier by complement: \[P(X\leq 4) = 1-P(X=5) = 1-\frac {1}{12} = \frac {11}{12}.\]
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.