Illustration of the Inspection Paradox

The above applet uses the Ptolemy II Discrete Event (DE) domain to illustrate the inspection paradox. The inspection paradox concerns Poisson arrivals of events. The metaphor used in this applet is that of busses and passengers. Passengers arrive according to a Poisson process. Busses arrive at regular intervals and according to a Poisson process, and the model collects statistics on waiting time for both cases.

The inspection paradox concerns the average time that a passenger waits for a bus (more precisely, the expected value). If the busses arrive at regular intervals with interarrival time equal to T, then the expected waiting time is T/2, which is perfectly intuitive. Counterintuitively, however, if the busses arrive according to a Poisson process with mean interarrival time equal T, the expected waiting time is T, not T/2. These expected waiting times are approximated in this applet by the average waiting time. The applet also plots actual arrival times for both passengers and busses, and the waiting time of each passenger for Poisson arrival of busses.

The top plot shows the passengers' and busses' arrival times, and the waiting times for the case of Poisson bus arrivals (the waiting times for regular arrivals are not shown). The bottom plot shows the distribution histogram of all wait times. The bin width used is equal to 0.2. The display at the bottom shows the average waiting time for the two cases.

The intuition that resolves the paradox is as follows. If the busses are arriving according to a Poisson process, then some intervals between busses are larger than other intervals. A particular passenger is more likely to arrive at the bus stop during one of these larger intervals than during one of the smaller intervals. Thus, the expected waiting time is larger if the bus arrival times are irregular.

This paradox is called the inspection paradox because the passengers are viewed as inspecting the Poisson process of bus arrivals.

This applet is implemented in MoML, as shown in a Vergil block diagram.