Given an "accept number" for nonconformances in single-stage random sampling from a large population, AIU-QLV computes the Acceptable Quality Level (AQL), the Indifference Quality Level (IQL), and the Unacceptable Quality Level (UQL) [also called the Limiting Tolerance Percent Defective (LTPD)] associated with a stated Yield/Reject Percentage from 50% to 99%. The sampling theory is based upon the Binomial distribution (Type B); samples are viewed as resulting from a series of "n" stochastically independent "Bernoulli Trials" ...where the probability of observing a single nonconformance in each such trial is "p", and 0 <= p <= 1. The probability of getting exactly "x" nonconformances in n trials is thus... Pr( x, n ) = ( n choose x ) times p**x times (1-p)**(n-x) where ( n choose x ) denotes the binomial coefficient defined to be n! divided by the product of x! times (n-x)!, n and x are integers such that 0 <= x <= n, zero factorial equals 1, and n! = n * (n-1) * (n-2) * ... * 1 when n >= 1, p**x denotes p raised to the power x, (1-p)**(n-x) denotes (1-p) raised to the power (n-x), n = Sample Size, and x = Number on Nonconformances Observed. One's random sample may have been taken "with replacement," but the probability of any one unit being sampled two or more times is zero because the population size is assumed to be infinite (or, at least, very large in size.) AIU-QLV.EXE, ver.9308 . . . . . . . . . . . . . . . . . . Page 2 DEFINITIONS: ============ The AQL fraction defective is the largest value of nonconformance rate, p, for which expected Yield is at least the stated Yield Percentage (usually 95%.) Equivalently, if the true nonconformance rate does not exceed the AQL, then the probability of rejection [observing x > ac nonconformances in a sample of size n] must not be more than a stated "alpha" level (usually .05.) The IQL fraction defective is the value of nonconformance rate, p, for which expected Yield is 50%. The UQL or LTPD fraction defective is the smallest value of nonconformance rate, p, for which the expected Rejection Rate is at least the stated Rejection Percentage (usually 90%.) Equivalently, if the true nonconformance rate exceeds the UQL or LTPD, then the probability of acceptance [observing x <= ac nonconformances in a sample of size n] must not be more than a stated "alpha" level (usually .10.) The "Operating Characteristic" (OC) curve for a sampling plan gives the probability that a batch of product will be found to be acceptable as a function of the true (unknown) nonconformance rate, p. The OC curve usually starts out at 1 for p=0 (left-hand extreme) and is monotone non-increasing in p, ending up at 0 for p=1 (right-hand extreme.) The AQL fraction is then the right-most p-value such that the OC curve lies above the desired Yield fraction (usually 0.95) everywhere to its left. And the UQL fraction is the left-most p-value such that the OC curve lies below the desired 1 - Yield fraction (usually 0.10) everywhere to its right. AIU-QLV Prompts and Parameter Limits... MIN MAX ======================================== What is the Sample Size ? [n] : 2 2,147,483,648 What is the Accept Number ? [ac] : 0 n - 1 Reject Number: rj = ac + 1 1 n Probability Content of Upper Bound ? [1-alpha] : 0.50 0.99 Example Batch Input File... =========================== AIU-QLV.INP ...Batch Input File for the sampling plans in the AQL=0.40 (normal inspection) column of Table II-A of Mil-Std-105E or, equivalently, ANSI/ASQC Z1.4. Calculations show that the implied AQLs are not as close to their intended "target" value of 0.400% as one might hope, but we are using normal/reduced/tightened switching rules here... AIU-QLV.EXE, ver.9308 . . . . . . . . . . . . . . . . . . Page 3 All of the following AIU-QLV calculations are for a Yield Percentage of 95.0% at the AQL and a Rejection Percentage of 95% at the UQL... Sample Size Ac Re UQL IQL AQL ==== == == ====== ====== ====== 32 0 1 8.937% 2.143% 0.160% 125 1 2 3.739% 1.339% 0.285% 200 2 3 3.114% 1.335% 0.410% 315 3 4 2.443% 1.164% 0.435% 500 5 6 2.091% 1.133% 0.524% 800 7 8 1.637% 0.958% 0.499% 1250 10 11 1.353% 0.853% 0.494% 2000 14 15 1.092% 0.733% 0.463% NOTE: Batch input files must have a filename extension of ".INP" and must be formatted EXACTLY as shown below... ------------------------------------------------------------------- filename <-- DOS filename for the AIQ-QLV output .OUT file 100 <-- first n = sample size 1 <-- first ac = accept number 0.95 <-- first 1-alpha = probability content <-- blank line 30000 <-- second n \ Repeat these three types of rows for 300 <-- second ac | each subsequent set of parameters, & 0.95 <-- second 1-alpha / separate triplets with blank rows. n <-- LAST LINE: the letter N ==> no more data NOTE: The next-to-last line is NOT blank. Invoking AIU-QLV... ==================== Enter the following command at your DOS prompt... DOSprompt> aiu-qlv AIU-QLV will then prompt you to choose between K = keyboard and B = batch-data-file entry. Press the K key to use your keyboard console to respond to AIU-QLV's remaining prompts for input. Each prompt displays a [default] value that you may accept simply by pressing the ENTER (or RETURN) key. Otherwise, type in the numerical value or character string you wish, and then press ENTER. If you choose batch input by pressing the B key, AIU-QLV will prompt you to type in a filename (of at most 8 characters) for an .INP file you have previously created with your favorite ASCII/text editor. Don't type the period (.) or the filename extenstion (INP); press ENTER to start AIU-QLV calculations. This batch input option allows you to queue up, say, an entire series of calculations to be performed while you are off doing something else! AIU-QLV.EXE, ver.9308 . . . . . . . . . . . . . . . . . . Page 4 The AIU-QLV Output File: filename.OUT ====================================== The Output file from AIU-QLV saves all information that is displayed on your computer screen as AIU-QLV executes. Thus you usually do not need to take any handwitten notes as AIU-QLV executes. Instead, you can review the AIU-QLV output file on your computer screen by entering the command: DOSprompt> type filename.out | more or you can get a paper copy of the AIU-QLV output file by entering the command: DOSprompt> print filename.out The output file will echo all Parameter Settings specified by the user... Sample Size: n = 10 Accept Number: ac = 0 Reject Number: rj = 1 Yield/Rejection Fraction = 0.950 as well as give a complete listion of AIU-QLV calculation results... Acceptable Percent Nonconforming: 100 * 0 / 10 = 0.000% Rejectable Percent Nonconforming: 100 * 1 / 10 = 10.000% At Yield/Rejection Percentage 95.0%, ...the AQL is 0.512% ...the IQL is 6.697% & ...the UQL is 25.887% Execution The time required to perform AIU-QLV.EXE calculations Time: depends upon the speed of your Personal Computer and ========= upon whether your PC has a numeric math co-processor chip. For example, concluding that UQL=6.00 and AQL=2.99 for 95% Yield/Rejection when the sample size is n=500 and the accept number is ac=21 takes less than 1 second on a 20 Mhz 80386 machine with a numeric math co-processor (80387) but about 2 seconds when there is no math chip. On an IBM PC/XT class machine (4 Mhz 8088), these calculations require about 4 seconds with an 8087 math co-processor but about 23 seconds without that math chip. Source Code... ============== Most of the C-language source code for AIU-QLV is provided in a file named AIU-QLV.CXX. Source code for the betai(a,b,x), betacf(a,b,x), and gammln(xx) functions is not in the archive because those functions are copyrighted works by Press et.al. (1988). Computer readable source AIU-QLV.EXE, ver.9308 . . . . . . . . . . . . . . . . . . Page 5 code for these functions is available on floppy disks [Copyright (c) 1987, Numerical Recipes Software] also distributed by Cambridge University Press. Validation of Numerical Results... ================================== AIU-QLV computations were cross-validated against those from STAGE123, another QA Training Tool (Obenchain, 1989.) For example, consider the following results from AIU-QLV: Acceptable Percent Nonconforming: 100 * 21 / 500 = 4.200% Rejectable Percent Nonconforming: 100 * 22 / 500 = 4.400% At Yield/Rejection Percentage 95.0%, ...the AQL is 2.997% ...the IQL is 4.331% & ...the UQL is 5.992% These results were confirmed, as shown below, using STAGE123: 500 = First Stage Sample Size 21 = First Stage Accept Number 22 = First Stage Reject Number 100.0 = Testing Efficiency % 100.0 = Re-Work Efficiency % In%NConf %Yield Out%NConf 2.98 95.24 2.84 2.99 95.10 2.84 <--- Operating Characteristic = 0.95 3.00 94.96 2.85 at the AQL ... 4.33 50.03 2.17 <--- Operating Characteristic = 0.50 4.34 49.59 2.15 at the IQL ... 5.98 5.11 0.31 5.99 5.02 0.30 <--- Operating Characteristic = 0.05 6.00 4.93 0.30 at the UQL AIU-QLV.EXE, ver.9308 . . . . . . . . . . . . . . . . . . Page 6 REFERENCES American Society for Quality Control Standards Committee (1981). American National Standard: Sampling Procedures and Tables for Inspection by Attributes, ANSI/ASQC Z1.4. American Society for Quality Control, Milwaukee, WI 53203. Department of Defense MIL-STD-105E (1989). Military Standard: Sampling Procedures and Tables for Inspection by Attributes. Washington, D.C. 20301. Comments: Commander, U.S. Army Armament Research, Development and Engineering, ATTN: SMCAR-BAC-S/Bldg6, Picatinny Arsenal, NJ 07806-5000. Johnson, N.L. and Kotz, S. (1969). Distributions in Statistics: Discrete Distributions. [Chapter 3: Binomial Distribution.] New York: John Wiley and Sons. Obenchain, R.L. (1988). Stage123.EXE: a C-language software system for evaluation of one-, two-, and three-stage sampling plans. A Quality Assurance Training Tool from the Statistics Committee of the QC Section of the Pharmaceutical Manufacturing Association. Press, W.H., Flannery, B.P., Teukolsky, S.A. and Vetterling, W.T. (1988). Numerical Recipes in C: The Art of Scientific Computing. [Chapter 6: Special Functions.] Cambridge: Cambridge University Press.