In a school class there are 30 pupils with different height. They form a queue and let us say that a pupil in the queue sees the wall if there is no taller people in the front of him or her. Otherwise he or she sees the neck or back of an another student.
Now there are $30!$ different ways to form the queue. How can I compute the expected number of pupils seeing the wall?
I was able to enumerate the cases in the case of three pupils like this:
1<2<3 => 3 sees the wall
1<3<2 => 2 sees the wall
2<1<3 => 2 sees the wall
2<3<1 => 2 sees the wall
3<1<2 => 1 sees the wall
3<2<1 => 1 sees the wall
Thus the expected number is $(3+2+2+2+1+1)/3!=11/6$. But how one can compute the problem with such a huge number of ways to form a queue?
HINT:
The tallest one will see the wall.
The second-tallest will see the wall half the time, as they are equally likely to be ahead of, or in back of, the tallest.
The third-tallest will see the wall a third of the time.