At the basement of a building with 5 floors, Adam, Bob, Cindy, Diana and Edward entered the elevator. The elevator goes only up and doesn’t come back, and each person gets out of the elevator at one of the five floors. In how many ways can the five people leave the elevator in such a way that at no time are there a male and a female alone in the elevator?
Did anybody get the joke in the title? :D
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Total number of ways in which 5 people can leave at 5 floors = 5 5
For the exceptional ways of leaving the elevator, we have to consider all the ways in which a pair (a M and a F) can leave at the upper floors while remaining 3 people have left the elevator at the lower floors.
There are 6 ways to choose a pair out of 3 M and 2 F.
For a given pair, the number of exceptional ways in which they can leave are as follows:
case 1 :
Total exceptional ways in which each member of pair leaves at 5 t h floor =
Number of ways in which the remaining 3 people can leave at 4 t h to 1 s t floors = 4 3
case 2 :
Total exceptional ways in which each member of pair leaves at 5 t h to 4 t h floor such that at least one of them leave at 4 t h floor =
Number of ways in which the remaining 2 people can leave at 5 t h to 4 t h floors (excluding ways already considered in case 1 ) times Number of ways in which the remaining 3 people can leave at 3 r d to 1 s t floors = 3 × 3 3
case 3 :
Total exceptional ways in which each member of pair leaves at 5 t h to 3 r d floor such that at least one of them leave at 3 r d floor =
Number of ways in which the remaining 2 people can leave at 5 t h to 3 r d floors (excluding ways already considered in case 1 and 2 ) times Number of ways in which the remaining 3 people can leave at 2 n d to 1 s t floors = 5 × 2 3
case 4 :
Total exceptional ways in which each member of pair leaves at 5 t h to 2 n d floor such that at least one of them leave at 2 n d floor =
Number of ways in which the remaining 2 people can leave at 5 t h to 2 n d floors (excluding ways already considered in case 1 , 2 and 3 ) times Number of ways in which the remaining 3 people can leave at 1 s t floors = 7 × 1 3
Total number of ways = 5 5 − 6 ( 4 3 + 3 × 3 3 + 5 × 2 3 + 7 × 1 3 ) = 1 9 7 3
PS: Sorry for the typos (if any).