I want some clarification on how to solve a question that was asked in my stats class midterm

76 Views Asked by At

Question: Suppose X is a random variable with distribution X ~ $Bin(n, p)$ with $n≥2$ and $Y = max(2, X)$. Find E(Y).

My approach was to say that since $Bin(n, p)$ would be a fraction, then the max value would always be 2, so the expected value would just be $2^n$, however, I am not sure whether this is correct. Does anyone have any advice?

3

There are 3 best solutions below

0
On

This is a perfect problem for using conditional expectation rules. Note $$ E[Y | X] = E[Y | X > 2] P(X > 2) + E[Y | X \le 2] P(X\le 2) = 2 P(X \le 2) + E[X | X > 2] P(X > 2) $$ Then to calculate the second term note that $$ E[X | X > 2]P(X > 2) = \sum_{x=3}^n x \binom{n}{x} p^x (1-p)^{n-x} = np - np(1-p)^{n-2}(1-p + (n-1) p). $$ Can you finish from here? (Note, I don't think there would be a nice closed form here, but I could be wrong).

0
On

Another approach is to find the distribution of $Y.$ Note that $P(Y = k) = P(X = k)$ for $k > 2;$ while $P(Y = 2) = P(X = 0) + P(X = 1) + P(X = 2) = (1-p)^n + np(1-p)^{n-1} + \dfrac{n(n-1)}{2} p^2(1-p)^{n-2}.$ Then, you consider the sum $E(Y) = \sum\limits_{y = 2}^n y P(Y = y).$ To calculate this explicitly, I would recommend using that $\sum\limits_{x = 0}^n x P(X = x) = np.$

0
On

Direct computation is quite simple: $$\begin{align} \operatorname{E}[Y] &= \operatorname{E}[\max(2,X)] \\ &= \sum_{x=0}^n \max(2,x) \Pr[X = x] \\ &= \sum_{x=0}^1 2 \Pr[X = x] + \sum_{x=2}^n x \Pr[X = x] \\ &= \sum_{x=0}^1 (2-x) \Pr[X = x] + \sum_{x=0}^n x \Pr[X = x] \\ &= 2 \Pr[X = 0] + 1 \Pr[X = 1] + np \\ &= 2 p^n + n p^{n-1} (1-p) + np. \end{align}$$