Four elevators stop on floors $1$ to $8$; a separate elevator stops on $1$ and $4$. Suppose you want to get from $1$ to $4$ …

combinatoricsfactorial

I recently encountered an interesting math problem at the hospital. The hospital had two elevator banks. The first one had four elevators that went to any of the floors, 1 through 8. While the second elevator bank was for expecting mothers, only had one elevator, and only stopped on floors 1 and 4 (as floor 4 was the birthing unit).

Assuming you're traveling to level 4 from level 1, so you can use either elevator bank, are you more likely to receive an elevator first in the elevator bank with one or four elevators? What's the average time it would take to receive an elevator in each bank?

Let's assume each elevator takes 1 second to travel each floor, whichever elevator is closests to level 1 will arrive first, each elevator is equally likely to be on any of its possible floors when you call it, and you're the only one riding the elevators at the time.

I thought I would need some sort of factorial combinatorics equation to solve this, but I'm struggling to put it together.

Best Answer

Let's look at the second bank first. The elevator there is either at floor $4$ or floor $1$ with equal probability, so the average time for this bank is $$ t_2=\frac{1}{2}\cdot 0 + \frac{1}{2}\cdot 3=1.5 $$ The first bank is more complicated. What I'm assuming is that the person calls all $4$ elevators at once and the closest one descends (I don't know how realistic this is). Each of the four elevators is on one of the floors from $1$ through $8$ and the probability of any particular arrangement of elevators is therefore $1/8^4$. Let's say the elevators are on floors $f_1,f_2,f_3,f_4$. Then the time it will take for one to arrive is $\min(f_1,f_2,f_3,f_4)-1$ and so the average time is $$ t_1=2^{-12}\sum (\min(f_1,f_2,f_3,f_4)-1)=\left(2^{-12}\sum \min(f_1,f_2,f_3,f_4)\right)-1 $$ The sum is taken over all allowed $4$-tuples of the $f_i$. It is easy to calculate directly using a computer, the sum comes out to be $8772$. So $$ t_1=\frac{8772}{4096}-1=\frac{1169}{1024}=1.1416015625 $$ If you want a less computational approach, the sum can be dealt with by hand. Suppose $\min(f_1,f_2,f_3,f_4)=m$. Then all elevators are at floors $m$ or higher and at least one is at floor $m$. Denote the number of such $4$-tuples by $N(m)$. The number of all $4$-tuples where all $f_i\geq m$ is $(9-m)^4$ whereas the number of all $4$-tuples where all $f_i> m$ is $(8-m)^4$. Then $N(m)=(9-m)^4-(8-m)^4$ since the $4$-tuples we are interested in are precisely the ones remaining after we remove all $4$-tuples which have no elevator on floors $\leq m$. Finally, the sum in question will be: $$ \sum \min(f_1,f_2,f_3,f_4)=\sum_{m=1}^8mN(m)=\sum_{m=1}^8m((9-m)^4-(8-m)^4)=\sum_{m=1}^8m^4 $$ This involves much less calculation and is perfectly tractable by hand. It also straightforwardly generalises if the number of floors isn't $8$, since the sum can be computed explicitly using the formulas for sums of powers $\sum_k k^r$.