# Binomial distribution index

I stumbled against this problem and found it really hard and help would be much appreciated

Let $$X_{1},X_{2},......,X_{n}$$ be a series of independent Bernoulli variables with $$P(X_{i}=1)=\theta$$ and $$P(X_{i}=0)=1-\theta$$

Let $$Y_{n}= X_{1}+X_{2}+......+X_{n}$$

I know that $$Y_{n}$$ is a Binomial distribution with $$n \theta$$ as expected value and $$n \theta (1-\theta)$$ as variance but I can't figure out the probability distribution of $$n-Y_{n}$$ and how to compute its expected value and variance

A second question supposed that $$n \sim \mathcal{Poisson} (\lambda)$$ compute the expected value and variance of $$Y_{n}$$

The puzzling thing for me how $$n$$ as an index can change the distribution

• You could assume for a while, that $\theta$ is equal to 1/2, and experiment with a coin. That values lets say $Y_3$ or $Y_4$ may take? What values happen more often? Also, some more clarity in the question would be appreciated. – cure Oct 18 at 11:01
• Made some mistakes and I fixed them sorry if the problem is not clear English is not my first language I don't know how to find the probability distribution of $n-Y_{n}$ The second part is if $n$ is a Poisson distribution what is the expected value and variance of $Y_{n}$ – chaabouni ali Oct 18 at 11:14
• You ask 'second question', however I have some troubles with finding and understanding the first one. Also, please have in mind, that self-study questions are different than others: stats.stackexchange.com/tags/self-study/info – cure Oct 18 at 12:13
• Sorry I will try to explain as much as I could We have $n$ independent Bernoulli variables Their sum is $Y_{n}$ which is a Binomial distribution What is the probability distribution of $n-Y_{n}$ – chaabouni ali Oct 18 at 13:45
• For the first question try to assume some value of $n$ and $\theta$. For example 3 and 1/2. You can try to calculate probability, that in 3 coin tosses there will be 0, 1, 2, 3 heads. Then, for every situation, what are probabilities of 3 - the number of heads? How will it change when $n$ is different? Can you generalise it? – cure Oct 18 at 14:05

For you second question, since you already know that the mean of $$Y_{n}$$ is $$n\theta$$, and $$n\sim\mathcal{Poisson}(\lambda)$$, the mean of $$Y_{n}$$ is

$$E[Y_{n}] = E[n\theta]=\theta E[n]=\lambda\theta$$. Or equivalently, $$E[Y_{n}]=\sum_{n} n\theta*\frac{\lambda^{n} e^{-\lambda}}{n!}=\lambda\theta$$.

Similarly, the various of $$Y_{n}$$ is $$\sum_{n} n\theta (1-\theta)*\frac{\lambda^{n} e^{-\lambda}}{n!}=\lambda\theta (1-\theta)$$.

For the first question, since $$Y_{n}$$ is of binomial distribution, the probability that $$Y_{n}=y$$ is

$$P(Y_{n}=y)={n \choose y}\theta ^y\times(1-\theta)^{n-y}$$.

The probability that $$n-Y_{n}=k$$ then is

$$P(n-Y_{n}=k)=P(Y_{n}=n-k)={n \choose n-k}\theta ^{n-k}\times(1-\theta)^{k}={n \choose k}(1-\theta) ^{k}\times\theta^{n-k}$$.

Thus, $$n-Y_{n}$$ is of binomial distribution with parameters of $$(n;1-\theta)$$. In other words, while $$Y_{n}$$ is the number of $$Xi=1$$, $$n-Y_{n}$$ is the number of $$Xi=0$$, among $$n$$ tests.