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 / ochy9309.txt < prev    next >
Text File  |  1997-09-22  |  12KB  |  246 lines

  1.  
  2.        Given a "Sample Size" and an "Accept Number" for nonconformances in
  3.        single-stage random sampling without replacement from a Lot (batch,
  4.        population) of specified, finite size, OCHypg.EXE computes points on
  5.        the "Operating Characteristic" (OC) curve.  The OC curve gives the
  6.        Probability of Lot Acceptance as a function of the Fraction Defective
  7.        in the Lot.  This is a straight-forward application for the so-called
  8.        "hypergeometric" distribution, Johnson and Kotz(1969), Chapter 6.
  9.  
  10.        OC curves for standard sampling plans, such as those in MIL-STD-105E
  11.        (1989) and ANSI/ASQC Z1.4 (1981), are frequently evaluated using
  12.        "binomial" distribution methods, as if the lot size were infinite.
  13.        [Monte-Carlo methods are typically combined with a binomial model to
  14.        simulate the effect on the OC curve of switching rules between
  15.        Reduced, Normal, and Tightened inspection levels.]  On the other hand,
  16.        the single-stage, Zero Acceptance Number (c=0) sampling plans of
  17.        Squeglia(1986) are based upon exact hypergeometric calculations for
  18.        finite lot sizes.
  19.  
  20.        By convention, OC curves for a sampling plan always give the
  21.        probability that a lot will be found to be acceptable as a function of
  22.        the true (unknown) nonconformance rate, p, incoming for inspection.
  23.        But, when sampling from a finite population of size N, the only
  24.        possible values for p are integer multiples of 1/N.  In other words,
  25.        the OC curve for finite population sampling is defined only at p =
  26.        k/N, where k is an integer in the range 0 <= k <= N.
  27.  
  28.        The probability of lot acceptance will be monotone, strictly
  29.        decreasing as k increases as long as the Accept Number = c is less
  30.        than the Sample Size = n.  (The implicit Reject Number in single-stage
  31.        sampling is r = c + 1.)  The OC curve starts out at 1 for p=0
  32.        (left-hand extreme) and ends at 0 for p=1 (right-hand extreme) in
  33.        these c < n cases.
  34.  
  35.        The Acceptable Quality Level (AQL) fraction is then the right-most
  36.        p=k/N value such that the OC curve lies above the desired Yield
  37.        fraction (usually 0.95 or .99) everywhere to its left.  And the Lot
  38.        Tolerance Percent Defective (LTPD) fraction is the left-most p=k/N
  39.          OCHypg.EXE, version 9309 ............................. Page 2 of 5
  40.  
  41.  
  42.  
  43.        value such that the OC curve lies below the desired 1-Yield fraction
  44.        (usually 0.10 or 0.05) everywhere to its right.
  45.  
  46.  
  47.        OCHypg Prompts and Parameter Limits...            MIN              MAX
  48.        ======================================
  49.  
  50.        What is the Population Size ? [N] :                 2        2,000,000
  51.  
  52.        What is the Sample Size ? [n] :                     1              N-1
  53.  
  54.        What is the Accept Number ? [c] :                   0              n-1
  55.        Implied Reject Number: r = c + 1                    1                n
  56.  
  57.        True Fraction Nonconforming ?                     0.0              1.0
  58.  
  59.        However, calculations need only be performed when
  60.        the implied number of nonconforming items is...     1              N-1
  61.  
  62.  
  63.        Example Batch Input Files...
  64.        ============================
  65.  
  66.        OCHYPG21.INP ...Batch Input Files for either 21 or 51 equally spaced
  67.        OCHYPG51.INP    values (every 5% or every 2%) of Fraction Defective
  68.                        Incoming for Inspection.
  69.  
  70.        NOTE: Batch input files must have a filename extension of ".INP" and
  71.              must be formatted EXACTLY as shown below...
  72.        -------------------------------------------------------------------
  73.  
  74.        filename    <-- DOS filename for the OCHypg output .OUT file
  75.        10000       <-- first N       = population size
  76.        20          <-- first n       = sample size
  77.        0           <-- first c       = accept number
  78.        0.05        <-- first fraction defective               \  note that
  79.        y           <-- the character "y" or else a blank line /  these lines
  80.        0.10        <-- second fraction defective              \  always come
  81.        y           <-- the character "y" or else a blank line /  in pairs...
  82.        0.15        <-- third fraction defective               \
  83.        y           <-- the character "y" or else a blank line /
  84.          ...etc
  85.        0.95        <-- last fraction defective               \
  86.        n           <-- the character "n"                     /
  87.        y           <-- the character "y" or else a blank line ...NEXT N,n,c
  88.        10000       <-- second N      = population size
  89.        125         <-- second n      = sample size
  90.        10          <-- second c      = accept number
  91.        0.05        <-- first fraction defective               \  note that
  92.        y           <-- the character "y" or else a blank line /  these lines
  93.        0.10        <-- second fraction defective              \  always come
  94.        y           <-- the character "y" or else a blank line /  in pairs...
  95.        0.15        <-- third fraction defective               \
  96.          OCHypg.EXE, version 9309 ............................. Page 3 of 5
  97.  
  98.  
  99.  
  100.        y           <-- the character "y" or else a blank line /
  101.          ...etc
  102.        0.95        <-- last fraction defective               \
  103.        n           <-- the character "n"                     /
  104.        n           <-- the character "n" ...No more N,n,c values
  105.  
  106.        Invoking OCHypg...
  107.        ====================
  108.        Enter the following command at your DOS prompt...
  109.  
  110.                                 DOSprompt>    ochypg
  111.  
  112.        OCHypg will then prompt you to choose between K = keyboard and B =
  113.        batch-data-file entry.  Press the K key to use your keyboard console to
  114.        respond to OCHypg's remaining prompts for input.  Each prompt displays
  115.        a [default] value that you may accept simply by pressing the ENTER (or
  116.        RETURN) key.  Otherwise, type in the numerical value or character string
  117.        you wish, and then press ENTER.
  118.  
  119.        If you choose batch input by pressing the B key, OCHypg will prompt
  120.        you to type in a filename (of at most 8 characters) for an .INP file you
  121.        have previously created with your favorite ASCII/text editor.  Don't
  122.        type the period (.) or the filename extenstion (INP); press ENTER to
  123.        start OCHypg calculations.  This batch input option allows you to
  124.        queue up, say, an entire series of calculations to be performed while
  125.        you are off doing something else!
  126.  
  127.  
  128.        The OCHypg Output File: filename.CSV
  129.        ======================================
  130.        The OCHypg output file saves the information that is displayed on your
  131.        computer screen in a Comma Separated Values (.CSV) format file.  Thus
  132.        you usually do not need to take any handwitten notes as OCHypg
  133.        executes.  These files are ideal for data import into Microsoft Excel
  134.        so that you may plot/print the Operating Characteristic Curve.
  135.  
  136.        You can also review the OCHypg output file on your computer screen by
  137.        entering the command:
  138.  
  139.                      DOSprompt>   type filename.csv | more
  140.  
  141.        or you can get a paper copy of the OCHypg output file by entering the
  142.        command:
  143.                      DOSprompt>   print filename.csv
  144.  
  145.        The output file will echo all Parameter Settings specified by the user
  146.        (or the batch input file) as well as give a complete listion of OCHypg
  147.        calculation results...
  148.  
  149.              Population Size,N = 3200,,
  150.              Sample Size,n = 18,,
  151.              Acceptance Number,c = 0,,
  152.          OCHypg.EXE, version 9309 ............................. Page 4 of 5
  153.  
  154.  
  155.  
  156.              Fraction Nonconforming, Probability of Acceptance, Nonconforms,Population
  157.              0.10000,0.14930,320,3200
  158.              0.12000,0.09951,384,3200
  159.              0.11000,0.12202,352,3200
  160.              0.00094,0.98321,3,3200
  161.              0.00063,0.98878,2,3200
  162.              0.00031,0.99438,1,3200
  163.  
  164.              Population Size,N = 3200,,
  165.              Sample Size,n = 125,,
  166.              Acceptance Number,c = 10,,
  167.  
  168.              Fraction Nonconforming, Probability of Acceptance,Nonconforms,Population
  169.              0.10000,0.27966,320,3200
  170.              0.12000,0.09882,384,3200
  171.              0.11000,0.17224,352,3200
  172.              0.05000,0.95423,160,3200
  173.              0.04000,0.98967,128,3200
  174.              0.03000,0.99892,96,3200
  175.  
  176.        When the lot size is 3200, the above calculations illustrate Figure
  177.        1.2, page 6, of Squeglia(1986).  Namely, the two plans (n=125, c=10)
  178.        and (n=18,c=0) have comparable 10% LTPD's of approximately p=0.12.  On
  179.        the other hand, (n=125, c=10) has a 99% AQL of approximately p=0.04
  180.        while that of (n=18,c=0) is only p=0.00031 (1 in 3200.)
  181.  
  182.  
  183.        Execution   The time required to perform OCHypg.EXE calculations
  184.        Time:       depends upon the speed of your Personal Computer and
  185.        =========   upon whether your PC has a numeric math co-processor chip.
  186.                    On a slow machine, a numeric math co-processor can speed
  187.                    calculations by a factor of 10.
  188.  
  189.        Source Code...
  190.        ==============
  191.        The C-language source code for OCHypg is provided in the file named
  192.        OCHypg.C.
  193.  
  194.  
  195.        Validation of Numerical Results...
  196.        ==================================
  197.        OCHypg computations were cross-validated against those from the SAS/PC
  198.        PROBHYPR( N, X, n, x ) function.
  199.  
  200.  
  201.                                       REFERENCES
  202.  
  203.        American Society for Quality Control Standards Committee (1981).
  204.                American National Standard: Sampling Procedures and Tables for
  205.                Inspection by Attributes, ANSI/ASQC Z1.4.  American Society for
  206.                Quality Control, Milwaukee, WI 53203.
  207.          OCHypg.EXE, version 9309 ............................. Page 5 of 5
  208.  
  209.  
  210.  
  211.        Department of Defense MIL-STD-105E (1989).  Military Standard: Sampling
  212.                Procedures and Tables for Inspection by Attributes.  Washington,
  213.                D.C. 20301.  Comments: Commander, U.S. Army Armament Research,
  214.                Development and Engineering, ATTN: SMCAR-BAC-S/Bldg6, Picatinny
  215.                Arsenal, NJ 07806-5000.
  216.  
  217.        Johnson, N.L. and Kotz, S. (1969).  Distributions in Statistics:
  218.                Discrete Distributions.  (Chapter 6: Hypergeometric
  219.                Distribution.)  New York: John Wiley and Sons.
  220.  
  221.        Lieberman, G.J. and Owen, D.B. (1961).  Tables of the Hypergeometric
  222.                Probability Distribution.  Stanford: Stanford University Press.
  223.  
  224.        Obenchain, R.L. (1990).  "AQL-LTPD.EXE: a C-language software
  225.                system for calculation of Acceptable Quality Levels (AQLs)
  226.                and Lot Tolerance Percent Defectives (LTPDs) for single-
  227.                stage sampling plans."  A Quality Assurance Training Tool from
  228.                the Statistics Committee of the QC Section of the
  229.                Pharmaceutical Manufacturing Association.
  230.  
  231.        SAS/PC (Release 6.04) Function: PROBHYPR( N, X, n, x ).  SAS Institute
  232.                Inc.; SAS Circle; Cary, North Carolina 27512-8000.
  233.  
  234.        Squeglia, N.L.  (1965).  "Sampling Plans for Zero Defects."
  235.                Quality Assurance 4, 28.
  236.  
  237.        Squeglia, N.L.  (1986).  Zero Acceptance Number C=0 Sampling
  238.                Plans, 3rd Edition.  American Society for Quality Control.
  239.                Milwaukee, Wisconsin.
  240.  
  241.        OCHypg Software Update History:
  242.        ===============================
  243.  
  244.        Version 9308 ...Beta Test Version
  245.        Version 9309 ...Convert output file to .CSV format; port to Macintosh
  246.