Bus arrival poisson paradox

6.2k Views Asked by At

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?

2

There are 2 best solutions below

0
On

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$

1
On

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.