4

Let $X_1, ..., X_n$ be i.i.d. random variables with $X_k \sim Bern(\theta)$ for $\theta \in (0,1)$. Furthermore, define $Y := \sum_{k=1}^n X_k.$

Determine $E(X_k|Y).$

Since $X_k$ and $Y$ are obviously discrete and $X_k \in \{0,1\},$ we have that $E(X_k|Y) = P(X_k = 1 | Y = j)$ with $j \in \{1,...,n\}$, which can be rewritten as

$$\frac{P(X_k = 1, Y = j)}{P(Y = j)}$$

$Y$ is binomially distrbuted, therefore

$$P(Y = j) = {n \choose j}\theta^j(1-\theta)^{n-j}.$$

Applying the multiplication formula on $P(X_k = 1, Y = j)$ yields

$$P(X_k = 1) \cdot P(Y = j | X_k = 1)$$

with $P(X_k = 1) = \theta$.

In order to calculate $P(Y = j | X_k = 1)$, I used the following reasoning:

Assume that we want to calculate

$$P(Y = 1| X_k = 1).$$

Given the assumption that $X_k = 1$, it must be true that $Y \ge 1$. We want to exclude the case that $Y > 1$, which is true if there is some other $X_i$ such that $X_i = 1$ for $i \neq k$. So we want to have that $X_i = 0$ for every $i \in \{1,...,n\} \setminus \{k\}.$ The probability for this event is $(1-\theta)^{n-1}.$ So overall, we receive that

$$P(Y = 1|X_k = 1) = (1-\theta)^{n-1}.$$

Now, if we want to calculate $P(Y = 2| X_k = 1)$, we need to look at the event that there is some other $X_l = 1$ for $l \neq k$, which is true with probability $\theta$. Similarly to above, we need to exclude the case that $Y > 2$ and receive that

$$P(Y = 2|X_k = 1) = \theta \cdot (1-\theta)^{n-2}.$$

By the same reasoning, we receive that

$$P(Y = 3|X_k = 1) = \theta^2 \cdot (1-\theta)^{n-3},$$

or in general:

$$P(Y = j| X_k = 1) = \theta^{j-1} \cdot (1-\theta)^{n-j}.$$

Therefore,

$$P(X_k = 1, Y = j) = \theta \cdot \theta^{j-1} \cdot (1-\theta)^{n-j} = \theta^{j} \cdot (1-\theta)^{n-j}.$$

So,

$$E(X_k|Y) = \frac{1}{n \choose j}.$$

Is that correct?

Edit:

Now I finally understood what's wrong with this approach:

$$P(Y = j| X_k = 1) = \theta^{j-1} \cdot (1-\theta)^{n-j}.$$

simply doesn't contain the possibility that there are several different arrangements of the values of the $X_2, ..., X_n$ such that $Y = j$. The probability from above reads like there would be only one valid arrangement, when, in fact, it's ${n-1 \choose j-1}$ valid arrangements. Therefore, it should be

$$P(Y = j| X_1 = 1) = {n-1 \choose j-1} \theta^{j-1} \cdot (1-\theta)^{n-j}.$$

The other results stay the same though, so it's actually

$$\frac{{n-1 \choose j-1}}{n \choose j} = j/n,$$

which is the same result given in the answer below, though I agree that it would be more appropriate to write this as

$$\frac{1}{n}Y(\omega)$$

for some $\omega \in \Omega$.

Julian
  • 1,401
  • $k$ is used as index, so you better don't go for $P(Y=2\mid X_k=1)$ but for $P(Y=2\mid X_1=1)$. This in the understanding that $P(Y=2\mid X_1=1)=P(Y=2\mid X_k=1)$ for every $k\in{1,\dots,n}$. 2) Under condition $X_1=1$ the distribution of $Y-1$ is binomial with parameters $n-1$ and $\theta$.
  • – drhab May 25 '19 at 12:29
  • 1
    Btw, $\mathbb E[X_k\mid Y]$ is always a random variable of the form $f(Y)$ where $f$ is a measurable function. Your outcome is a real number (not a random variable) which only can occur if $X_k$ and $Y$ are independent. That is definitely not the case here. – drhab May 25 '19 at 12:29
  • 1
    The answer is independent of the common distribution, as answered many a time on this site before: https://math.stackexchange.com/questions/92182/if-x-i-are-iid-finding-ex-1-x-2-cdots-x-k-mid-x-1-x-2-cdots-x, https://math.stackexchange.com/questions/3031149/conditional-expectation-ex-1-mid-overlinex-n-if-x-1-dots-x-n-are-i-i, https://math.stackexchange.com/questions/1945550/explain-why-ex-1x-1x-2-ex-2x-1x-2-if-x-1-x-2-are-i-i-d, https://math.stackexchange.com/questions/2935099/finding-e-left-fracx-1-x-22-mid-x-1-cdotsx-n-y-1-right-where-x-is?rq=1. – StubbornAtom May 25 '19 at 12:34
  • 2
  • @drhab: Thanks, found my mistake now and corrected it! – Julian May 25 '19 at 15:29