Expected value of candy for a child.

735 Views Asked by At

Suppose we have $n$ candies and $m$ children ($m$ is even) in a row indexed from $0,...,m-1$. All $n$ candies are distributed to the children in a way such that children in even positions are twice as likely to get a candy than children in odd positions. Let Q be a query asking for how much candy a Child has. A query is twice as likely to ask for even $i$ positions than for odd $i$ positions. Find $E[Q]$

My thoughts:

So $E[Q]= \sum_{i=0} ^{m-1} Q(i)*Pr[i] =\sum_{i|i mod 2=0} ^{m-2} Q(i)*Pr[i] + \sum_{i|imod2=1} ^{m-1} Q(i)*Pr[i]=\sum_{i|i mod 2=0} ^{m-2} Q(i)\frac{2}{m+2}+\sum_{i|imod2=1} ^{m-1} Q(i)\frac{1}{m+2}$

Now im really struggling to find $Q(i)$ . I was thinking maybe i could replace $Q(i)$ with a sum of some indicator variable. Can i please get some help ?

1

There are 1 best solutions below

1
On BEST ANSWER

Suppose we have $n$candies and $m$ children ($m$ is even) in a row indexed from $0,...,m−1$. All $n$ candies are distributed to the children in a way such that children in even positions are twice as likely to get a candy than children in odd positions. Let Q be a query asking for how much candy a Child has. A query is twice as likely to ask for even $i$ positions than for odd $i$ positions.

Let $D$ be the event that position of the child asked is odd.   Clearly we are told that $\mathsf P(D) = 1/3$ and $\mathsf E(Q\mid D^\complement)=2\,\mathsf E(Q\mid D)$.

So by the law of total expectation. $$\begin{split}\mathsf E(Q) &= \mathsf P(D)\,\mathsf E(Q\mid D)+\mathsf P(D^\complement)\,\mathsf E(Q\mid D^\complement) \\[1ex]&= \tfrac 53\mathsf E(Q\mid D)\end{split}$$

Now, what is the probability that a particular piece of the $n$ candies will be given to a particular child given that child is in an odd position (wlog: say position 1)? What is the expected count of candies that child will receive?