A Note on Walking Versus Waiting
This mathematical recreation extends the analysis of a recent paper, asking when a traveller at a bus stop and not knowing the time of the next bus is best advised to wait or to start walking toward the destination. A detailed analysis and solution i…
Authors: Anthony B. Morton
A Note on W alking V ersus W aiting An thon y B. Morton F ebruary 2008 T o what extent is a traveller (called Justin, say) b etter off to wait for a bus rather than just start walking—particularly when the bus headwa y is of a similar or der o f magnitude to the walking time and Justin does not know the precise arriv al time of the bus? The recent analysis b y Chen et al [1] go es some w ay tow ard answ ering this question; ho wev er, there a r e additional v aluable insights that can be ga ined from their approach. In essence this is a decision-theo retic problem, where the aim is to compare v a r ious strategies for getting to one’s destination. F ollowing Chen et a l [1], it is supp osed that the c omparison hinges solely on the expectation of ov erall tra vel time, and there is no additiona l penalty a ttached to w alking. W e may lis t some of the av a ila ble s trategies as follo ws: • Strategy A: W ait indefinitely until a bus ar rives. • Strategy B: Begin walking immediately and do not wait for a bus. • Strategy C: W ait for a pr e de ter mined time interv a l T W , and if no bus has arrived in this time then w alk. (Naturally , strategie s A and B can themselves b e thought of as the extreme limiting cas es of stra tegy C as T W → ∞ a nd T W → 0 res pec tively . How ever, we dis tinguish them for the sake of discussion.) F ollowing the nomenclature of [1], let d denote the jo urney distance, v w Justin’s av erage walking sp eed a nd v b the av erage sp eed of a bus. The overall trav el time is a ra ndom v a riable a nd will be denoted T t . As indica ted in [1 ], if the decisio n is purely b etw een stra tegies A and B, the problem ha s an easy , o ne migh t say trivia l, solution: if the expected a rriv a l time for the bus is T min utes in the future, J ustin sho uld wait if T ≤ d/v w − d/v b and walk otherwis e. The more interesting ques tions are (a) could there exist v alues T W for which strategy C is super ior to either A or B; a nd (b) do es the pr esence of intermediate stops affect the conclusio n? The purp ose o f this note is to show, by direct ana lysis for (almos t) arbitra ry arriv a l probabilities, that the ans w er to (a) is indeed no in most practical cases, but that the answer to (b) is not quite as clear -cut as the authors in [1] argue. The Case of No In termediate Stops The following expression is pr ovided in [1] for Justin’s exp ected travel time under strategy C, where p ( t ) is the densit y function for the probability a bus arrives t minutes from now: E [ T t ] = Z T W 0 d v b + τ p ( τ ) d τ + 1 − Z T W 0 p ( τ ) d τ ! d v w + T W . (1) In [1], this expres s ion is used to determine the waiting time T W such that E [ T t ] is eq ua l to the time d/ v w required under stra teg y B. How ever, it is a lso of interest to optimise (1) directly . The deriv ative o f (1) with respe ct to T W is ∂ ∂ T W E [ T t ] = 1 − Z T W 0 p ( τ ) d τ ! − d v w − d v b p ( T W ) . (2) The fir st term in parentheses is the complementary c.d.f. o f the arriv al time for the bus; that is, the probability that the bus has not a rrived by time T W . Denote this function by R ( t ): R ( t ) = 1 − Z t 0 p ( τ ) d τ . (3) 1 Also for br evity , define T δ as the difference betw een the trav el time o n fo ot and the tr av el time by bus: T δ = d v w − d v b . (4) Then the deriv ative (2) may be expres sed a s ∂ ∂ T W E [ T t ] = R ( T W ) − T δ p ( T W ) . (5) Zeros of (5) occur at p oints wher e 1 T δ = p ( T W ) R ( T W ) = λ ( T W ) . (6) In reliability theory where one is concerned with failur e-time dis tr ibutions, the function λ ( t ) = p ( t ) /R ( t ) is k nown as the hazar d r ate : the density for the probability of failure given a comp onent has not failed up to time t [2]. But λ ( t ) also has a natural in ter pretation for arriv a l times, where it may b e termed the app e ar anc e r ate for the distribution p ( t ). By definition λ ( t ) is nonneg a tive, but dep ending on the underlying distribution it may b ehav e in a v ar iet y of w ays: it may increase, decrease , a ttain lo cal max ima or minima, or b e co nstant. More precisely , for any T ∈ R + ∪ {∞} any nonnegative r eal measura ble function on (0 , T ) can b e the app earance rate for a p ossible arriv al time distribution p ( t ); if T is finite then take p ( t ) = R ( t ) = 0 for t ≥ T . An increasing λ ( t ) is characteristic of many waiting scenario s; it represents the case where the conditional pro ba bilit y increases with time sp ent waiting. By contrast, a co nstant λ ( t ) characterises the exponential arriv al time distribution, where time spent waiting do es not affect the conditional likelihoo d of a bus arriving. Equation (6) indicates that E [ T t ] as a function of T W is statio nary at any p oint wher e the app earance rate λ ( T W ) equals the recipro ca l of T δ . T o determine whether this is a minimum o r a maximum, one calculates the second deriv a tiv e (assuming for simplicit y that p ( t ) is dfferentiable) ∂ 2 ∂ T 2 W E [ T t ] = − p ( T W ) − T δ p ′ ( T W ) (7) and insp ects the sign of this quantit y . Since p ( t ) and T δ are b oth pos itive (a nd p ( T W ) is nonzero by (6)) this is equiv alent to the sign of − 1 T δ + p ′ ( T W ) p ( T W ) = − p ( T W ) R ( T W ) + p ′ ( T W ) p ( T W ) = − λ ′ ( T W ) λ ( T W ) = − T δ λ ′ ( T W ) . (8) Accordingly , any stationar y point o f E [ T t ] is a minim um when it co incides with a falling appe a rance rate, and a maxim um when it coincides with a rising appear a nce rate. It is thus established that, when faced with a typical proba bilit y distribution for bus arr iv als having a rising appe a rance rate, the optimal stra tegy reduces to a choice betw een stra tegies A and B, and hence to a stra ig ht forward comparis ion of exp ected ar riv al time with T δ as indicated above. F or ex a mple, if it is known that buses run punctually every T minutes but o ne does no t know the a ctual arr iv al times, the uncertaint y in arriv a l time c a n b e mo delled as a unifor m pr obability density p ( t ) b etw ee n 0 and T , with mean T / 2. The co rresp onding appe a rance rate is λ ( t ) = 1 T − t , t ∈ (0 , T ) (9) an increasing function of t . O ne ma y then distinguish three cases: 1. If T < T δ , the expected trav el time E [ T t ] has no sta tionary points, and is in fact a de c reasing function of w ait time. In this case strategy A is optimal: one should wait for the next bus. 2. If T δ < T < 2 T δ , the exp ected tra vel time has one stationary po int at T ∗ W = T − T δ , which is a maximum. The exp ected trav el time increases with waiting time up to T ∗ W and then decreases. But s inc e the mean bus a rriv a l time is T / 2 < T δ , the waiting strategy A is still prefera ble to an initial decision to w alk. 3. If T > 2 T δ , then exp ected trav e l time again re a ches a max im um at T ∗ W = T − T δ . But no w, it is b e tter to follo w strategy B and not w ait for a bus at a ll. 2 Perhaps the most in teresting situa tion here is the marginal case where T = 2 T δ : the interv a l be tw een buses is t wice the difference b et ween w alking time and bus trav el time. In this case it is equally go o d (or bad) to wait as to walk, but having decided to wait, one sho uld not g ive up and walk, as this will result in a w orse outcome (a veraged over all even tualities ). Not a ll practically realisable pr obability distributions hav e rising app earance rates for all t . Consider, for example, the situation wher e Justin has arr ived at the bus stop one min ute after the (known) scheduled ar riv al time for the bus, but knows that buses sometimes run up to five minutes late. Under r easonable assumptions this leads to a fa lling λ ( t ) for the first four minutes, and if p (0) is sufficiently lar ge a nd the s e r vice r elatively infrequent, this will res ult in an optimal time T ∗ W for which Justin sho uld remain at the bus sto p and then start walking. How ever, if the next bus can be counted on to ar rive in a time comparable to T δ , it will still be adv antageous to k eep w aiting fo r the next bus, and the lazy mathematician still wins. One ma y also co n template the sp ecial case where λ ( t ) ≡ λ is co nstant, and bus a rriv a ls are a Poisson pr o cess. The mean time b etw een arriv a ls is T = 1 /λ ; if this is greater than T δ then it is better to walk, and if less then it is better to w ait, as is intuitiv ely clear. More in teresting is the case where T ha ppens to just equal T δ : then, the deriv a tive (5 ) v anishes and the exp ected trav el time is equal to the walking time d/v w , r e gar d less of the time spent waiting. What this mea ns is , no matter how lo ng Justin decides in adv ance to wait, ov er a la rge num be r of jour neys he can exp ect to sp end no more or less time than if he had decided to w alk at the outset. Nonetheless, Poisson arriv als are generally an unrealistic assumption except in some cases of very frequent service, wher e it is generally better to catch the bus in any ev ent. In termediate Stops In [1] it is argued that the conclusion is unchanged when Justin has the additional option of walking to an intermediate stop a nd catching the bus there. If, for example, o ne re-ev aluates the decisio n betw een strategies A and B a t a distance d 1 from the start of the jour ney , then the w alking time is ( d − d 1 ) /v w and the bus tr av el time is ( d − d 1 ) /v b . How ever, the exp ected w aiting time for the bus (assuming it does not pass by en r oute ) is no w r e duced by T 1 = d 1 /v w − d 1 /v b , the time that pa sses while walking less the additiona l time tak en by the bus to reach the next stop. The terms inv olving d 1 cancel, and one is left with a decision identical to the origina l one. Under these circumstances, one would “rather sav e energy” and act as though the intermediate stop did not exist, since the outcome is the same. This conclusion is also in tuitiv ely evident. The authors arg ue that the same rea soning applies to walk-and-wait s tr ategies a nalogous to strategy C, at lea st when the wait time T W at the next s top is chosen to mak e the exp ected tr avel time equal to the walking time. How ever, there appea rs to be a circularity in volv ed her e —if the exp ected travel time is fixed as d/ v w a priori , then na turally it will be obser ved to b e the s ame whether or not J us tin walks to a nother stop. Aga in, some more insig h t into the pr o blem is gained by seeking stationa ry points o f E [ T t ] with resp ect to the fr e e v aria ble s . Suppo se strategy C is mo dified so that one w a lks a distance d 1 to a nother sto p, then waits for a maximum time T W . One may now distinguis h t wo cases, depending on whether or not a bus passes by en r oute . Denote this event b y M (‘miss the bus’) and its non-o ccurr ence by ¯ M ; the re le v ant probabilities are Pr ( M ) = Z T 1 0 p ( τ ) d τ , Pr ¯ M = 1 − Pr ( M ) = R ( T 1 ) , T 1 = d 1 v w − d 1 v b . (10) If no bus passes b y en r out e , then the e x pec ted trav el time is similar to (1 ), but with a time offset: E [ T t | ¯ M ] = d 1 v w + Z T W 0 d − d 1 v b + τ p ( τ + T 1 ) Pr ¯ M d τ + 1 − Z T W 0 p ( τ + T 1 ) Pr ¯ M d τ ! d − d 1 v w + T W . (11) Even if the bus do es pass b y , it is poss ible tha t J ustin may catch it a n ywa y , if he is vigila n t a nd there is a s top close enough, o r if the bus is delay ed, or if he takes a short cut. Le t the proba bility of catching a bus if one turns up on the wa y b e P C . On the other hand, if Jus tin misses the bus it may b e as s umed there is no adv antage in waiting for the nex t one (else he w ould hav e pr eferred 3 strategy A at the outset). Thus the expected travel time conditional on M is E [ T t | M ] = P C Z T 1 0 τ + d v b p ( τ ) Pr ( M ) d τ + (1 − P C ) d v w . (12) (Note that within the integral, τ is the time at which the caught bus reaches the starting po in t, rather than Justin’s current p osition, since p ( τ ) is the p.d.f. of bus arriv a ls at a fixe d p oint o n the route. This is a subtle po int and ea sily overlooked. In terms of τ , Justin’s overall tra vel time if he catches the bus is τ plus the time taken b y the bus to c over the e n tire journey , rega rdless of where Justin is when he catc hes it.) The ov erall ex pec ted tr av e l time is E [ T t ] = Pr ( M ) E [ T t | M ] + Pr ¯ M E [ T t | ¯ M ] , (13) where E [ T t | M ] and E [ T t | ¯ M ] ar e given b y (12) and (11) resp ectively . Again, one can differ en tiate to find o ptimal v alues of wait time T W at the more distant stop. (This is made ea sier by noting that E [ T t | M ] doe s not v a ry with T W .) One finds that ∂ ∂ T W E [ T t ] = R ( T W + T 1 ) − T δ 1 p ( T W + T 1 ) (14) and ∂ 2 ∂ T 2 W E [ T t ] = − p ( T W + T 1 ) − T δ 1 p ′ ( T W + T 1 ) , (15) where T δ 1 = ( d − d 1 ) 1 v w − 1 v b = T δ − T 1 (16) is the difference betw een trav el time on fo ot and b y bus star ting fro m the more distan t stop. These are e x actly equiv alent to (5) a nd (7), with T W + T 1 in pla c e o f T W and T δ 1 in pla c e o f T δ . According ly , the a na lysis of the previous s e c tion is es sentially unc hanged, as is the conclusion: that in most waiting scenarios the optimal v alue of T W is either zero or arbitrarily large. But now there is a n a dditional v aria ble in the pr oblem, b eca us e Justin will gener ally have a nu mber of stops to c ho ose from betw een the starting p oint and the destination. F or the sake of simplicit y , supp ose the stop spacing is small enough that d 1 can be r egarded as a co nt inuous v aria ble. Then we can try a nd optimise with respect to d 1 , obtaining after a little w ork ∂ ∂ d 1 E [ T t ] = q 2 ( d − d 1 ) [(1 − P C ) p ( T 1 ) − p ( T 1 + T W )] (17) where q = 1 /v w − 1 /v b is a constant. The ab ov e dis cussion suggests directing attention to the ca ses T W = 0 a nd T W → ∞ . If T W = 0, then (17) v anis hes unles s P C > 0; that is, when ther e is a nonzero chance of catching a bus while walking to the next sto p. Assuming then that P C > 0 a nd T W = 0, (17) is found to b e zero when p ( T 1 ) = 0 and negative when p ( T 1 ) > 0. (Recall that T 1 is pro po rtional to d 1 .) The result is in tuitively evident: a s long as there is a c hance of catc hing a bus o n the w ay (how ever small), walking a distance d 1 to an in ter mediate stop alwa ys reduces the expected tr avel time E [ T t ] relative to stra tegy B, wher e one do e s not attempt to catch a bus. The actual r eduction can b e quantified by in tegra ting (17) with respect to d 1 . Due to the factor ( d − d 1 ) in (17), the marginal reductio n in trav el time is gr e atest at the s tart of the journey , all other things being eq ua l. Now consider the case T W → ∞ . One may presume that there is a limit to the time one must wait for a bus, so that p ( T 1 + T W ) b ecomes zero for T W sufficiently large. It is also fair to assume that P C < 1. Then it follows that for T W sufficiently lar ge, (17 ) is zero when p ( T 1 ) = 0, but is p ositive when p ( T 1 ) > 0. It fo llows that walking to an in termediate sto p only to w ait indefinitely at that stop yields a worse exp ected outcome than waiting at the starting p oint, consistent with common sense. Again, (17) can b e used to judge how muc h one is w orse o ff due to the chance o f missing the bus on the w ay . The more interesting case to consider, of cour se, is a direc t compar ison b etw een strategy A (w aiting indefinitely at the starting p oint) and a strategy of walking but trying to c a tch a bus on the way . F rom abov e, the best pos sible strateg y of the latter v ar iety is the case T W = 0 and d 1 = d : a little manipulation of (13) yields the result E ∗ [ T t ] = d v w − P C Z T δ 0 ( T δ − τ ) p ( τ ) d τ . (18) 4 Under strategy A, of course, the expe cted trav el time is just the bus trav el time, plus the exp ected arriv al time fo r the bus: E A [ T t ] = d v b + Z ∞ 0 τ p ( τ ) d τ . (19) The difference in expected travel time is then E A [ T t ] − E ∗ [ T t ] = P C T δ (1 − R ( T δ )) + (1 − P C ) Z T δ 0 τ p ( τ ) d τ + Z ∞ T δ τ p ( τ ) d τ − T δ . (20) If this quantit y is positive, it repres ent s the exp ected time saving if o ne walks instea d of waiting. (It will b e seen that all ter ms are in fact nonnegative apart fro m the la st o ne, T δ ; which, how ever, is relatively lar ge.) F or exa mple, let p ( t ) be the unifor m distribution based on a bus hea dwa y T . The mea n arriv al time is T / 2 and hence E A [ T t ] = d/v b + T / 2. If T > T δ , then E ∗ [ T t ] = d v w − P C T 2 δ 2 T (21) and this improv es on E A [ T t ] if P C > 2 T T δ − T T δ 2 . (22) As T / T δ increases from 1 to 2, the minimum probability P C decreases from 1 to zero; reca ll that when T /T δ > 2 strategy A is worse than strategy B, whic h is equiv a lent to the above strategy with P C = 0. If T < T δ , then E ∗ [ T t ] = d v w − P C T δ − T 2 (23) and the co ndition for this to improv e on E A [ T t ] reduces to P C > 1, a co ntradiction. Acco rdingly , strategy A is still the best choice fo r uniform a rriv a l pr o babilities with headw ay T < T δ . Conclusion Closer a nalysis of the mo del a nd results in [1] for a traveller at a bus s top confirms that the laz y mathematician do es indeed win in ma n y cases . The exact criter ia for when it is better to walk can b e formu lated in terms of an a ppe a rance r a te function, and if one dis regards the existence of int ermediate stops, an arriv al pro bability with a r ising app ea rance rate is sufficient to make waiting the bes t str ategy . It has also b een shown, howev er, that allowing for the p os sibilit y of catching the bus at a n int ermediate stop can restore the walking str a tegy to optimality . In the end, the dec ision whether to walk o r w ait is not alw ays clear- cut, and relies o n o ne ’s expecta tio ns o f b eing able to catch a bus on the run, as well as of a bus turning up in the first place . In the particular cas e where one kno ws the (unifor m) headway but no t the exact timetable, it has bee n clearly established that one should w ait if the headw ay is less than the walking time (less bus trav el time), and should walk if the headway is more than t wice this muc h. This leav es a substantial window where it may be b etter to w ait o r to walk, dep ending on one’s confidence in b eing able to catch up to a passing bus. References [1] J.G. Chen, S.D. Kominers, and R.W. Sinnott. W alk versus wait: The lazy ma thematician wins. arXiv.or g Mathematics , January 20 08. http://arxiv.o rg/a bs /0801.02 97 . [2] R. Billinton and R.N. Allan. R eliability Evaluation of Engine ering S ystems . Plen um, second edition, 1992 . 5
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment