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.txt < prev    next >
Text File  |  1997-09-22  |  14KB  |  288 lines

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