I am working with a colleague to produce a function to determine how frequently a widget should be pulled from a production line and evaluated for quality assurance. My colleague offered Cochran’s Sample Size Formula. This is very much a work in progress.
Z is the confidence level,
p is the probability of success or expected ratio,
q is the probability of failure and or (1-p)
d is the precision.