Post · 7 min read· pp. 199–204

3.2.5 Solved Problems: More about Discrete Random Variables


Problem

Let XX be a discrete random variable with the following PMF \begin{equation} \nonumber P_X(x) = \left{ \begin{array}{l l} 0.3 & \quad \text{for } x=3\ 0.2 & \quad \text{for } x=5\ 0.3 & \quad \text{for } x=8\ 0.2 & \quad \text{for } x=10\ 0 & \quad \text{otherwise} \end{array} \right. \end{equation} Find and plot the CDF of XX.

  • Solution
    • The CDF is defined by FX(x)=P(X≤x)F_X(x)=P(X \leq x). We have \begin{equation} \nonumber F_X(x) = \left{ \begin{array}{l l} 0 & \quad \text{for } x<3\ P_X(3)= 0.3 & \quad \text{for } 3 \leq x<5\ P_X(3)+P_X(5)=0.5 & \quad \text{for } 5 \leq x<8 \ P_X(3)+P_X(5)+P_X(8)=0.8 & \quad \text{for } 8 \leq x<10 \ 1 & \quad \text{for } x \geq 10\ \end{array} \right. \end{equation}

Problem

Let XX be a discrete random variable with the following PMF \begin{equation} \nonumber P_X(k) = \left{ \begin{array}{l l} 0.1 & \quad \text{for } k=0\ 0.4 & \quad \text{for } k=1\ 0.3 & \quad \text{for } k=2\ 0.2 & \quad \text{for } k=3\ 0 & \quad \text{otherwise} \end{array} \right. \end{equation}

  1. Find EXEX.
  2. Find Var(X)(X).
  3. If Y=(X−2)2Y=(X-2)^2, find EYEY.
  • Solution
      1. EXEX=∑xk∈RXxkPX(xk)= \sum_{x_k \in R_X} x_kP_X(x_k)
        =0(0.1)+1(0.4)+2(0.3)+3(0.2)= 0 (0.1)+ 1(0.4)+2(0.3)+3(0.2)
        =1.6=1.6
      2. We can use Var(X)=EX2−(EX)2=EX2−(1.6)2(X)=EX^2-(EX)^2=EX^2-(1.6)^2. Thus we need to find EX2EX^2. Using LOTUS, we have
        EX2=02(0.1)+12(0.4)+22(0.3)+32(0.2)=3.4EX^2 = 0^2 (0.1)+ 1^2(0.4)+2^2(0.3)+3^2(0.2)=3.4
        Thus, we have
        Var(X)=(3.4)−(1.6)2=0.84\textrm{Var}(X)= (3.4)-(1.6)^2=0.84
      3. Again, using LOTUS, we have
        E(X−2)2=(0−2)2(0.1)+(1−2)2(0.4)+(2−2)2(0.3)+(3−2)2(0.2)=1.E(X-2)^2 = (0-2)^2 (0.1)+ (1-2)^2(0.4)+(2-2)^2(0.3)+(3-2)^2(0.2)=1.

Problem

Let XX be a discrete random variable with PMF \begin{equation} \nonumber P_X(k) = \left{ \begin{array}{l l} 0.2 & \quad \text{for } k=0\ 0.2 & \quad \text{for } k=1\ 0.3 & \quad \text{for } k=2\ 0.3 & \quad \text{for } k=3\ 0 & \quad \text{otherwise} \end{array} \right. \end{equation} Define Y=X(X−1)(X−2)Y=X(X-1)(X-2). Find the PMF of YY.

  • Solution
    • First, note that RY={x(x−1)(x−2)∣x∈{0,1,2,3}}={0,6}R_Y=\{x(x-1)(x-2) | x \in \{0,1,2,3\}\}=\{0,6\}. Thus,

      PY(0)P_Y(0)=P(Y=0)=P((X=0) or (X=1) or (X=2))=P(Y=0)=P\big( (X=0) \textrm{ or } (X=1) \textrm{ or } (X=2)\big)
      =PX(0)+PX(1)+PX(2)=P_X(0)+P_X(1)+P_X(2)
      =0.7=0.7;
      PY(6)P_Y(6)=P(X=3)=0.3= P(X=3)=0.3

      Thus, \begin{equation} \nonumber P_Y(k) = \left{ \begin{array}{l l} 0.7 & \quad \text{for } k=0\ 0.3 & \quad \text{for } k=6\ 0 & \quad \text{otherwise} \end{array} \right. \end{equation}


Problem

Let X∼Geometric(p)X \sim Geometric(p). Find E[12X]E\left[\frac{1}{2^X}\right].

  • Solution
    • The PMF of XX is given by \begin{equation} \nonumber P_X(k) = \left{ \begin{array}{l l} pq^{k-1}& \quad \text{for } k=1,2,3,...\ 0 & \quad \text{otherwise} \end{array} \right. \end{equation} where q=1−pq=1-p. Thus,

      E[12X]E\left[\frac{1}{2^X}\right]=∑k=1∞12kPX(k)=\sum_{k=1}^{\infty} \frac{1}{2^k} P_X(k)
      =∑k=1∞12kqk−1p=\sum_{k=1}^{\infty} \frac{1}{2^k} q^{k-1}p
      =p2∑k=1∞(q2)k−1=\frac{p}{2}\sum_{k=1}^{\infty} \left(\frac{q}{2}\right)^{k-1}
      =p211−q2=\frac{p}{2} \frac{1}{1-\frac{q}{2}}
      =p1+p=\frac{p}{1+p}.

Problem

If X∼Hypergeometric(b,r,k)X \sim Hypergeometric(b,r,k), find EXEX.

  • Solution
    • The PMF of XX is given by \begin{equation} \nonumber P_X(x) = \left{ \begin{array}{l l} \frac{{b \choose x} {r \choose k-x}}{{b+r \choose k}}& \quad \text{for } x \in R_X\ 0 & \quad \text{otherwise} \end{array} \right. \end{equation} where RX={max⁡(0,k−r),max⁡(0,k−r)+1,max⁡(0,k−r)+2,...,min⁡(k,b)}R_X=\{\max(0,k-r), \max(0,k-r)+1, \max(0,k-r)+2,..., \min(k,b)\}. Finding EXEX directly seems to be very complicated. So let's try to see if we can find an easier way to find EXEX. In particular, a powerful tool that we have is linearity of expectation. Can we write XX as the sum of simpler random variables XiX_i? To do so, let's remember the random experiment behind the hypergeometric distribution. You have a bag that contains bb blue marbles and rr red marbles. You choose k≤b+rk \leq b+r marbles at random (without replacement) and let XX be the number of blue marbles in your sample. In particular, let's define the indicator random variables XiX_i as follows: \begin{equation} \nonumber X_i = \left{ \begin{array}{l l} 1 & \quad \text{if the iith chosen marble is blue} \ 0 & \quad \text{otherwise} \end{array} \right. \end{equation} Then, we can write

      X=X1+X2+⋯+Xk.X=X_1+X_2+\cdots+X_k.
      Thus,
      EX=EX1+EX2+⋯+EXk.EX=EX_1+EX_2+\cdots+EX_k.
      To find P(Xi=1)P(X_i=1), we note that for any particular XiX_i all marbles are equally likely to be chosen. This is because of symmetry: no marble is more likely to be chosen than the iith marble as any other marbles. Therefore,
      P(Xi=1)=bb+r for all i∈{1,2,⋯ ,k}.P(X_i=1)=\frac{b}{b+r} \textrm{ for all }i \in \{1,2,\cdots,k\}.
      We conclude

      EXiEX_i=0⋅p(Xi=0)+1⋅P(Xi=1)=0 \cdot p(X_i=0)+ 1 \cdot P(X_i=1)
      =bb+r=\frac{b}{b+r}.

      Thus, we have

      EX=kbb+r.EX=\frac{kb}{b+r}.


Problem

In Example 3.14 we showed that if X∼Binomial(n,p)X \sim Binomial(n,p), then EX=npEX=np. We found this by writing XX as the sum of nn Bernoulli(p)Bernoulli(p) random variables. Now, find EXEX directly using EX=∑xk∈RXxkPX(xk)EX=\sum_{x_k \in R_X} x_k P_X(x_k). Hint: Use k(nk)=n(n−1k−1)k {n \choose k}=n {n-1 \choose k-1}.

  • Solution
    • First note that we can prove k(nk)=n(n−1k−1)k {n \choose k}=n {n-1 \choose k-1} by the following combinatorial interpretation: Suppose that from a group of nn students we would like to choose a committee of kk students, one of whom is chosen to be the committee chair. We can do this

      1. by choosing kk people first (in (nk){n \choose k} ways), and then choosing one of them to be the chair (kk ways), or
      2. by choosing the chair first (nn possibilities and then choosing k−1k-1 students from the remaining n−1n-1 students (in (n−1k−1){n-1 \choose k-1} ways)).Thus, we conclude
        k(nk)=n(n−1k−1).k {n \choose k}=n {n-1 \choose k-1}.
        Now, let's find EXEX for X∼Binomial(n,p)X \sim Binomial(n,p).
      EXEX=∑k=0nk(nk)pkqn−k=\sum_{k=0}^{n} k {n \choose k} p^k q^{n-k}
      =∑k=1nk(nk)pkqn−k=\sum_{k=1}^{n} k {n \choose k} p^k q^{n-k}
      =∑k=1nn(n−1k−1)pkqn−k=\sum_{k=1}^{n} n {n-1 \choose k-1} p^k q^{n-k}
      =np∑k=1n(n−1k−1)pk−1qn−k=np\sum_{k=1}^{n} {n-1 \choose k-1} p^{k-1} q^{n-k}
      =np∑l=0n−1(n−1l)plq(n−1)−l=np\sum_{l=0}^{n-1} {n-1 \choose l} p^l q^{(n-1)-l}
      =np=np.

      Note that the last line is true because the ∑l=0n−1(n−1l)plq(n−1)−l\sum_{l=0}^{n-1} {n-1 \choose l} p^l q^{(n-1)-l} is equal to ∑l=0n−1PY(l)\sum_{l=0}^{n-1} P_Y(l) for a random variable YY that has Binomial(n−1,p)Binomial(n-1,p) distribution, hence it is equal to $1$.


Problem Let XX be a discrete random variable with RX⊂{0,1,2,...}R_X \subset \{0,1,2,...\}. Prove

EX=∑k=0∞P(X>k).EX=\sum_{k=0}^{\infty} P(X>k).

  • Solution
    • Note that

      P(X>0)P(X > 0)=PX(1)+PX(2)+PX(3)+PX(4)+⋯=P_X(1)+P_X(2)+P_X(3)+P_X(4)+\cdots,
      P(X>1)P(X > 1)=PX(2)+PX(3)+PX(4)+⋯=P_X(2)+P_X(3)+P_X(4)+\cdots,
      P(X>2)P(X > 2)=PX(3)+PX(4)+PX(5)+⋯=P_X(3)+P_X(4)+P_X(5)+\cdots.

      Thus

      ∑k=0∞P(X>k)\sum_{k=0}^{\infty} P(X>k)=P(X>0)+P(X>1)+P(X>2)+...= P(X>0)+P(X>1)+P(X>2)+...
      =PX(1)+2PX(2)+3PX(3)+4PX(4)+...=P_X(1)+2P_X(2)+3P_X(3)+4P_X(4)+...
      =EX=EX.

Problem

If X∼Poisson(λ)X \sim Poisson(\lambda), find Var(X)(X).

  • Solution
    • We already know EX=λEX=\lambda, thus Var(X)=EX2−λ2(X)=EX^2-\lambda^2. You can find EX2EX^2 directly using LOTUS; however, it is a little easier to find E[X(X−1)]E[X(X-1)] first. In particular, using LOTUS we have

      E[X(X−1)]E[X(X-1)]=∑k=0∞k(k−1)PX(k)=\sum_{k=0}^{\infty} k(k-1)P_X(k)
      =∑k=0∞k(k−1)e−λλkk!=\sum_{k=0}^{\infty} k(k-1) e^{-\lambda} \frac{\lambda^k}{k!}
      =e−λ∑k=2∞λk(k−2)!=e^{-\lambda} \sum_{k=2}^{\infty} \frac{\lambda^k}{(k-2)!}
      =e−λλ2∑k=2∞λk−2(k−2)!=e^{-\lambda} \lambda^2 \sum_{k=2}^{\infty} \frac{\lambda^{k-2}}{(k-2)!}
      =e−λλ2eλ=e^{-\lambda} \lambda^2 e^{\lambda}
      =λ2=\lambda^2.

      So, we have λ2=E[X(X−1)]=EX2−EX=EX2−λ\lambda^2=E[X(X-1)]=EX^2-EX=EX^2-\lambda. Thus, EX2=λ2+λEX^2=\lambda^2+\lambda and we conclude

      Var(X)\textrm{Var}(X)=EX2−(EX)2=EX^2-(EX)^2
      =λ2+λ−λ2=\lambda^2+\lambda-\lambda^2
      =λ=\lambda.

Problem

Let XX and YY be two independent random variables. Suppose that we know Var(2X−Y)=6(2X-Y)=6 and Var(X+2Y)=9(X+2Y)=9. Find Var(X)(X) and Var(Y)(Y).

  • Solution
    • Let's first make sure we understand what Var(2X−Y)(2X-Y) and Var(X+2Y)(X+2Y) mean. They are Var(Z)(Z) and Var(W)(W), where the random variables ZZ and WW are defined as Z=2X−YZ=2X-Y and W=X+2YW=X+2Y. Since XX and YY are independent random variables, then 2X2X and −Y-Y are independent random variables. Also, XX and 2Y2Y are independent random variables. Thus, by using Equation 3.7, we can write
      Var(2X−Y)=Var(2X)+Var(-Y)=4Var(X)+Var(Y)=6,\textrm{Var} (2X-Y)=\textrm{Var}(2X)+\textrm{Var(-Y)}=4\textrm{Var}(X)+\textrm{Var(Y)}=6,
      Var(X+2Y)=Var(X)+Var(2Y)=Var(X)+4Var(Y)=9.\textrm{Var} (X+2Y)=\textrm{Var}(X)+\textrm{Var(2Y)}=\textrm{Var}(X)+4\textrm{Var(Y)}=9.
      By solving for Var(X)(X) and Var(Y)(Y), we obtain Var(X)=1(X)=1 and Var(Y)=2(Y)=2.