Distribution of $ Y = X_1 + X_2-n_2 $

108 Views Asked by At

I have independent random variables $X_1$ and $X_2$ such that
$ X_1\sim Bin(n_1, 1/2) $ and $X_2\sim Bin(n_2,1/2)$ be independent random variables . Find the distribution of $Y = X_1-X_2+n_2$

Attempt : $$ P[Y = X_1-X_2+n_2 ] = \binom{n_2}{x_1-x_2+n_2}*(1/2)^{x_1-x_2+n_2} *(1/2)^{x_1-x_2} \\ = \binom{n_2}{x_1-x_2+n_2} (1/2)^{n_2} $$

Is this right ? It seems wrong since answer is independent of $n_1$ and I hadn't used the fact that both are independent random variables .

2

There are 2 best solutions below

3
On BEST ANSWER

Your calculations are indeed wrong in any case. Here is a much simpler method. $\newcommand{bin}{\operatorname{binom}}$

By comparing pmfs – the expanded pmf of $X_2$ is $P(X_2=k)=\binom{n_2}k\left(\frac12\right)^{n_2}$, while we have the identity $\binom nk=\binom n{n-k}$ – we see that $$n_2-X_2\sim X_2\sim\bin\left(n_2,\frac12\right)$$ Therefore $$Y\sim X_1+X_2\sim \bin\left(n_1+n_2,\frac12\right)$$

1
On

The key point is that if $$X_2 \sim \operatorname{Binomial}(n_2, p),$$ then $$n_2 - X_2 \sim \operatorname{Binomial}(n_2, 1-p).$$ The proof is simple. Since we have $$\Pr[X_2 = x] = \binom{n_2}{x} p^x (1-p)^{n_2 - x},$$ we then have $$\begin{align*} \Pr[n_2 - X_2 = x] &= \Pr[X_2 = n_2 - x] \\ &= \binom{n_2}{n_2-x} p^{n_2 - x} (1-p)^{n_2 - (n_2 - x)} \\ &= \frac{(n_2)!}{(n_2 - x)! \, (n_2 - (n_2 - x))!} (1-p)^x p^{n_2 - x} \\ &= \binom{n_2}{x} (1-p)^x p^{n_2 - x}, \end{align*}$$ which is the PDF of a binomial distribution with parameters $n_2$ and $1-p$. Of course, we can use an elementary counting argument to conclude the same, or we could also use the fact that a binomial distribution is the sum of IID Bernoulli variables.

In fact, this latter property is what we can now easily use to complete the answer: Since $p = 1/2$ for $X_2$, then $n_2 - X_2$ is also binomial with parameter $1 - p = 1/2$, thus $X_1$ is the sum of $n_1$ IID Bernoulli variables and $n_2 - X_2$ is the sum of $n_2$ IID Bernoulli variables, and they all share the same parameter $p = 1 - p = 1/2$. Thus $Y = X_1 + n_2 - X_2$ is the sum of $n_1 + n_2$ IID Bernoulli random variables with $p = 1/2$, thus $$Y \sim \operatorname{Binomial}(n_1 + n_2, 1/2).$$