# Conditional expectation of number of trials

Consider $$n$$ independent trials, each of which results in one of the outcomes $$\{1, ..., k\}$$, with respective probabilities $$p_1, p_2, ...,p_k$$ where those probabilites sum to $$1$$. Let $$N_i$$ denote the number of trials that result in outcome $$i$$ where $$i = 1, ..., k$$. For $$i\neq j$$ find $$\mathbb{E}[N_i|N_j>0]$$.

I tried to write it as a double sum on $$i$$ and $$j$$, and expanding the conditional probability as $$\mathbb{E}[N_i=i|N_j=j]=\mathbb{P}\dfrac{(N_i=i\cap N_j=j)}{\mathbb{P}(N_j=j)}$$ but nothing came out of it, how should I proceed?

Hint: use the Law of Total Expectation:$$\mathsf E(N_i)=\mathsf E(N_i\mid N_j{=}0)~\mathsf P(N_j{=}0)+\mathsf E(N_i\mid N_j{>}0)~\mathsf P(N_j{>}0)$$

$$\therefore \mathsf E(N_i\mid N_j>0)=\dfrac{\mathsf E(N_i)-\mathsf E(N_i\mid N_j{=}0)~\mathsf P(N_j{=}0)}{\mathsf P(N_j{>}0)}$$

The terms in this fraction may be evaluated by noticing that $$N_i\sim\mathcal{Binom}(n,p_i)$$, $$N_j\sim\mathcal{Binom}(n,p_j)$$, and $$(N_i\mid N_j{=}0)\sim\mathcal {Binom}(n, \tfrac{p_i}{1-p_j})$$.

[When given that none of the trials are outcome $$j$$ the conditional probability that a particular trial is outcome $$i$$ is $$p_i/(1-p_j)$$]
