I have detector which will detect an event with some probability p. If the detector says that an event occured, then that is always the case, so there are not false-positives. After I run it for some time, I get k events detected. I would like to calculate what the total number of events that occured was, detected or otherwise, with some confidence, say 95%.
So for example, let's say I get 13 events detected. I would like to be able to calculate that there were between 13 and 19 events with 95% confidence based on p.
Here's what I've tried so far:
The probability of detecting k events if there were n total is:
binomial(n, k) * p^k * (1 - p)^(n - k)
The sum of that over n from k to infinity is:
Which means, that the probability of there being n events total is:
f(n) = binomial(n, k) * p^(k + 1) * (1 - p)^(n - k)
So if I want to be 95% sure I should find the first partial sum
f(k) + f(k+1) + f(k+2) ... + f(k+m) which is at least 0.95 and the answer is
[k, k+m]. Is this the correct approach? Also is there a closed formula for the answer?