# How close are these events?

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?

-

## 1 Answer

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.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 9, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9609788060188293, "perplexity_flag": "head"}