11 ms·
Where to wait for an elevator (2010)
- cgio 4y agoWhy is it not the first elevator in my direction? I’ll need to walk the same distance if it ends up being the third. If it is the first I saved walking to the median and back.
- wizofaus 4y agoI thought the same thing - the way the problem is stated doesn't explicitly discount the distance walked before reaching any of the elevators, so logically the answer will depend on the configuration of the lobby and where you first enter it...or at least the position of the elevator call button. E.g. if the call button is to the left of all 3 elevators, it definitely makes sense to walk to the first of those, but any further is adding distance that will be doubled if that leftmost elevator is the first to arrive. I'm pretty sure even if the next two elevators are 100s of metres away, the mean distance walked from the moment you press the call button will go up if you start walking towards them, but haven't tried proving it.
- deleted 4y ago[deleted]
- acomjean 4y agoclearly they aren't using "destination dispatch" where the elevator tells you where to wait after you tell it where you want to go. https://en.wikipedia.org/wiki/Destination_dispatch https://en.wikipedia.org/wiki/Destination_dispatch I've only seen this in one building. It was a little weird, but it supposedly is coming soon to more and more elevators.
- tarentel 4y agoI worked in a building at NYC that did this. It was confusing at first as I just immediately jumped into the first elevator door that opened since it was my first day and didn't realize there were no buttons inside. After the initial and very short learning curve due to all the stairs I had to climb that day I would say it was much more efficient than any other building I had been in.
- bombcar 4y agoI encountered one that did this, but the screen for selecting your floor was a temperamental touch screen, so trying to type "13" would often select "1" and "11" before 13, consigning you to riding and stopping at those floors, also. Then I found the secret wheel-chair button assortment, which was genuine buttons.
- bobbylarrybobby 4y agoAt the end of the workday, not having several full elevators stop on their way down to the lobby to try (and fail) to take you down from the second floor is a godsend to everyone involved.
- ncmncm 4y ago2nd floor? You need the exercise.
- ThePadawan 4y agoI live in a building that has this. As a resident - it works. Whoever made this building made a whole lot of mistakes though: - They put this into a building with public spaces (e.g. a doctor's office). - When standing in front of the elevators, nowhere does it say which office is on which floor (it says so in the lobby which you walked by to get to the elevators) - The screens where riders have to select floors automatically turn off after not being used for a few minutes. At that point, to people who have never used them before, they do not look like they have anything to do with the elevators at all. - When these screens do turn on, they list the floors in reverse order (i.e. highest first). That makes sense because the people on the highest floors are the most likely to use the elevators, right? Well, all the offices are on floors 1 through 4. They're on page two of the screen. The button for "next page" is not labelled as such. You have to know it's there. - The screens are resistive touch screens and not well calibrated. The buttons to select a floor are approximately the same height as the tip of your index finger. A first time user won't hit the correct floor the first time, guaranteed. - At the point where you are standing in front of the elevators, you are so deep into the building that you have 0 cell reception. I have randomly encountered food delivery people be stranded there because they could not call their customers to figure out how to use the elevator. Every single week I have to rescue a poor 80 year old person who needs to go to the doctor and is horribly lost and confused, and it just breaks my heart how the building's owner (which I've contacted about this to no avail) chose "oh the salesperson said this was more efficient and trendy" and now a large percentage of users are so much worse off for that choice.
- ehvatum 4y agoI wonder if there is any improving that system without replacing it.
- xmodem 4y agoMost of the problem described here is the input mechanism. The building I work in has "destination dispatch" too but instead of a touchscreen, it has a large numeric keypad that you type your floor number on, with physical buttons that look like normal elevator buttons. We do also have some floors that are open to the public and i've only seen people confused by it a couple of times in several years of working here.
- jaywalk 4y agoI stayed at a hotel that used this. It's a very nice, efficient system. Much better than everybody cramming into the next elevator that arrives and selecting a bunch of floors.
- yccs27 4y agoIf you want a fun challenge, try making your own elevator algorithm! https://play.elevatorsaga.com/ https://play.elevatorsaga.com/
- baxtr 4y agoMight be a bit off-topic… But: The one big question I have with elevator UX is this: why isn’t it possible to deselect a choice? So pressed 10th floor but wanted 11th. There is no way to press button 10 and then button 11 to correct that mistake. Will I ever solve this mystery?
- rootusrootus 4y agoI imagine that's by design. Otherwise you could unselect other people's choices.
- baxtr 4y agoYes of course it’s by design. I just wonder why.
- mulmen 4y agoBecause you could deselect other peoples choices.
- ehvatum 4y agoHow do I go about deselecting other people's choices, if that's my specific goal? I can get whatever I want in Jira, but nothing in elevators. It's fucked.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- eddd-ddde 4y agoThis isn't an argument, as you can also select other people's non-choices.
- mellavora 4y agoSo why is it that if you select 2 and 3 you don't get to floor 5?
- kazinator 4y ago> So standing in front of the second elevator minimizes the expected distance to the next elevator, assuming all three elevators are equally likely to arrive next. > What if you want to minimize the worst case instead of the average case? Stand half way between the first and third elevators. What is the difference between "in front of second" and "halfway between first and third"?
- sanderjd 4y agoThe elevators are not evenly spaced. This point is in the article but could have been belabored a bit more. If they are evenly spaced, there is no difference.
- mikkergp 4y agoI assume this must mean that the elevators are not equidistant from eachother. As in 1 is 10 feet from 2 is 20 feet from three.
- PebblesRox 4y agoThey’re not necessarily evenly spaced. The middle elevator might be a lot closer to one side than the other.
- Jtsummers 4y agoFrom the problem statement (first two sentences of the post): > Imagine a bank of three elevators along a wall. The elevators are in a straight line but they are not evenly spaced.
- troglonoid 4y agoIn the first paragraph he says the elevators aren’t evenly spaced, and then again, it is mentioned in the James Hadley quote. In this scenario, the second elevator isn’t centered between the first and the third elevators. If I understand the description properly, the layout may be something like this: []__[]____[]
- xcskier56 4y agoWhelp, now I'm gonna think about minimizing the distance to every elevator every time I'm in front of more than 2 elevators... thanks
- OisinMoran 4y ago"Since you can’t move without increasing the average distance, you must have started at the best spot." Technically this isn't a fully sound inference. All this proves is that you're at a local optimum. So you'd also need to know or show that there is only one optimum/the problem is convex/local=global or any variant. Of course that is the case here, but it's always worth noting the specific properties of a problem that make a neat solution possible.
- bumbledraven 4y agoThe author addressed this point in a comment on the article: > True, it’s not a rigorous proof. You can find a rigorous proof here: > “A Simple Noncalculus Proof That the Median Minimizes the Sum of the Absolute Deviations.” Neil C. Schwertman, A. J. Gilks, and J. Cameron. The American Statistician, Vol. 44, No. 1 (Feb., 1990), pp. 38-39. That paper fits on one page, not counting references. Here's a link: https://tommasorigon.github.io/StatI/approfondimenti/Schwertman1990.pdf https://tommasorigon.github.io/StatI/approfondimenti/Schwert...
- thaumasiotes 4y ago> "Since you can’t move without increasing the average distance, you must have started at the best spot." > Technically this isn't a fully sound inference. All this proves is that you're at a local optimum. So you'd also need to know or show that there is only one optimum/the problem is convex/local=global or any variant. You can't move away from the median without increasing the average distance over all doors, when you're standing on the median. But that's just a special case of the also-easy-to-prove fact that you can't move away from the median without increasing the average distance over all doors, no matter where you're standing. You can show that by exactly the same argument used in the post - if you move away from the median, your total distance to all doors will increase, because you moved away from more than half of the doors. This suffices to show that -- if there is a global optimum superior to the local optimum at the median door -- that global optimum cannot be located in the neighborhood of any point on the real number line, which is to say it cannot be located at any finite distance from the median. Or in other words, no such global optimum can exist.
- chis 4y agoIs there any intuitive explanation for why the mean minimizes the squared error? I know it IS true - this property is used for linear regressions etc - but I couldn’t actually explain it. It seems like whatever minimizes a squared error should itself have some squares in it.
- shikoba 4y agoIf you know about inertia, the grabiy center is where inertia is minimized. But it's just a way to rephrase it.
- GuB-42 4y agoDistances are squares, actually square roots of squares, in Euclidian space, so it makes sense to find squares when we deal with distances. An intuitive way to look at it is that square function is the simplest function that goes down until it reaches a minimum, and then back up again. If you want this property, you can expect to find squares somewhere. Distance have this property: if you move in a straight line, the distance to your target will go down as you are closing in, then you reach it, then if goes back up again after you pass it. That's the general intuition for where the squares can be. Let's be a bit more formal. Let's flip the problem and try to minimize the sum of the squared distances (or squared error, same thing). In 1D, the sum of the squared distances to a and b is (a-x)^2 + (b-x)^2 = a^2 - 2ax + x^2 + b^2 - 2bx + x^2 = a^2 + b^2 - 2(a+b)x + 2x^2 It is a parabola, the minimum is where the derivative is zero. The derivative is -2(a+b) + 4x, solve -2(a+b) + 4x = 2 for x and you have x = (a+b)/2, which is your average. Of course, it works with more than 2 distances. Another intuition: to minimize something, usually, we take a derivative, and when we take the derivative of something squared, the square tends to disappear, so it shouldn't surprising that the minimum of something squared has no squares in it.
- dragonwriter 4y ago> An intuitive way to look at it is that square function is the simplest function that goes down until it reaches a minimum, and then back up again By what measure of simplicity is x^2 simpler than abs(x)? I mean, if you added the caveat “with a continuous derivative”, sure.
- glitcher 4y agoThe best real-world optimization: stand aside to make room for anyone exiting the elevator before crowding the doorway trying to walk in too quickly!
- novosel 4y agoOh my god, this.
- GuB-42 4y agoGreat, you just made the problem more complicated. That's is because if there are people in the elevator and you right in front of it, you have to move away, wait, and go back. Not ideal, it makes more sense to wait on the side of the elevator, possibly at a distance proportional to the expected time it takes for the passengers to leave. That would make the ideal waiting spot somewhere between the middle elevator and the other one that is the furthest away from the middle elevator, but not necessarily the mean.
- kqr 4y agoDepends a bit on assumptions, but it's not quite what I expected, actually: import math import random B = 1000 elevators = [-6, 0, 3] def time_to_enter_distribution(position): for _ in range(0, B): elevator = random.choice(elevators) distance = elevator - position # What matters is not how many people are in the elevator, but how # quickly they can evacuate. Approximate Poisson distribution. evac_time = [0, 1, 2, 3, 3, 4, 5][random.randint(0, 6)] # While you walk to the elevator, you give time for people to evacuate # and your time passes. evac_time -= abs(distance) time = abs(distance) # If people are still evacuating when you have arrived, you have to wait # for that to end by the side of the elevator, and then take the final # 0.5 metres to step inside. if evac_time > 0: time += evac_time + 0.5 yield time def time_to_enter_summary(position): distr = list(time_to_enter_distribution(position)) sum_time = sum(distr) sum_sq_time = sum(t**2 for t in distr) mean = sum_time/B sd = (sum_sq_time - sum_time**2/B)/(B-1) se = sd/math.sqrt(B) return (mean, se) if __name__ == '__main__': print(f'{"pos":5s} {"t":4s} {"se":3s}') for p in (i/4 for i in range(-6*4, 3*4)): (t, se) = time_to_enter_summary(p) print(f'{p:5.2f}: {t:4.2f} ({se:3.2f})')
- throw__away7391 4y agoWell ok, but if you listen carefully you can hear which elevator is coming/closest and always be standing directly in front of the one that is arriving.
- deleted 4y ago[deleted]
- Tempest1981 4y agoReminds me of this: https://en.wikipedia.org/wiki/Rectilinear_Steiner_tree#Single-trunk_Steiner_trees https://en.wikipedia.org/wiki/Rectilinear_Steiner_tree#Singl... The best "trunk" to minimize total distance to all points is the median of their positions.
- hddqsb 4y ago> standing at the mean minimizes the average squared distance This is true, but I find it more intuitive to think about the signed distance: if you define signed_dist(x, y) = x - y, then the mean is the value that makes the average signed distance closest to 0. Of course in reality distance is unsigned – if you walk 1m left then 1m right, you've walked 1m + 1m = 2m, not 1m + -1m = 0m, so the signed distance is not appropriate. Here is a practical example where the aim is to get the average signed difference to be closest to 0: You want to count a large number of nails by weighing them. To do that, you need to know the weight of a single nail. But the nails have slightly different weights, so you need to pick some representative value. Question: Should you pick the mean or the median? Answer: You should pick the mean, because when you weigh all the nails together the differences will cancel out. So the rule is: - To minimise the average value of the absolute difference, pick the median. - To minimise the absolute value of the average difference, pick the mean.
- thaumasiotes 4y ago> But the nails have slightly different weights, so you need to pick some representative value. Question: Should you pick the mean or the median? Answer: You should pick the mean, because when you weigh all the nails together the differences will cancel out. Well, yes, that is the definition of the mean. But you can't know what the mean is without having already answered your original question of "how many nails are there?", so as a formal matter this is completely useless advice. What you actually want to do is pick out a number of nails that you do know exactly, say 10, weigh them, and use the mean weight of that sample to estimate the mean weight of the entire supply of nails.
- hddqsb 4y ago> But you can't know what the mean is without having already answered your original question of "how many nails are there?", so as a formal matter this is completely useless advice. Yes, obviously you'd estimate the mean/median by taking a small sample (or using a published value). I left that detail out because it's not relevant to the choice between mean and median.