# Probability calculation, system uptime, likelehood of occurence

A little stumped! This is probably a very basic probability question, but I am lost.

At work I was asked the probability of a user hitting an outage on the website. I have some following metrics. Total system downtime = 500,000 seconds a year. Total amount of seconds a year = 31,556,926 seconds. Thus, p of system down = 0.159 or 1.59%

Now, here is the tricky part. We have a metric for amount of total users attempting to use the service = 16,000,000 during the same time-frame. However, these are subdivided, in the total time spent using the service. So, lets say we have 7,000,000 users that spend between 0 - 30 seconds attempting to use the service. So for these users what is the probability of hitting the system when it is unavailable? (We can assume an average of 15 seconds spent total if this simplifies things)

I looked up odds ratios and risk factors, but I am not sure how to calculate the probability of the event occurring at all.

-
I think, once you are looking at users staying on the site for some length of time (even short lengths of time), the answer depends on how the downtime is spread throughout the year—how long each instance of downtime is and how long the uptime is between outages. – Isaac Jan 22 '11 at 5:07
I wasn't sure if that was significant, but if it can be approximated that such outage is distributed equally, approximately every 18,000 seconds of downtime are followed by 604,800 seconds of uptime (about 5 hours a week of downtime) – Terry Felkrow Jan 22 '11 at 5:24

Let's look at a single week and assume (based on your comment) that there are 18,000 seconds of continuous downtime somewhere in the middle of the week, say starting after $d$ seconds (I think the arrangement of the downtime is only significant if there are periods of uptime that are shorter than the visit lengths, as these periods might as well be counted as downtime, too).
If we have a single visitor attempting a 15-second visit, their visit can start any time from time $0$ to time $d-15$ or any time after $d+18000$ (up to 604,800) and be entirely clear of the downtime. That is, the only times that 15-second visit cannot start and be clear of the downtime are from $d-15$ to $d+18000$, a length of $18000+15=18015$ seconds out of 604,800 seconds. So, for each single 15-second visit, the probability that it misses the downtime is $1-\frac{18015}{604800}$. For $n$ 15-second visits in a 1-week span, for none of them to hit the downtime, the probability is $\left(1-\frac{18015}{604800}\right)^n$. The expected (average) number of visits hitting the downtime would be $\frac{18015}{604800}\cdot n$.
Using the number of visits you gave: 7,000,000 visits per year is roughly 134,500 visits per week; $\left(1-\frac{18015}{604800}\right)^{134500}\approx 4.377\times 10^{-1767}\approx 0$; $\frac{18015}{604800}\cdot 134500\approx 4006.31$. That is, with a single block of 18,000 seconds of downtime in the middle of a 604,800-second span, with 134,500 15-second visits, on average 4006 of those visits ($\frac{18015}{604800}\approx 2.98\%$) will be during the downtime.