Wednesday, March 17, 2010

A ticketing system

There are b available seats in a cinema and n customers. The room is dark. At the beginning all the seats are empty. A customer enters the cinema and randomly selects a seat. If it is available, then it will be assigned to that customer. Otherwise, he will randomly select another seat. How many selections are necessary in average to get all the seat assigned?

PS: if you find this very similar to the hash collision problem, well that is not by chance.

No comments:

Post a Comment