# If I want to distribute 50 identical candies to 100 children, what is the expected number of candies a child with at least one candy has?

If I want to distribute 50 identical candies to 100 children, what is the expected number of candies a child with at least one candy has?

For example, if I give 24 candies to child A and 26 candies to child B, and don't give any candy to other 98 children, since only two children has nonzero candies, if this way the only way how I can distribute 50 identical candies to 100 children, the quantity I'm looking for would be 25.

I tried for an hour, and in the end came up with the following "solution":

Let $$Q(k)$$ be the average number of candies a child with at least one candy has provided that we distribute the candies only to $$k$$ children. Then I assumed that the average number of candies a child from this set has $$50/k$$, and there are $$\binom{100}{k}$$ different ways of selecting these set of children, so doing a weighted average, I got

$$\frac{ \sum_{k=1}^{50} 50*(100!) / (k * (k!) * (100-k)!)} { \sum_{k=1}^{50} 100! / ((k!) * (100-k)!)} \approx 1.08481.$$

Is my solution correct? If not, could you provide me with an detailed answer about how you solved it?

• I think you should give more info about how the distribution is happening.
– cgss
Commented Sep 29, 2020 at 10:07
• I think the question should be: What is the expected number of candies a child with at least one candy has? Commented Sep 29, 2020 at 10:49
• @AdamRubinson I think the question is to find the expected average of candies with children with at-least $1$ candy. The average number of candies with children with at-least one candy is dependent on the sample, so it only makes sense to calculate the expectation of the average. Commented Sep 29, 2020 at 10:51
• Yes, you're right. Commented Sep 29, 2020 at 10:52
• You want to find $E[50/S]$ where $S$ is the number of students who got at-least one candy. The general approach is to find the distribution of $S$ and use it to find $50E[1/S]=50\sum_{s=1}^{50}\frac1sf_S(s)$. Commented Sep 29, 2020 at 16:52

Pick any child, and let's say the number of candies he receives is $$X$$, so we want to find $$E(X|X>0)$$, i.e. $$E(X|X>0) = \sum_{x>0} x P(X=x | X >0)$$
Evidently $$X$$ has a Binomial distribution with $$n=50$$ and $$p = 0.01$$, so $$P(X = x) = \binom{50}{x} 0.01^x 0.99^{50-x}$$ for $$0 \le x \le 50$$. Now $$P(X=x | X>0) = \frac{P(X=x)}{P(X > 0)}$$ for $$1 \le x \le 50$$, and $$P(X>0) = 1- P(X=0) = 1 -.99^{50}$$, so $$E(X|X>0) = \sum_{x=1}^{50} \frac{x \binom{50}{x} 0.01^x 0.99^{50-x}}{1-.99^{50}}$$ We also have $$\sum_{x=1}^{50} x \binom{50}{x} 0.01^x 0.99^{50-x} = \sum_{x=0}^{50} x \binom{50}{x} 0.01^x 0.99^{50-x}$$ which is the expected value of a Binomial distribution, so the sum is $$np = 50 \cdot 0.01 = 0.50$$. Hence $$E(X | X>0) = \frac{0.50}{1-.99^{50}} = \boxed{1.26584}$$
• Usually $E\left[\frac{50}{X}\right]\neq\frac{50}{E\left[X\right]}$. Commented Sep 29, 2020 at 16:44