I need to calculate mean and variance of the random variable $X$ which can be defined as: let $N$ be number of people in a row. If a higher person stands in front of a lower person in a row, then the lower person is not seen. Let $X$ be the number of people that is seen if you look at the row (you stay in front of it).

I tried to calculate the probability of $k$-th person in a row to be seen by dividing number of variants where this person is seen by the number of all variants. But the expression I got were not very nice. Are there any other ways to solve the problem? Any tips would be highly appreciated!

Edit. I see in this question that the mean of such variable can be found pretty easy. But what about the variance? Since variance of the sum of dependent variables is not equal to sum of variances?

  • 2
    $\begingroup$ Are all people of unique height? $\endgroup$ – Tony Hellmuth Jun 3 '18 at 16:49
  • $\begingroup$ @TonyHellmuth, not necessarily. $\endgroup$ – makar Jun 3 '18 at 16:50
  • 1
    $\begingroup$ Is the heights aren't unique, I think you would have to tells us what they are, or at least their distribution. Anyway, I would try to do this first under the assumption of unique heights -- that looks hard enough to be going on with. $\endgroup$ – saulspatz Jun 3 '18 at 16:59

The events that person $i$ can been seen and that person $j\gt i$ can be seen are in fact independent: Whether $i$ can be seen only depends on the order of the first $i$ people, not on their heights, whereas whether $j$ can be seen past them depends only on their heights, not on their order. Thus $\mathsf E\left(X_iX_j\right)=\mathsf E\left(X_i\right)\mathsf E\left(X_j\right)$ (with $X_i$ the indicator variable for person $i$ being seen), and thus

\begin{eqnarray*} \mathsf E\left(X^2\right)-\mathsf E(X)^2 &=& \sum_i\left[\mathsf E\left(X_i^2\right)-\mathsf E\left(X_i\right)^2\right] \\ &=& \sum_i\left[\mathsf E\left(X_i\right)-\mathsf E\left(X_i\right)^2\right] \\ &=& \sum_i\left[\frac1i-\frac1{i^2}\right]\;. \end{eqnarray*}

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.