Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a computer programmer and we're running into a weird error on our website.

We have a large number users who do a certain task. Between the entire set of users, this task happens about once every 20 seconds, but of course each user is unique.

We're seeing a strange problem about once every four hours that may be caused by users doing the task at the exact same time as another.

I tried to find this answer on my own, and got as far as the Poisson distribution, but I haven't dealt with statistics beyond basic Poker strategy since my stats class in college 15 years ago. So, my question:

Given a large number of independent events that happen every 20 seconds, what is the exact level of unusual closeness that I would expect to see every four hours?

share|cite|improve this question
up vote 4 down vote accepted

If we assume the events are random with a rate of 1 every 20 seconds, in a time period $t$ you expect $t/20$ events. Following the Wikipedia article, this is $\lambda$. In $4$ hours you have $\frac{4*3600}t=\frac{14400}t$ tries. The probability of exactly $2$ events in time $t$ is $\frac{\lambda^ke^{-\lambda}}{k!}=\frac{t^2\exp(-\frac t{20})}{400\cdot 2}$. We want $\frac{\lambda^ke^{-\lambda}}{k!}=\frac{t^2\exp(-\frac t{20})}{400\cdot 2}=\frac t{14400}.$ Numerically they are equal at t=0.0557, so every four hours you would expect two hits within about 56 msec. Of course, this will vary, but it gives the order of magnitude.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.