How many requests will I have to do to be 50%, 80%, 99% and 100% certain that I have fixed a 502 HTTP response issue that had 1 in 8000 a rate of occurrence?
General answer will obviously be awesome (that applies for any certainty level and any frequency of occurrence).
Exponential probability distribution, with $\lambda = \frac{1}{8000}$
for 99% confidence
$0.99 = 1 - \exp( -\lambda x)$
$\lambda x = -\ln(1 - .99) $
$x = \frac{-\ln(1 - .99)}{\lambda}$
for 99%
$x = -\frac{\ln(.01) }{\frac{1}{8000}}$
$x = -8000\ln(.01) = 36841$ tests
you can change the .01 to the degree of confidence you require