home *** CD-ROM | disk | FTP | other *** search
/ Explore the World of Soft…e: Engineering & Science / Explore_the_World_of_Software_Engineering_and_Science_HRS_Software_1998.iso / programs / statistc / aiuq9308.exe / AIU-QLV.DOC < prev    next >
Text File  |  1993-08-01  |  15KB  |  309 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.               ┌──────────────────────────────────────────────────────┐
  7.               │      Acceptable Quality Level (AQL),                 │
  8.               │    Indifference Quality Level (IQL) and              │
  9.               │    Unacceptable Quality Level (UQL) Calculations     │
  10.               │     for Single-Stage Binomial (Type B) Sampling      │
  11.               │                                                      │
  12.               │             AIU-QLV.EXE....Version 9308              │
  13.               ├──────────────────────────────────────────────────────┤
  14.               │          A Quality Assurance Training Tool:          │
  15.               │  Statistics Committee of the QA Section of the PMA   │
  16.               │                                                      │
  17.               │      Bob Obenchain, CompuServe User [72007,467]      │
  18.               └──────────────────────────────────────────────────────┘
  19.                    PMA = Pharmaceutical Manufacturers Association
  20.                    
  21.  
  22.        Given an "accept number" for nonconformances in single-stage random
  23.        sampling from a large population, AIU-QLV computes the Acceptable
  24.        Quality Level (AQL), the Indifference Quality Level (IQL), and the
  25.        Unacceptable Quality Level (UQL) [also called the Limiting Tolerance
  26.        Percent Defective (LTPD)] associated with a stated Yield/Reject
  27.        Percentage from 50% to 99%.
  28.  
  29.        The sampling theory is based upon the Binomial distribution (Type B);
  30.        samples are viewed as resulting from a series of "n" stochastically
  31.        independent "Bernoulli Trials" ...where the probability of observing a
  32.        single nonconformance in each such trial is "p", and 0 <= p <= 1.  The
  33.        probability of getting exactly "x" nonconformances in n trials is
  34.        thus...
  35.  
  36.               Pr( x, n ) = ( n choose x ) times p**x times (1-p)**(n-x)
  37.  
  38.        where ( n choose x ) denotes the binomial coefficient defined to be n!
  39.                             divided by the product of x! times (n-x)!, n and x
  40.                             are integers such that 0 <= x <= n, zero factorial
  41.                             equals 1, and n! = n * (n-1) * (n-2) * ... * 1 when
  42.                             n >= 1,
  43.  
  44.                   p**x      denotes p raised to the power x,
  45.  
  46.               (1-p)**(n-x)  denotes (1-p) raised to the power (n-x),
  47.  
  48.                     n   =   Sample Size,
  49.  
  50.        and          x   =   Number on Nonconformances Observed.
  51.  
  52.        One's random sample may have been taken "with replacement," but the
  53.        probability of any one unit being sampled two or more times is zero
  54.        because the population size is assumed to be infinite (or, at least,
  55.        very large in size.)
  56.           AIU-QLV.EXE, ver.9308 . . . . . . . . . . . . . . . . . . Page 2
  57.  
  58.  
  59.  
  60.        DEFINITIONS:
  61.        ============
  62.        The AQL fraction defective is the largest value of nonconformance
  63.        rate, p, for which expected Yield is at least the stated Yield
  64.        Percentage (usually 95%.)  Equivalently, if the true nonconformance
  65.        rate does not exceed the AQL, then the probability of rejection
  66.        [observing x > ac nonconformances in a sample of size n] must not be
  67.        more than a stated "alpha" level (usually .05.)
  68.  
  69.        The IQL fraction defective is the value of nonconformance rate, p, for
  70.        which expected Yield is 50%.
  71.  
  72.        The UQL or LTPD fraction defective is the smallest value of
  73.        nonconformance rate, p, for which the expected Rejection Rate is at
  74.        least the stated Rejection Percentage (usually 90%.)  Equivalently, if
  75.        the true nonconformance rate exceeds the UQL or LTPD, then the
  76.        probability of acceptance [observing x <= ac nonconformances in a
  77.        sample of size n] must not be more than a stated "alpha" level
  78.        (usually .10.)
  79.  
  80.        The "Operating Characteristic" (OC) curve for a sampling plan gives the
  81.        probability that a batch of product will be found to be acceptable as a
  82.        function of the true (unknown) nonconformance rate, p.  The OC curve
  83.        usually starts out at 1 for p=0 (left-hand extreme) and is monotone
  84.        non-increasing in p, ending up at 0 for p=1 (right-hand extreme.)  The
  85.        AQL fraction is then the right-most p-value such that the OC curve lies
  86.        above the desired Yield fraction (usually 0.95) everywhere to its left.
  87.        And the UQL fraction is the left-most p-value such that the OC curve
  88.        lies below the desired 1 - Yield fraction (usually 0.10) everywhere to
  89.        its right.
  90.  
  91.  
  92.        AIU-QLV Prompts and Parameter Limits...             MIN           MAX
  93.        ========================================
  94.  
  95.        What is the Sample Size ? [n] :                       2    2,147,483,648
  96.  
  97.        What is the Accept Number ? [ac] :                    0         n - 1
  98.  
  99.                    Reject Number: rj = ac + 1                1             n
  100.  
  101.        Probability Content of Upper Bound ? [1-alpha] :   0.50          0.99
  102.  
  103.  
  104.        Example Batch Input File...
  105.        ===========================
  106.  
  107.        AIU-QLV.INP ...Batch Input File for the sampling plans in the AQL=0.40
  108.                       (normal inspection) column of Table II-A of Mil-Std-105E
  109.                       or, equivalently, ANSI/ASQC Z1.4.  Calculations show that
  110.                       the implied AQLs are not as close to their intended
  111.                       "target" value of 0.400% as one might hope, but we are
  112.                       using normal/reduced/tightened switching rules here...
  113.           AIU-QLV.EXE, ver.9308 . . . . . . . . . . . . . . . . . . Page 3
  114.  
  115.  
  116.  
  117.        All of the following AIU-QLV calculations are for a Yield Percentage of
  118.        95.0% at the AQL and a Rejection Percentage of 95% at the UQL...
  119.  
  120.                     Sample
  121.                      Size    Ac    Re       UQL        IQL       AQL
  122.                      ====    ==    ==     ======     ======    ======
  123.                        32     0     1     8.937%     2.143%    0.160%
  124.                       125     1     2     3.739%     1.339%    0.285%
  125.                       200     2     3     3.114%     1.335%    0.410%
  126.                       315     3     4     2.443%     1.164%    0.435%
  127.                       500     5     6     2.091%     1.133%    0.524%
  128.                       800     7     8     1.637%     0.958%    0.499%
  129.                      1250    10    11     1.353%     0.853%    0.494%
  130.                      2000    14    15     1.092%     0.733%    0.463%
  131.  
  132.        NOTE: Batch input files must have a filename extension of ".INP" and
  133.              must be formatted EXACTLY as shown below...
  134.        -------------------------------------------------------------------
  135.  
  136.        filename    <-- DOS filename for the AIQ-QLV output .OUT file
  137.        100         <-- first n       = sample size
  138.        1           <-- first ac      = accept number
  139.        0.95        <-- first 1-alpha = probability content
  140.                    <-- blank line
  141.        30000       <-- second n       \   Repeat these three types of rows for
  142.        300         <-- second ac       |  each subsequent set of parameters, &
  143.        0.95        <-- second 1-alpha /   separate triplets with blank rows.
  144.        n           <-- LAST LINE: the letter N ==> no more data
  145.                             NOTE: The next-to-last line is NOT blank.
  146.  
  147.  
  148.        Invoking AIU-QLV...
  149.        ====================
  150.        Enter the following command at your DOS prompt...
  151.  
  152.                      DOSprompt>    aiu-qlv
  153.  
  154.        AIU-QLV will then prompt you to choose between K = keyboard and B =
  155.        batch-data-file entry.  Press the K key to use your keyboard console to
  156.        respond to AIU-QLV's remaining prompts for input.  Each prompt displays
  157.        a [default] value that you may accept simply by pressing the ENTER (or
  158.        RETURN) key.  Otherwise, type in the numerical value or character string
  159.        you wish, and then press ENTER.
  160.  
  161.        If you choose batch input by pressing the B key, AIU-QLV will prompt
  162.        you to type in a filename (of at most 8 characters) for an .INP file you
  163.        have previously created with your favorite ASCII/text editor.  Don't
  164.        type the period (.) or the filename extenstion (INP); press ENTER to
  165.        start AIU-QLV calculations.  This batch input option allows you to
  166.        queue up, say, an entire series of calculations to be performed while
  167.        you are off doing something else!
  168.           AIU-QLV.EXE, ver.9308 . . . . . . . . . . . . . . . . . . Page 4
  169.  
  170.  
  171.  
  172.        The AIU-QLV Output File: filename.OUT
  173.        ======================================
  174.        The Output file from AIU-QLV saves all information that is displayed on
  175.        your computer screen as AIU-QLV executes.  Thus you usually do not need
  176.        to take any handwitten notes as AIU-QLV executes.  Instead, you can
  177.        review the AIU-QLV output file on your computer screen by entering the
  178.        command:
  179.  
  180.                      DOSprompt>   type filename.out | more
  181.  
  182.        or you can get a paper copy of the AIU-QLV output file by entering the
  183.        command:
  184.  
  185.                      DOSprompt>   print filename.out
  186.  
  187.        The output file will echo all Parameter Settings specified by the
  188.        user...
  189.                   Sample Size: n =     10
  190.                   Accept Number: ac =      0
  191.                   Reject Number: rj =      1
  192.                   Yield/Rejection Fraction = 0.950
  193.  
  194.        as well as give a complete listion of AIU-QLV calculation results...
  195.  
  196.                   Acceptable Percent Nonconforming: 100 * 0 / 10 =   0.000%
  197.                   Rejectable Percent Nonconforming: 100 * 1 / 10 =  10.000%
  198.  
  199.                   At Yield/Rejection Percentage  95.0%,
  200.                      ...the AQL is   0.512%
  201.                      ...the IQL is   6.697%
  202.                   &  ...the UQL is  25.887%
  203.  
  204.  
  205.  
  206.        Execution   The time required to perform AIU-QLV.EXE calculations
  207.        Time:       depends upon the speed of your Personal Computer and
  208.        =========   upon whether your PC has a numeric math co-processor chip.
  209.                    For example, concluding that UQL=6.00 and AQL=2.99 for
  210.                    95% Yield/Rejection when the sample size is n=500 and the
  211.                    accept number is ac=21 takes less than 1 second on a 20
  212.                    Mhz 80386 machine with a numeric math co-processor (80387)
  213.                    but about 2 seconds when there is no math chip.  On an IBM
  214.                    PC/XT class machine (4 Mhz 8088), these calculations
  215.                    require about 4 seconds with an 8087 math co-processor but
  216.                    about 23 seconds without that math chip.
  217.  
  218.  
  219.        Source Code...
  220.        ==============
  221.        Most of the C-language source code for AIU-QLV is provided in a file
  222.        named AIU-QLV.CXX.  Source code for the betai(a,b,x), betacf(a,b,x),
  223.        and gammln(xx) functions is not in the archive because those functions
  224.        are copyrighted works by Press et.al. (1988).  Computer readable source
  225.           AIU-QLV.EXE, ver.9308 . . . . . . . . . . . . . . . . . . Page 5
  226.  
  227.  
  228.  
  229.        code for these functions is available on floppy disks [Copyright (c)
  230.        1987, Numerical Recipes Software] also distributed by Cambridge
  231.        University Press.
  232.  
  233.  
  234.        Validation of Numerical Results...
  235.        ==================================
  236.        AIU-QLV computations were cross-validated against those from
  237.        STAGE123, another QA Training Tool (Obenchain, 1989.)  For example,
  238.        consider the following results from AIU-QLV:
  239.  
  240.            Acceptable Percent Nonconforming: 100 * 21 / 500 =   4.200%
  241.            Rejectable Percent Nonconforming: 100 * 22 / 500 =   4.400%
  242.  
  243.            At Yield/Rejection Percentage  95.0%,
  244.               ...the AQL is   2.997%
  245.               ...the IQL is   4.331%
  246.            &  ...the UQL is   5.992%
  247.  
  248.        These results were confirmed, as shown below, using STAGE123:
  249.  
  250.             500 = First Stage Sample Size
  251.              21 = First Stage Accept Number
  252.              22 = First Stage Reject Number
  253.             100.0 = Testing Efficiency %
  254.             100.0 = Re-Work Efficiency %
  255.  
  256.            In%NConf %Yield Out%NConf
  257.  
  258.               2.98  95.24   2.84
  259.  
  260.               2.99  95.10   2.84
  261.                                  <--- Operating Characteristic = 0.95
  262.               3.00  94.96   2.85                at the AQL
  263.  
  264.               ...
  265.  
  266.               4.33  50.03   2.17
  267.                                  <--- Operating Characteristic = 0.50
  268.               4.34  49.59   2.15                at the IQL
  269.  
  270.               ...
  271.  
  272.               5.98   5.11   0.31
  273.  
  274.               5.99   5.02   0.30
  275.                                  <--- Operating Characteristic = 0.05
  276.               6.00   4.93   0.30                at the UQL
  277.           AIU-QLV.EXE, ver.9308 . . . . . . . . . . . . . . . . . . Page 6
  278.  
  279.  
  280.  
  281.                                       REFERENCES
  282.  
  283.        American Society for Quality Control Standards Committee (1981).
  284.                American National Standard: Sampling Procedures and Tables for
  285.                Inspection by Attributes, ANSI/ASQC Z1.4.  American Society for
  286.                Quality Control, Milwaukee, WI 53203.
  287.  
  288.        Department of Defense MIL-STD-105E (1989).  Military Standard: Sampling
  289.                Procedures and Tables for Inspection by Attributes.  Washington,
  290.                D.C. 20301.  Comments: Commander, U.S. Army Armament Research,
  291.                Development and Engineering, ATTN: SMCAR-BAC-S/Bldg6, Picatinny
  292.                Arsenal, NJ 07806-5000.
  293.  
  294.        Johnson, N.L. and Kotz, S. (1969).  Distributions in Statistics:
  295.                Discrete Distributions.  [Chapter 3: Binomial Distribution.]
  296.                New York: John Wiley and Sons.
  297.  
  298.        Obenchain, R.L. (1988).  Stage123.EXE: a C-language software
  299.                system for evaluation of one-, two-, and three-stage sampling
  300.                plans.  A Quality Assurance Training Tool from the
  301.                Statistics Committee of the QC Section of the Pharmaceutical
  302.                Manufacturing Association.
  303.  
  304.        Press, W.H., Flannery, B.P., Teukolsky, S.A. and Vetterling, W.T.
  305.                (1988).  Numerical Recipes in C: The Art of Scientific
  306.                Computing.  [Chapter 6: Special Functions.]  Cambridge:
  307.                Cambridge University Press.
  308.  
  309.