The Elevator Problem – tonysoprano44

There are 5 floors in an elevator system. On the outside of the elevator there are two buttons for floors 2-4, and one for floors 1 and 5. These buttons are labeled either up and down, and call the elevator to queue your floor for transportation whether you want to go up or down. The inside of the elevator has a control panel that has a button for every floor in the system. Pressing one queues up the request to go to the designated floor. Pressing all of the buttons will go in chronological order based on the direction the elevator is headed.

Suppose someone is standing on floor 1 and anticipates going to floor 5. They would press the button on the outside of the elevator. If the elevator is empty and there are no queued stops, the elevator would make its way to floor 1. The person would get into the elevator cabin and press their designated floor, in this case floor 5.

Concurrent to the first person pressing the button to go to floor 5, a second person on floor 3 presses the button to go up, with intent to go to floor 4. The elevator stops at floor 3, brings the second person to floor 4, and then brings the first person up to floor 5.

However, if the second person pressed the down button rather than the up button, the system would bring the first person to floor 5, and then head to floor 3 to bring the second person to their intended floor, in this case either 1 or 2.

The queue system is set up efficiently, so that if the direction of the elevator is down, it will queue requested stops and drop offs in chronological order. For example if two people are in the elevator on floor 5 (one with the intent to go to floor 4 and one with the intent to go to floor 2), and someone on floor 4 requests to go down to floor 3, it will drop them off in order of requested stop: Floor 4 then floor 3 then floor 2.

This entry was posted in Riddle. Bookmark the permalink.

3 Responses to The Elevator Problem – tonysoprano44

  1. davidbdale's avatar davidbdale says:

    These statements for the most part accurately describe the current situation, but they ARE NOT:
    A set of INSTRUCTIONS to an ignorant elevator that needs to be programmed to operate as desired.

    FOR EXAMPLE:
    1. When the UP BUTTON is lit on any floor above where the car is positioned, proceed immediately to that floor, not stopping at any intervening floor.

  2. davidbdale's avatar davidbdale says:

    Check out Sunflower828’s post. It’s closer to the ideal set of Instructions.

    Elevator Riddle- Sunflower828

  3. davidbdale's avatar davidbdale says:

    Provisionally graded out of gratitude for your contribution to the project and your effort. You may still earn a Regrade by transforming your descriptions of elevator operations into INSTRUCTIONS written for the elevator (as if the Elevator were your reader and needed to be told how to operate).

Leave a comment