We perform a known fixed number $K$ of independent experiments, each of which has known/assumed residual odds $p$ to fail. We count the number $N$ of failures. How can I choose $M$ so that $N>M$ has odds at most $q$, for some low desired overall false-positive rate $q$?
I'd prefer an approximation based on $q$ and $E = K \cdot p$ only, with a quantitative rule on when this approximation is valid; this should include $10^{-7}\le q\le 10^{-4}$, $0.5 \le E \le 10$, $K\ge 10^4$.
Pointer to an authoritative source is prefered.
My real-life application: I'm designing devices with a self-test (of a physical random number generator) that has a known residual failure rate $p$ when there is no defect. A device self-destructs if the self-test fails more than $M$ times in its life. I want to choose (one of) the lowest $M$ such that failure rate after performing $K$ self-tests is no more than $q$ for devices with no defect.
Please retag as approriate!