ASN2 Function

computes the average sample number for a double-sampling plan.

Syntax

ASN2(mode,$a_{1},r_{1},a_{2},n_{1},n_{2},p$)

where

mode

identifies whether sampling is under full inspection (mode is 'FULL') or semicurtailed inspection (mode is 'SEMI').

$a_{1}$

is the acceptance number for the first sample, where $a_{1}\geq 0$.

$r_{1}$

is the rejection number for the first sample, where $r_{1}>a_{1}+1$.

$a_{2}$

is the acceptance number for the second sample, where $a_{2}\geq a_{1}$.

$n_{1}$

is the size of the first sample, where $n_{1}\geq 1$.

$n_{2}$

is the size of the second sample, where $n_{2}\geq 1$.

p

is the proportion of nonconforming items produced by the process, where 0 < p < 1.

Description

The ASN2 function returns the average sample number for a Type B double-sampling plan under full inspection (mode is 'FULL') or semicurtailed inspection (mode is 'SEMI'). For details on Type B double-sampling plans, see Types of Sampling Plans.

For full inspection, the average sample number is

\[  \mbox{ASN}=n_{1}+n_{2}[F(r_{1}-1|n_{1})- F(a_{1}|n_{1})]  \]

and for semicurtailed inspection, the average sample number is

\[  \mbox{ASN}=n_{1}+ \sum _{d=a_{1}+1}^{r_{1}-1} f(d|n_{1}) \left( n_{2}F(a_{2}-d|n_{2}) + \frac{r_{2}-d}{p} [1- F(r_{2}-d|n_{2}+1)] \right)  \]

where

$\displaystyle  f(d|n)  $
$\displaystyle =  $
$\displaystyle  (\stackrel{n}{_ d})p^{d}(1-p)^{n-d}  $
$\displaystyle  $
$\displaystyle =  $
$\displaystyle  \mbox{binomial probability that the number of nonconforming items } $
$\displaystyle  $
$\displaystyle  $
$\displaystyle  \mbox{in a sample of size \Mathtext{n} is exactly \Mathtext{d}}  $
$\displaystyle F(a|n)  $
$\displaystyle =  $
$\displaystyle  \sum _{d=0}^{a}f(d|n)  $
$\displaystyle  $
$\displaystyle =  $
$\displaystyle  \mbox{probability that the number of nonconforming items is less}  $
$\displaystyle  $
$\displaystyle  $
$\displaystyle  \mbox{than or equal to \Mathtext{a}}  $

Examples

The first set of statements results in a value of 15.811418112. The second set of statements results in a value of 14.110408695.

data;
   asn=asn2('full',0,2,1,13,13,0.18);
   put asn;
run;

data;
   asn=asn2('semi',0,2,1,13,13,0.18);
   put asn;
run;