Simulating a Poisson Process
Watch arrivals unfold in real time. This interactive simulation generates exponential interarrival times and builds the counting function N(t) step by step.
In our Poisson process post, we derived the distribution from first principles. We sliced a time interval into infinitely thin slices, assigned a probability to each slice, and took the limit as the number of slices approached . This simulates the process, so you can watch the number of arrivals grow over time.
The Simulation Algorithm
We learned from the exponential distribution that if events arrive at rate , the time between consecutive events follows . To simulate a Poisson process, we need to generate exponential interarrival times.
The inverse-transform method lets us generate an exponential sample from a uniform random number. Starting with , then:
The random variable follows .
To simulate over an 8-hour window:
- Draw , compute . The first arrival is at time .
- Draw , compute . Second arrival at .
- Continue accumulating: .
- Stop when .
That’s the complete algorithm. No approximations, no lookup tables. Uniform random numbers and a logarithm.
The Counting Function N(t)
The Poisson process is usually written as : the number of arrivals by time . It starts at zero, increases by 1 at each arrival, and is constant between arrivals. The resulting graph is a staircase.
The red dashed line shows the expected value: . This is the deterministic trend that the random staircase fluctuates around. Sometimes the process runs ahead of expectation, sometimes behind. Over many runs, the average staircase converges to that line.
Interactive Simulation
Press Play to watch the process unfold. The left chart is : a blue staircase that climbs by one at each arrival. The red dashed line is the theoretical expectation . The right chart builds an empirical histogram of over completed runs, with the theoretical Poisson PMF overlaid in red.
Use Reset to generate a fresh realization and clear the histogram. The speed selector controls how fast the animation runs. Drag the scrub bar to jump to any point in time. Use the slider to change the arrival rate.
What to Notice
-
The staircase is built from coin flips. Every infinitesimal slice of time is a Bernoulli trial. During this slice of time, did an event happen or not? The Poisson distribution is what you get when you take infinitely many of those trials. Of course, the staircase only steps up, never down. You can never have fewer total events later in time. The randomness comes from the same place as any sequence of independent trials: nobody knows which slices will fire until they do.
-
Higher means more arrivals and a steeper staircase. The gaps between steps get shorter. At , you’re averaging 96 arrivals over the shift; the staircase looks almost smooth.
-
Lower makes the gaps visible. At , you might go an hour or two without a single arrival. That’s the exponential distribution at work. Long gaps are not unusual when the rate is low.
Connection to Theory
Here’s the connection to the previous post: Fix any time and ask: what is ? It’s a random variable. Each run of the simulation, you get a different value. The distribution of that random variable is exactly .
The PMF we derived tells you the probability of landing on each staircase height at time . The simulation makes that abstract distribution concrete. When you watch the staircase and notice it usually ends somewhere close to (given , ), and occasionally ends at 18 or 30, you’re seeing the Poisson distribution play out in real time.