In 1950, physicists George Gamow and Marvin Stern noticed an interesting phenomenon: Gamow, who had an office on the second floor of a six-story building, noticed that five times out of six, the next incoming elevator went down even though it was going up. Stern, who worked on the fifth floor, observed the opposite.
The elevator usually came from an upper floor and went down when it wanted to go down. In a multi-story building, the next arriving elevator often seems to go in the opposite direction than expected. The explanation for the phenomenon lies in the different amount of time elevators spend on different floors.
On lower floors, the next elevator is more likely to go down, as the travel time down is shorter than the travel time up. On higher floors, the situation is reversed: here, the probability that the next elevator will go up is higher because the travel time down and back is longer.
If you are on the top floor of a building, all elevators come from below (none can come from above) and then go down, whereas if you are on the penultimate floor, an elevator to the top floor goes up first and then down shortly thereafter - so while there are as many elevators going up as there are going down, elevators going down generally follow elevators going up shortly, and therefore the first observed elevator usually goes up.
The first observed elevator only travels downwards if you start the observation in the short period of time after an elevator has passed upwards, while the rest of the time the first observed elevator travels upwards.
A single elevator spends most of its time in the larger part of the building and is therefore more likely to be coming from that direction when the potential elevator user arrives. An observer who stayed at the elevator doors for hours or days watching each elevator arrival, rather than just watching the first elevator, would find that there are an equal number of elevators going in each direction.
How do we know that there are the same number of elevators going in each direction? This is done by maintaining the number of elevators. If, from a certain point, there are generally more elevators going up than down, the number of elevators below that point would steadily decrease, which is impossible.