Average Floor Number of an Elevator?

A particular elevator picks people up one at a time and brings them to their destination in the following manner:

  1. The elevator starts at Floor 1
  2. It travels to the floor of the person it needs to pick up
  3. It brings the person to their desired floor
  4. It returns to Floor 1

Consider the sequence of floors that an elevator stops on. If the building has 9 floors, and every person using the elevator has an equal chance of being on any floor and wanting to go to any other floor, then the average floor number that the elevator visits is p q \frac{p}{q} . If p p and q q are coprime integers, what is p + q p+q ?

Examples:

  • Person is on Floor 4 and wants to go to Floor 7. The elevator starts at Floor 1 and goes to Floor 4, Floor 7, and then back to Floor 1.
  • Person is on Floor 5 and wants to go to Floor 1. The elevator starts at Floor 1, goes to Floor 5, then goes back to Floor 1.

Notes:

  • Assume that there is only one person waiting for the elevator at any given time.

  • Assume that the number of people lining up to use this elevator is infinite.

Bonus: Can you find the general formula for N floors?


The answer is 122.

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.

3 solutions

Jesse Nieminen
Jan 3, 2019

Let's try to tackle the general case where we have N N floors.

We notice that all legal 4 4 -step pick ups are as likely to happen. For each pick up we can calculate the sum of the floor numbers \color{#D61F06}\text{sum of the floor numbers} and the number of floors \color{#3D99F6}\text{number of floors} on which the elevator stops on. We can add together these numbers for all possible pick ups to get the total sum of the floor numbers \color{#D61F06}\text{sum of the floor numbers} and total number of floors \color{#3D99F6}\text{number of floors} on which the elevator stops on when performing each possible pick up once. Then the average floor number \color{#20A900}\text{average floor number} stopped on is the total sum of the floor numbers \color{#D61F06}\text{sum of the floor numbers} divided by the total number of floors \color{#3D99F6}\text{number of floors} .

Let's now try to actually calculate these totals.

Let's model each pick up as a N N -element row vector where each element tells how many times the elevator stopped on that floor.

If the person who the elevator is going to pick up is on the floor 1 1 and wants to go to the floor K K where K 1 K \neq 1 then the elevator goes to floor K K stops and then goes to floor 1 1 and stops . Thus the pick up vector has 1 1 at indices 1 1 and K K and 0 0 everywhere else. Sum of all these pick up vectors is [ ( N 1 ) , 1 , , 1 ] \left[(N-1), \ 1,\ \ldots, \ 1\right] .

If the person is on floor K K where K 1 K \neq 1 and wants to floor 1 1 the path of the elevator is the same as in the previous case so the sum of the pick up vectors is also the same, i.e. [ ( N 1 ) , 1 , , 1 ] \left[(N-1), \ 1, \ \ldots, \ 1\right] .

If the person is on floor K K where K 1 K \neq 1 and wants to floor M M where M 1 , M K M \neq 1, M \neq K then the pick up vector has 1 1 at the indices 1 , K 1, K and M M and 0 0 everywhere else. Sum of all these pick up vectors is [ ( N 1 ) ( N 2 ) , 2 ( N 2 ) , , 2 ( N 2 ) ] \left[(N-1)(N-2), \ 2(N-2), \ \ldots, \ 2(N-2)\right] .

Thus the sum of all of the pick up vectors from all the possible cases is [ ( N 1 ) , 1 , , 1 ] + [ ( N 1 ) , 1 , , 1 ] + [ ( N 1 ) ( N 2 ) , 2 ( N 2 ) , , 2 ( N 2 ) ] = ( N 1 ) [ N , 2 , , 2 ] \left[(N-1), \ 1, \ \ldots, \ 1\right] + \left[(N-1), \ 1, \ \ldots, \ 1\right] + \left[(N-1)(N-2), \ 2(N-2), \ \ldots, \ 2(N-2)\right] = (N-1)\left[N, \ 2, \ \ldots, \ 2\right] .

The total sum of the floor numbers \color{#D61F06}\text{sum of the floor numbers} and total number of floors \color{#3D99F6}\text{number of floors} can be calculated by taking its dot product with [ 1 , 2 , , N ] \left[1,\ 2,\ \ldots,\ N\right] and [ 1 , 1 , , 1 ] \left[1, \ 1, \ \ldots, \ 1\right] respectively.

Thus, the total sum of the floor numbers \color{#D61F06}\text{sum of the floor numbers} is ( N 1 ) ( N 2 + 2 N 2 ) (N-1)(N^2 + 2N - 2) and the total number of floors \color{#3D99F6}\text{number of floors} is ( N 1 ) ( 3 N 2 ) (N-1)(3N-2) .

Hence, the average floor number \color{#20A900}\text{average floor number} is N 2 + 2 N 2 3 N 2 \dfrac{N^2 + 2N - 2}{3N-2} .

In the case of N = 9 N = 9 , the average floor number \color{#20A900}\text{average floor number} is 97 25 \dfrac{97}{25} , yielding the answer 122 \boxed{122} .

I actually love this approach, just wanted to note that I think the sum of pick up vectors for M 1 M\neq1 and K 1 K\neq1 should be [ ( N 1 ) ( N 2 ) , 2 ( N 2 ) , , 2 ( N 2 ) ] [(N-1)(N-2), 2(N-2), \dots, 2(N-2)] . That should make the sum of all pick up vectors work out! Thanks for writing a solution!

Garrett Clarke - 2 years, 5 months ago

Log in to reply

Yes, I had that in my notes, but due to copy-pasting I managed to make that mistake consistently everywhere in my solution. Thanks for pointing it out!

Jesse Nieminen - 2 years, 5 months ago
Garrett Clarke
Jan 3, 2019

Each person riding the elevator can be considered to make up a subsequence of the infinite sequence of floors that the elevator visits. Finding the average value of this entire sequence can be solved by finding the average value of each of its subsequences. This problem can be solved by considering the 2 different cases of people riding the elevator: those who are on or want to go to Floor 1, and those who are not. We can find the answer by finding the average floor number of each case, and then taking the expected value depending on how often we see each case to find the average value of the entire sequence. It is important to note that in both cases, we begin on Floor 1, so lets assume that each subsequence begins with a 1. We disregard the fact that the elevator ends on Floor 1, as this will be the first floor in the subsequence of the next person. We now consider each of the two cases separately, and let a a and b b be the floor number that a person is currently on and the floor that a person wants to go to, respectively.

First Case: a = 1 a = 1 or b = 1 b = 1 :

In this case, note that it doesn't which variable equals 1, as the sequence will always be { 1 , k } \{1,k\} , where k = a k = a if b = 1 b=1 and vice-versa. To find the average value of this subsequence, we first find the average value of k k , which we label as k ^ \hat{k} . k k can be anything from 2 2 to 9 9 , so we have: k ^ = 1 8 x = 2 9 x = 11 2 \hat{k} = \frac{1}{8}\displaystyle\sum_{x=2}^9x = \frac{11}{2}

Since one of the values in our subsequence will always be 1, our average value of this subsequence must be:

1 + k ^ 2 = 1 + 11 2 2 = 13 4 \frac{1+\hat{k}}{2} = \frac{1+\frac{11}{2}}{2} = \frac{13}{4}

Second Case: a 1 a \neq 1 and b 1 b \neq 1 :

The sequence we'll be looking at here will be of the form { 1 , a , b } \{1,a,b\} . We treat this case similarly as the first, by finding some k ^ \hat{k} such that k ^ \hat{k} is the average sum of a a and b b . This can be expressed using the following formula:

k ^ = 1 8 7 x = 2 9 [ 7 x + ( y = 2 9 y ) x ] = 1 56 [ 6 ( 9 ( 10 ) 2 1 ) + 8 ( 9 ( 10 ) 2 1 ) ] = 11 \hat{k} = \frac{1}{8\cdot7}\displaystyle\sum_{x=2}^9\left[7x+\left(\displaystyle\sum_{y=2}^9y\right)-x\right] = \frac{1}{56}\left[6\left(\frac{9(10)}{2}-1\right)+8\left(\frac{9(10)}{2}-1\right)\right] = 11

Note now that the average for the sequence { 1 , a , b } \{1,a,b\} is the same as the sequence 1 , k ^ 1,\hat{k} , but note that k ^ \hat{k} takes the place of 2 variables, so to find the average of 1 and k ^ , \hat{k}, we need to divide by 3 instead of 2.

1 + k ^ 3 = 1 + 11 3 = 4 \frac{1+\hat{k}}{3} = \frac{1+11}{3} = 4

Now that we've determined the averages of each subsequence, we need to determine how frequently each subsequence type occurs within the whole sequence. Note that for 9 floors, The odds that a 1 a \neq 1 and b 1 b \neq 1 (the second case) is 8 7 9 8 = 7 9 \frac{8\cdot7}{9\cdot8} = \frac{7}{9} . This means that the first case should appear with odds 2 9 \frac{2}{9} . Combining these odds with our subsequence averages, remembering that the first case has subsequence lengths of 2 and the second case has subsequence lengths of 3, yields the final solution.

E [ X ] = 2 9 ( 2 ) ( 13 4 ) + 7 9 ( 3 ) ( 4 ) 2 9 ( 2 ) + 7 9 ( 3 ) = 97 25 E[X] = \frac{\frac{2}{9}(2)\left(\frac{13}{4}\right)+\frac{7}{9}(3)(4)}{\frac{2}{9}(2)+\frac{7}{9}(3)} = \frac{97}{25}

With 97 97 and 25 25 being coprime, this gives us our final answer of 97 + 25 = 122 97+25 = \boxed{122}

In my opinion, since the full elevator sequence includes a return to floor one the average is only 424/136 = 53/17 -> 53+17=70 as final answer.

Paulo Ochoa - 2 years, 5 months ago

Note that the subsequences don't overlap. We cannot consider the stop on floor 1 1 to be at the end of one subsequence and at the start of another since it would double count that stop.

Jesse Nieminen - 2 years, 5 months ago

For this specific problem, it is sufficient to consider all 72 pairs of 1 through 9 where the the numbers are not the same. This removes the nonsense trips to the same floor. The specification of an infinite number of passengers means that the initial state of the elevator starting on floor 1 can be ignored in the calculations. A passenger starting or ending on floor 1, contributes 2 stops and the floors 1 and the destination floor. The remaining combinations contribute 3 stops and both the starting and ending floor plus floor 1. The sum of all the floors under those conditions is n 3 + n 2 4 n + 2 n^3+n^2-4 n+2 . The number of stops is 3 n 2 5 n + 2 3 n^2-5 n+2 . The fraction simplifies to n ( n + 2 ) 2 3 n 2 \frac{n (n+2)-2}{3 n-2} . When n n is even, the GCD of the numerator and the denominator is 2 and both the numerator and denominator can be divided by 2. In this case, the GCD is 1 and therefore, the reduced fraction is 97 25 \frac{97}{25} , which gives the problem answer of 122.

Read the Wolfram article on Finite Difference to learn how the formulas were computed.

I modeled 2 through 10 floor buildings and computed the formulae. The columns from left to right are: the number of floors in the building, the number of distinct trips, the sum of floors reached, the count of floors reached and the floor average fraction as appropriately reduced.

2 2 6 4 3 2 3 6 26 14 13 7 4 12 66 30 11 5 5 20 132 52 33 13 6 30 230 80 23 8 7 42 366 114 61 19 8 56 546 154 39 11 9 72 776 200 97 25 10 90 1062 252 59 14 \begin{array}{rrrrr} 2 & 2 & 6 & 4 & \frac{3}{2} \\ 3 & 6 & 26 & 14 & \frac{13}{7} \\ 4 & 12 & 66 & 30 & \frac{11}{5} \\ 5 & 20 & 132 & 52 & \frac{33}{13} \\ 6 & 30 & 230 & 80 & \frac{23}{8} \\ 7 & 42 & 366 & 114 & \frac{61}{19} \\ 8 & 56 & 546 & 154 & \frac{39}{11} \\ 9 & 72 & 776 & 200 & \frac{97}{25} \\ 10 & 90 & 1062 & 252 & \frac{59}{14} \\ \end{array}

122 not 112

Vijay Simha - 2 years, 4 months ago

You are correct. It was an arithmetic error while writing the explanation. As, you can see in the table, the computation was done correctly.

A Former Brilliant Member - 2 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...