Search code examples
serverprobabilitybinomial-theorem

Binomial Distribution Calculation


I have n servers and I want to know the number of servers I need to make the probability that at least 10 servers are active to be 0.99. The probability that a server fails is equal to 0.01.

So what I have so far is that I know I need at least 10 servers to be active. So the probability would be:

sum (from k = 10 to n) of (n choose k)*(0.99 ^ k)*(0.01^(n-k)) = 0.99

and I would have to do this for every n from 10 to n. I want to know is there any shorter way? Like what if I did the probability that exactly 9 servers failed and I did one minus that probability like this:

1 - (n choose 9)*(0.01^9)*(0.99^(n-9)) = 0.99

Would this give me the right answer? Please help :)

Update, I used an online calculator to solve for the latter equation (1 - probability that exactly 9 failed) and I got the maximum number of servers that could be used to make the probability of at least 10 servers to be active to be greater than 0.99 would be 380 servers, any more than that would result in a probability of at least 10 servers to be active to be less than 0.99.

I'm not sure if this is correct though. :)


Solution

  • Since you want at least X=10 successes in n trials, each trial with success p=0.99, you could consider the conjugate and figure out n in (P(X<=9|n=N,p=0.99) < 0.01).

    You can use the binomial cdf for this part

    enter image description here

    In your case it becomes

    enter image description here

    Now we want to figure out how many trials n we need to make the evaluation of the above cdf less than 0.01.

    You could for example use python to search numerically for this:

    from scipy.stats import binom
    for n in range(1000):
        p = binom.cdf(9, n, 0.99)
        if p < 0.01:
            print(n)
            break
    

    And you would see that no more than 11 servers are needed to ensure a probability of 0.99 that at least 10 servers are active :-)