5
$\begingroup$

I have a question about the waiting time paradox for poisson processes(in this case in terms of bus arrivals).

Suppose I know that buses arrive with poisson distribution(lambda). I arrive at fixed time t.

I want to figure out three things -

  1. The mean length of time I will wait until the next bus.
  2. The mean length of time since the last bus.
  3. Mean length of time between bus arrivals.

I think 1 should be 1/lambda - the poisson process is memoryless, so it shouldn't matter when I arrrive.

I think 3 should also be 1/lambda, because that is the mean of the exponential distribution, which determines the distribution of times between buses.

I'm not sure about 2.

Can anyone help/tell me if my reasoning is wrong/right?

$\endgroup$
  • 1
    $\begingroup$ Looks good so far. Now consider that in the Bizarro universe busses run backwards. What kind of distribution do they have? $\endgroup$ – Graham Kemp May 20 '14 at 21:07
  • $\begingroup$ wait...why would that matter? So I thought more about 2 - I think it should be 2/lambda - because you have an arrival interval and I arrive in some time unit in that interval- that interval is uniform, hence 2/lambda $\endgroup$ – praks5432 May 20 '14 at 21:29
  • 1
    $\begingroup$ The bizarro busses run backwards passed their stop at the same rate as yours run forwards; like filming bus arrivals and then running the film backwards. The mean time between busses remains the same, as does the variance. So it's also a poisson process! Thus the expected time until the next bizarro bus is the same measure as the expected time since your previous bus. $\endgroup$ – Graham Kemp May 20 '14 at 22:48
  • 6
    $\begingroup$ That is the paradox. The expected period between two bus arrivals is $\frac 1 \lambda$. However, because the process is memoryless, when you arrive at time $t$ then the expected time until the next, and the expected time since the previous, bus arrival are also both $\frac 1 \lambda$. $\endgroup$ – Graham Kemp May 21 '14 at 7:09
  • 1
    $\begingroup$ More generally, if the time between consecutive busses are i.i.d. distributed like $T$ then the time between the next and the previous busses is $\hat T$ whose distribution is the size-biased distribution of $T$, and your location in this interval is uniform independent of $\hat T$ hence the time before the next bus and the time since the last bus are $(U\hat T,(1-U)\hat T)$ with $U$ uniform on $(0,1)$. If $T$ is exponential, a miracle happens, which is is that $U\hat T$ and $(1-U)\hat T$ are independent and distributed like $T$... $\endgroup$ – Did Oct 8 '16 at 6:15
1
$\begingroup$

This type of problem is always tricky, as the discussion here has already shown.

As an alternative to clever thinking we can solve the problem of items 1. and 2. by just observing what happens to the passenger and the busses. Instead of doing this in the real world (thus possibly catching a cold or standing in the pouring rain) we make a simulation. The result is, of course, $1/\lambda$ for items 1. and 2. For item 3. the same result follows simply from the definition of the Possion process.

We assume the passenger to arrive at some fixes instant of time $t_p = 20$. For each trial we generate an array of a sufficiently large number of bus arrival times ($n = 50$) based on a Poisson process with $\lambda = 1$. Then we pick the bus arrival times $t_1$ and $t_2$ just before and just after $t_p$ respectively, calculate the time differences $dt_1 = t_p - t_1$ and $dt_2 = t_2 - t_p$ and study their statistics.

The time difference $\tau$ of two neighbouring events of a Poisson process is distributed according to an exponential law

$$f(\tau,\lambda) = \lambda \;exp (-\lambda \tau)$$

A random variable $r$ following this distribution is generated from a basic random number $R$ equally distributed between $0$ and $1$ is defined by

$$r=\log \left(\frac{1}{R}\right)$$

The array of bus arrival times $t_k$ is then generated by cumulating the differences $r_i$, i.e.

$$t_k=\sum _{i=1}^k r_i$$

We have done 1000 trials. The results are presented here as histograms of the $dt_1$ and $dt_2$ compared to the exponential law.

enter image description here

enter image description here

The agreement with the exponential law is reasonable. The central moments are for $dt_1$ and $dt_2$ resp.

means = {1.04494,0.966218}
standard deviations = {1.06179,0.949569}

We can also have a look on the results of all 1000 trials

enter image description here

Appendix: the Mathematica code

Scenario $t_1$ < $t_p$ < $t_2$

$t_1$ arrival time of bus just missed
$t_p$ arrival time of passenger
$t_2$ arrival time of bus to be taken by passenger

$dt_1 = t_p - t_1$ length of time by which the previous bus was missed
$dt_2 = t_2 - t_p$ length of time the passenger has to wait for the bus to be taken

The code

r := Log[1/RandomReal[]]; 
(* random time difference between two busses \
according to Poisson process exponentially distributed with lambda = 1 *)

tp = 20; (* time of arrival of the passenger *)
nn = 10^3; (* number of trials *)

m1 = {};(* store times to bus just missed *)
m2 = {};(* store times to wait for bus  *)

Do[
 tdiff = Array[r &, 50]; (* array of time differences between consecutive busses *)
 tsbus = FoldList[Plus, 0, tdiff]; (* array of arrival times of busses *)
 p = Position[tsbus, Select[tsbus, # < tp &][[-1]]][[1,1]]; (* position of arrival of passenger between the busses *)
 t1 = tsbus[[p]]; (* arrival time of bus just missed *)
 t2 = tsbus[[p + 1]]; (* arrival time of bus to be taken *)
 dt1 = tp - t1;(* length of time by which the passenger missed the previous bus *)
 dt2 = t2 - tp;  (* length of time the passenger has to wait for the bus *) 
 AppendTo[m1, dt1]; (* collect times differences *)
 AppendTo[m2, dt2],(* collect times differences *)
 {nn}] (* number of trials *)
Print["means = ", Mean /@ {m1, m2}];
Print["standard deviations = ", StandardDeviation /@ {m1, m2}];

means = {1.04494,0.966218}

standard deviations = {1.06179,0.949569}

The values are close to unity as it should be for $\lambda = 1$

$\endgroup$
-1
$\begingroup$

First two are 1/$\lambda$ for sure. We just discussed the question today with Prof.

Third one is tricky. From your point of view, you reach to the bus stop during interval with length 2/$\lambda$ . Because expected values of the time since the last bus passed and next bus will come are same; which is 1/$\lambda$. This may look counter-intuitive but actually not. In exponential distribution next bus may come very very late (actually there is no probability), so you have an higher probability to go to bus stop during these long intervals.

But for a somebody already sitting in the bus, if he takes off the bus and waits for the next one at the stop, his initial expected time is 1/$\lambda$. Now is the tricky part. Let's say you go to bus stop and ask this guy how long he has been waiting. The answer does not change anything because you are expected to wait for 1/$\lambda$ time again.

I hope it helped, did not confuse you further.

$\endgroup$
  • 2
    $\begingroup$ "We just discussed the question today with Prof." is hardly a good explanation... $\endgroup$ – Rolazaro Azeveires Feb 25 '17 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.