After seeing this question, I thought I would try to simulate the bus waiting time paradox to help my understanding. However, what I got was the "intuitive" result, rather than that predicted by the theory.
# draw from Poisson distribution and create the cumulative sum for the bus times buses <- cumsum(rpois(1000,10)) # draw from uniform distribution and sort for the person arrival times arrivals <- sort(runif(1000)*1000*10) # find out which bus is the next bus for each arrival nextbus <- sapply(arrivals, function(x) which((buses-x)>=0)) # calculate waiting times and present summary statistics summary(buses[nextbus]-arrivals) Min. 1st Qu. Median Mean 3rd Qu. Max. NA's 0.02765 2.53200 4.94400 5.48200 7.80200 19.96000 11
As you can see, the mean wait is a little over half of the mean for the Poisson process. What did I do wrong?