The bathroom
door problem

Past a certain number of diners, reaching for the restroom door at the same moment as the person coming out stops being bad luck and starts being the schedule. Here is where that line sits.

The room

≈ 216 patrons pass through tonight.

The restrooms
Inside
The door

Two people whose passes overlap have met at the door. Wide doorways, vestibules and blind corners all live in this number.

5:30 PM0 door meetings
—

Run the simulation to find the odds that someone walks out of the restroom just as a patron is walking in.

Any door encounter, waiting included
—
Waited outside, then it opened on them
—
Doorway collisions per 100 trips
—
Collisions in one service
—
Two people arriving at once (not counted above)
—
Trips that had to queue
—
Gave up and went back to the table
—

Where the room turns against you

Every setting held still except how many people are seated.

Someone leaving as you enter Either kind, waiting included Poisson estimate Your room

How a trip is modelled

Tables fill, empty and refill across the service, so the number seated stays roughly constant while far more people than that pass through. Each patron makes a Poisson-distributed number of trips at random points during their meal, walks to the restrooms, takes whichever stall frees up first, and walks back. Anyone facing more than a five-minute wait gives up and returns to the table.

A collision is recorded whenever one person's pass through a doorway overlaps someone else's pass in the opposite direction.

Two rooms, two different problems

A locked single-occupancy restroom makes the door itself the bottleneck. You reach for the handle as you arrive, so a true collision needs their exit to start within a door-pass of you getting there. Arrive earlier than that and you find the door locked, you know someone is inside, and you stand aside when it opens — awkward, but not a collision. Past about fifty seats almost every encounter is this polite version.

A multi-stall restroom can't be locked. Everyone walks straight in and queues inside, the door stops holding anyone up, and its traffic becomes close to pure chance — which is the regime where your original hunch is exactly right.

Reading the estimate line

If door passes arrived independently and nobody ever queued, the chance of at least one collision would follow a Poisson arrival model: one minus e to the minus the pass rate times the door window, over every pass a patron makes.

The simulation tracks that line closely while the restrooms are quiet and falls below it as they fill, because a queue is the opposite of randomness. People leave one at a time in an orderly stream, and orderly streams don't bump into each other.

Things worth sliding

  • Door pass time. The single most sensitive input. Doubling it roughly doubles the collision rate.
  • Table turnover. Shorter meals push more bodies through the same seats, and matter as much as the seat count.
  • Stalls. Going from one to two changes the mechanism entirely, not just the magnitude.
  • Gendered restrooms. Two doors halve the traffic per door; forcing people to one of them gives half of that back.