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?