Calculation of probability of defective products