10 ms·
The waiting time paradox: why is my bus always late? (2018)
- gpvos 2y agoIt's not just that the bus is always late, it's also that when you are late yourself, the bus is always on time and just leaving.
- dhosek 2y agoWhen I first started going into the office regularly back in February, I would stop in a 7-Eleven a block away from my “L” stop on my way in.¹ Every day for the first couple of weeks, I would watch the train leaving the stop right when I walked out of 7-Eleven, regardless of when I left my apartment. My solution has been to stop looking at the station when I leave 7-Eleven. ⸻ 1. I still do.
- thesuitonym 2y agoSame energy as ``Doctor, it hurts when I raise my arm.'' ``Then stop raising your arm.''
- itishappy 2y agoMy favorite version: A patient comes into a doctors office complaining of pain all over. The patient grabs their elbow and says: "It hurts when I touch my elbow like this." They then grabs onto their shin and says "When I grab my shin like this, it starts hurting too!" Finally, they massage their forehead and say "It even hurts when I rub my head! Doctor what's wrong with me!?" The doctor runs a few tests and replies: "Your finger is broken."
- codetrotter 2y agoMy favorite doctor joke, semi related: Patient: Doctor will I be able to play piano after the procedure? Doctor: Yes, I don't see why not. Patient: That's wonderful! I could never play piano before!
- itishappy 2y agoSimpsons did this one in the Planet of the Apes episode. Here's a musical rendition by Dankmus. https://www.youtube.com/watch?v=sMRcIOjdojU https://www.youtube.com/watch?v=sMRcIOjdojU
- aaronbrethorst 2y agoWhat’s wrong with me? I think you’re crazy. I want a second opinion! You’re also lazy!
- flysand7 2y agoI am not crazy! (in the voice of chuck from Better Call Saul)
- bluGill 2y agoYou just need to practice.
- dhosek 2y agoI’m fond of an exchange from the end of “The Doctor Dances”: Mrs. Harcourt : My leg’s grown back. When I come to the ‘ospital I had one leg. Dr. Constantine: Well, there is a war on. Is it possible you miscounted?
- kleiba 2y agoPatient: Every time I drink coffee I feel a pain in my right eye. Doctor: Take the spoon out of the cup.
- Obscurity4340 2y agoI feel this is my bones
- chongli 2y agoYes, or my favourite: the bus shows late and then later and later and later on the “next bus” feature on my phone, then eventually it jumps 20 minutes indicating the bus has been cancelled for that cycle, so I start walking home, only for the bus to show up when I’m just too far from the stop to reach it!
- edgarvaldes 2y agoA variation: I used to take the bus instead of a 15 minute walk (it was late in the day, I was tired, etc). Sometimes the bus would take more than 15 minutes to arrive, so I questioned my decision to continue waiting. When I finally walked home, the bus would catch up with me a couple of blocks before I got home.
- JeremyNT 2y agoYes. This is the key piece to understand this "paradox": > you arrive at a random time So, um, if you intend to take public transit, it's best to not arrive at a random time. Looking at the time tables and planning around them is public transit user 101.
- bluGill 2y agoOnly for infrequent service. Many riders have service so frequent they don't check or plan as they know the bus will be there not long after they arrive, no matter when they arrive. This might even be a majority as such service is so convenient that people who live there don't bother with alternatives like a owting a car.
- YZF 2y agoor worse. leaves two minutes early when you're right on time.
- chii 2y agowhat you didnt realize is that the "early" bus is actually the late bus from the previous timeslot.
- magicalhippo 2y agoAh, but it's on time those times you are late but really need to get that one departure for some important meeting or similar. edit: interesting post with a different ending than I imagined. Been thinking about using some statistical methods to give me some better estimates of the busses I take to work. Like "given that it's $today, which is a Tuesday, it's 17:30, and the display says the bus is 7 minutes delayed, how long til it will actually come?
- jeffbee 2y ago> some statistical methods Anything would be better than what we have. When I studied NextBus predictions for the SF Muni 1-California line I found that the predicted arrival time was not even correlated with the actual arrival time. If they had taken all the radios and computers out of the system and just showed a random number as the minutes to arrival that would have been every bit as good as NextBus.
- dontlikeyoueith 2y ago> If they had taken all the radios and computers out of the system and just showed a random number as the minutes to arrival that would have been every bit as good as NextBus. Bold of you to assume they hadn't already done that. Remember, lowest bidder wins the contract.
- SllX 2y agoDunno what year you were doing this, but all the buses that travel California Street at some point are bad about this and you are correct that it might as well be a d20. The N Judah is usually on time or a little early, except going outbound between 6:30pm and 7:30pm. If you’re waiting for the F, you should mentally add 2 minutes to whatever time you see. The J Church going downtown becomes increasingly late the closer to downtown it actually gets (partly because it often loses the signal lottery with the N Judah since it gets stalled out at the Market Street intersection even if it was scheduled to go in ahead of time). When the L trains were running, it would always seem to depart from the Zoo-side terminus on time if you were waiting there, but if you were waiting up the street on Taraval, you could reliably add 5 to 10 minutes to your wait time. Also at the Embarcadero, there can never be two working upwards escalators going from the MUNI platform to the eastern exits at the same time. It simply cannot happen. If one gets fixed, the other will break, even if it was just fixed a few days ago.
- cbsks 2y ago(2018), but this article is timeless… Past discussion: https://news.ycombinator.com/item?id=18321062 https://news.ycombinator.com/item?id=18321062
- krackers 2y agoSee also https://news.ycombinator.com/item?id=16473718 https://news.ycombinator.com/item?id=16473718 and https://news.ycombinator.com/item?id=16469382 https://news.ycombinator.com/item?id=16469382 for similar
- incognito124 2y agoBut, somehow, lighting a cigarette at the station makes the bus spawn instantly. 100% reproducible.
- onlyrealcuzzo 2y agoAs a non smoker, I'll buy some cigarettes and see if I can reproduce. Thanks for the tip!
- Something1234 2y agoWaste of time because the universe knows you don't actually want that pleasure of the cigarette and will be further punished by the cigarette for your hubris.
- bregma 2y agoFilter tip only, I hope.
- Terr_ 2y agoI've been told by the manufacturers that cigarettes increase the odds of reproducing. https://xkcd.com/583/ https://xkcd.com/583/
- prmoustache 2y agoI don't understand all those smokers that are lighting a cigarettes seconds or 1 minute before the bus reaches the halt. Most of the time you can see the bus from a distance yet they still light them up.
- laweijfmvo 2y agomaybe they know they can't smoke on the bus, so they "need" to smoke as late as possible before getting on to survive the ride? idk, not a smoker.
- bravetraveler 2y ago
- prmoustache 2y agoI would say just use the app that says at which bus stop the next bus is and when it estimates its arrival. OK sometimes the app / bus location system fucks up but most of the time or their are unexpected road road work or traffic accident that suddently forces it to be slower but most of the time it is pretty much accurate.
- edgarvaldes 2y agoThe waiting time paradox is not only about the bus.
- xnorswap 2y agoMy favourite corollary of this is that even if you win the lottery jackpot, then you win less than the average lottery winner. Average Jackpot prize is JackpotPool/Average winners. Average Jackpot prize given you win is JackpotPool/(1+Average winners). The number of expected other winners on the date you win is the same as the average number of winners. Your winning ticket doesn't affect the average number of winners. This is similar to the classroom paradox where there are more winners when the prize is poorly split, so the average observed jackpot prize is less than the average jackpot prize averaged over events.
- pif 2y ago> The number of expected other winners on the date you win is the same as the average number of winners. Sorry, but no! The total number of expected winners (including you) is the same as the average number of winners.
- xnorswap 2y agoNo, it's 1+average number of winners. If the odds of winning are 1 in 14 million, and 28 million tickets are sold, then you expect there to be 2 winners. If look at your ticket and see you've won the lottery, then the odds of winners are still 1 in 14 million, and out of the 27,999,999 other tickets sold, you expect 2 other winners, and now expect 3 winners total, given you have won.
- xnorswap 2y agoFor anyone unconvinced, let's simulate this. Instead of 1 in 14 million, we'll just do 1 in 2, and 8 players. So we'll check how many bits are set in the average random byte: void Main() { byte[] buffer = new byte[256*1024]; Random.Shared.NextBytes(buffer); var avg = buffer.Average(b => System.Runtime.Intrinsics.X86.Popcnt.PopCount(b)); Console.WriteLine(avg); } Okay, bounces around 3.998 to 4.001, seems normal. Now let's check how many bits are set in the average random byte given that the low bit is 1 (i.e. player 1 has won!) void Main() { byte[] buffer = new byte[256*1024]; Random.Shared.NextBytes(buffer); var avg = buffer .Where(b => (b & ((byte)0x01)) == 0x01) .Average(b => System.Runtime.Intrinsics.X86.Popcnt.PopCount(b)); Console.WriteLine(avg); } Now ~=4.500 Which is 1+3.5 In this case, we're 1+ average from the 7 other players, so being an average of 7 others not 8 others is significant. If we simulate with millions of players, you'll see that removing 1 person from the pool makes essentially no difference.
- FabHK 2y agoRelated: Suppose Bitcoin's difficulty is tuned correctly to the target block time of 10 mins/block. Then, if you pick a block uniformly from the list of blocks, its expected length is 10 minutes. However, if you pick a point in time uniformly, the expected length of the block it's in is 20 minutes.
- laweijfmvo 2y agomy take away is that if you're lucky enough to live in a place that has such a bus schedule, you can just ignore the schedule and show up whenever you want and only wait 10 minutes. sounds lovely!
- i80and 2y agoTell me about it. Reliable 45 minute bus headways would be a dream where I live
- bluGill 2y ago30 minutes is the worst I will accept. I have better things to do than sit outside a locked door for an hour waiting for the person with the key to arrive. I want every 5 mintes but I will be able to deal with up to half hour. More than that and I guess I must drive.
- was_a_dev 2y agoBeing able to track a bus via GPS works well like this. It doens't matter if the bus is 20 minutes late, if you can check that the bus is 4 minutes away. A bit like usnig the metro. You don't know the schedule, you just know the realative time to the next train
- dekhn 2y agoI got asked a variation on this in an interview several decades ago. "What is the expected waiting time for a bus that arrives on average every ten minutes and you show up at a random time". I was sure it was 5 but they actually wanted me to do the math from the article, in my head, in 30 minutes. I did not pass that interview and did not get the job (which was a good thing long term). I really enjoy having 10-20 lines that produces the expectation value directly by simulation; that's a fast way for me to understand the underlying values.
- deleted 2y ago[deleted]
- ChrisArchitect 2y ago(2018) Some discussion then: https://news.ycombinator.com/item?id=18321062 https://news.ycombinator.com/item?id=18321062
- memming 2y agoRenewal theory! https://en.wikipedia.org/wiki/Renewal_theory https://en.wikipedia.org/wiki/Renewal_theory
- kqr 2y agoThis is one of my favourite queueing theory-adjacent consequences. As the article notes, it's the same reason the average coin in a sequence of tosses will be in a longer run than the average run length.
- deleted 2y ago[deleted]
- c_moscardi 2y agoRelated reading; explains the same concept quite well IMO with NYC subway data. This is where I learned about this concept. [1] https://erikbern.com/2016/04/04/nyc-subway-math https://erikbern.com/2016/04/04/nyc-subway-math [2] https://erikbern.com/2016/07/09/waiting-time-math.html https://erikbern.com/2016/07/09/waiting-time-math.html
- stonemetal12 2y ago>when the average span between arrivals is N minutes, the average span experienced by riders is 2N minutes. Who is arriving in the first part of the sentence? At first I thought he meant the bus arrival, thus N = 10, and 2N would be 20. But then he says >The average wait time is also close to 10 minutes, just as the waiting time paradox predicted. 10 isn't 20 so ???
- outop 2y agoThe average time between two buses (based on the Poisson model used in TFA) is N minutes. But you are more likely to arrive in a long interval than a short one. So if you turn up to the station at a random time, the average time between the last bus that departed before you got there and the next departure, is 2N minutes.
- stonemetal12 2y agoDoesn't change the fact that N is 10 and evidently 5 in the same sentence. Does author think only 'N' can be used for variables and readers are left to figure out which 'N's are the same and which are different?
- outop 2y agoNo, N means 10 in both parts of the sentence you quoted. > when the average span between arrivals is [10] minutes, the average span experienced by riders is [20] minutes. >The average wait time is also close to 10 minutes, just as the waiting time paradox predicted. The average wait time is half the 'average span experienced by riders', since the rider arrives, on average, halfway through the average span.
- taeric 2y agoThis seems more to say that the average time of all passengers waiting will be close to the interval, but that the average time for any individual in a given stop will be closer to half? (Similarly, if you are discussing the longest time you will wait throughout the day and you have multiple stops you have to wait at, it will drift up to the the interval time.) That is, they sound like similar questions, but they are not. How long can one random person expect to wait at a stop is different from how long a population will wait at a given spot. In large because a person can only arrive at a single time in the waiting interval, but more passengers become less likely the closer to departure time. (I realize I didn't word all of this as a question, but I am not asserting I'm correct here. Genuinely curious if I understand correctly.)
- maeil 2y agoIt's not about population vs. individual. The underlying principle is the assumption that we (the people taking the bus) arrive at a random time. And we're more likely to arrive in a shit interval (because they're longer) than in a lucky interval (because they're shorter). Here's a trivial example. Buses are supposed to arrive at a 10 minute interval: 12:00, 12:10 and 12:20. But today the second bus arrives a bit early, at 12:07. So they arrive at 12:00, 12:07 and 12:20. We arrive at the bus stop at a random moment >12:00 and <= 12:20. If we arrive in the interval 12:00-12:07, our average waiting time will be 3.5 minutes. What's the chance that we do arrive in this interval? 7 mins/20 mins. If we arrive in the interval 12:07-12:20, our average waiting time will be 6.5 minutes. What's the chance that we do arrive in this interval? 13 mins/20 mins. So our expected waiting time is not 5 minutes but 3.5 * 7/20 + 6.5 * 13/20 = 5.45. Basically "the shit intervals are longer so we're more likely to arrive in them. the lucky intervals are shorter so we're less likely to arrive in them.". If we arrive at a random time, which is the core assumption here. Now you might say "but 5.45 doesn't feel close to 2N". And that's where the other assumption that probably does not reflect reality comes in - the bus arrival times are simulated as uniform random numbers. I mean, it depends on where you live, haha. But it's pretty much a worst case scenario, so in reality it's not as bad. Which the writer shows using the real-world data. Nevertheless, unless it's the Japanese subway which always arrives exactly on time, it's always going to be bigger than 2N. And what if we don't arrive at a random time, but arrive according to some pattern guided by the bus schedule? That change everything. Still, it's actually pretty common to arrive at a random time, and buses (and some subways, or other things in life) do tend to arrive not exactly on time, in which case it holds. To some extent.
- Projectiboga 2y agoIn combinatorics we calculated that the typical wait time is very close to the actual planned interval.
- rjmunro 2y agoThere's another thing that happens with busses that makes it worse. The further behind the previous bus a bus is, the more people will arrive at the bus stop. The more people there are at the stop, the longer the bus has to spend picking them all up and selling them tickets etc. Therefore the delayed bus will tend to experience more delay. The bus behind them will have less people to pick up, so it will spend a shorter time at stops and tend to catch up with the first bus, so the two busses are dragged towards each other.
- jjbinx007 2y agoAlso buses are more likely to let other buses out in traffic so that's another reason why you get clumps of buses arriving rather than regularly spaced ones
- ajuc 2y agoIt's a law here in Poland that everybody has to let the buses leaving a bus stop to enter the lane before them. I think most people complaining about buses in this thread just live in a city where public transport isn't a priority so it barely works :/ The city buses I've seen in USA have 1 or 2 doors. It's already wrong - it makes the boarding time unnecessarily long. Then there's the tickets - drivers shouldn't be selling or checking the tickets. You should buy tickets in a ticket machine or on your smartphone. And they shouldn't be checked every time - it takes too long. Have a group of people who board random buses and check the tickets there while the bus is driving so as not to waste anybody's time. Bus schedules and routes should be designed with randomness in mind. There should be a small buffer (1 minute is enough if boarding is quick) to zero the randomness on each bus stop. Most bus stops should be mandatory so that 3 consecutive bus stops without passangers don't wreck the whole schedule (and then it spreads to other buses because you have to wait for 5 minutes at a bus stop for your departure time and you block entrance for other buses' passangers which makes boarding longer). If you just put an intercity bus (that can work with 1 door and driver selling the tickets) and use it as a city bus that stops every 1-5 minutes - it won't work. City buses should be optimized for latency not throughput.
- Ylpertnodi 2y ago
- maeil 2y agoThis was easily the most memorable thing I learned during my statistics degree! Nothing else has stuck with me this well.
- mass_and_energy 2y agoDoes this relate in any way to the phenomenon of "lighting a smoke to make the bus come?" you see, you're waiting for the bus and after a few minutes you realize "man, I could have had a smoke by now" so you light a smoke, but sure enough the bus will come before you can finish your cigarette. This seems to happen every time you light the cigarette waiting for the bus. So this time you get to the stop and light your cigarette right away so that the bus comes, to no avail. What gives?
- drexlspivey 2y agoSame thing is true for Bitcoin block times (also a Poisson process), a block is expected to arrive every 10 minutes on average but if 10 minutes (or 15 or 20) have passed since the last block the expected time for the next block is still 10 minutes.
- kwhitefoot 2y agoI haven't read the article but just to answer the question in the title: Buses must always be late because a bus that leaves early is even more useless.
- asdff 2y agoWell, they leave early all the time too.
- kwhitefoot 2y agoReally? Where? That happened about twenty years ago where I live in Norway. The result was that bus drivers got severe tellings off, mostly from elderly women who had been used to arriving at the bus stop just in time. After a couple of weeks the practice was stopped.
- asdff 2y agoHere in the U.S. It probably happens to me personally about once a month as a commuter. Sometimes the bus just ends up a little faster than anticipated. Other times the bus driver is trying to get ahead of the schedule to buy them more time to run in to a mcdonalds and get food (I've only seen this once though). If they end up late its pretty bad for them as it eats into their break time on the bus layover.
- fiforpg 2y agoThere is a mildly related math puzzle I learned at some point in high school (iirc): someone comes to a subway station at (uniform) random times between 6p and 8p; he notices that the first train he observes arriving at the same station is 3 times more often inbound than outbound. He also knows that time intervals between the trains going in the opposite directions are fixed and equal — say, always 6 minutes, so the only random event here is when this person arrives at the platform. Explain how this is possible.
- CRConrad 2y agoThe outbound ones are scheduled a minute and a half after the inbound. (For neat integers, should have been twice as often, or 8 minutes between them.) But the bigger question: What's the difference between "an inbound train" and "an outbound train"? Aren't almost all trains usually both inbound and outbound? First they arrive at a station, then they go on to the next. Or even at a "terminus"-type station; first they arrive at the terminus, then they go back in the other direction. How does he decide whether a train is an inbound or an outbound one, while it is standing still?
- wodenokoto 2y agoWhy does he times tau by N when calculating the bus arrival times in the beginning?
- rhymer 2y agoIf the bus arrives on time, the arrival time would be [tau, 2 * tau, ..., N * tau]. One way to simulate "random" arrival time is to draw uniform points in the interval [0, N * tau]. It turns out the inter-arrival time generated this way is approximately exponential: 1. the difference of consecutive ordered uniformly distribution random variables follows a Beta(1, N) distribution [1]. 2. As N goes to infinity, N * Beta(1, N) converges to Exponential(1) [2]. 3. Since we scale the rand() by N * tau, the inter arrival time will follow an Exponential(1 / tau) distribution (as N goes to infinity), which has an expected value of tau [3]. Edit: I just realized that the author did mention this simulation is only an approximation in the side note. [1] https://en.wikipedia.org/wiki/Order_statistic#The_joint_distribution_of_the_order_statistics_of_the_uniform_distribution https://en.wikipedia.org/wiki/Order_statistic#The_joint_dist... [2] https://en.wikipedia.org/wiki/Beta_distribution#Special_and_limiting_cases https://en.wikipedia.org/wiki/Beta_distribution#Special_and_... [3] https://en.wikipedia.org/wiki/Exponential_distribution#Related_distributions https://en.wikipedia.org/wiki/Exponential_distribution#Relat...