For a lot of switch ($N): case "1": echo " 2 to 8 "; break; case "2": echo " 9 to 15 "; break; case "3": echo " 16 to 25"; break; case "4": echo " 26 to 50 "; break; case "5": echo " 51 to 90 "; break; case "6": echo " 91 to 150 "; break; case "7": echo " 151 to 280 "; break; case "8": echo " 281 to 500"; break; case "9": echo " 501 to 1200 "; break; case "10": echo " 1201 to 3200 "; break; case "11": echo " 3201 to 10000 "; break; case "12": echo " 10001 to 35000 "; break; case "13": echo " 35001 to 150000"; break; case "14": echo " 150001 to 500000 "; break; case "15": echo " over 500000 "; endswitch; ?> items, and AQL= switch ($AQL): case "1": echo " 0.01% "; break; case "2": echo " 0.015% "; break; case "3": echo " 0.025%"; break; case "4": echo " 0.04% "; break; case "5": echo " 0.065% "; break; case "6": echo " 0.1% "; break; case "7": echo " 0.15% "; break; case "8": echo " 0.25% "; break; case "9": echo " 0.4% "; break; case "10": echo " 0.65% "; break; case "11": echo " 1% "; break; case "12": echo " 1.5% "; break; case "13": echo " 2.5% "; break; case "14": echo " 4% "; break; case "15": echo " 6.5% "; break; case "16": echo " 10% "; break; case "17": echo " 15% "; break; case "18": echo " 25% "; break; case "19": echo " 40% "; break; case "20": echo " 65% "; break; case "21": echo " 100% "; break; case "22": echo " 150% "; break; case "23": echo " 250% "; break; case "24": echo " 400% "; break; case "25": echo " 650% "; break; case "26": echo " 1000% "; endswitch; ?> , switch ($type): case "1": echo "normal"; break; case "2": echo "tightened"; break; case "3": echo "reduced"; endswitch; ?> inspection plans are:
/* if ( $plan == 1 || $plan == 2 ){ */ if ( $type == 1 ) { include("normal.inc"); $cc = 16 * ($AQL-1); } if ( $type == 2 ) { include("tight.inc"); $cc = 17 * ($AQL-1); } if ( $type == 3 ) { include("reduce.inc"); $cc = 16 * ($AQL-1); } $c1 = $C1[$cc+$code-1]; $r1 = $R1[$cc+$code-1]; $n = $Sample[$code-1]; if ( $c1 < 0 ) { $n = $Sample[-$c1-1]; $c1 = $C1[$cc-$c1-1]; $r1 = $R1[$cc-$r1-1]; } if ($type == 1 || $type == 2){ $r1 = $c1+1; } ?>| The Single sampling procedure is: |
|---|
|
echo "Sample ", $n,"";?>* echo " items. If the number of non-conforming items is "; echo $c1; if ($c1 > 0) { echo " or less"; } echo " --> accept the lot. "; echo $r1," or more --> reject the lot."; $nplot=$n; $cplot=$c1; ?> |
There is no Single sampling plan.
"; break; } } if ( $type == 3 ) { include("dbl_reduce.inc"); $cc = 16 * ($AQL-1); } $n = $Sample[$code-1]; $c1 = $Dbl_C1[$cc+$code-1]; $r1 = $Dbl_R1[$cc+$code-1]; $c3 = $Dbl_C3[$cc+$code-1]; $r3 = $Dbl_R3[$cc+$code-1]; if ( $c1 < 0 ) { $n = $Sample[-$c1-1]; $c1 = $Dbl_C1[$cc-$c1-1]; $r1 = $Dbl_R1[$cc-$r1-1]; $c3 = $Dbl_C3[$cc-$c3-1]; $r3 = $Dbl_R3[$cc-$r3-1]; } if ( strcmp($c1,sg)==0 ){ ?>There is no double sampling plan in this case. Use the single plan.
} else { while ( $c1 < 0 ) { $n = $Sample[-$c1-1]; $c1 = $Dbl_C1[$cc+$code-$c1-1]; $r1 = $Dbl_R1[$cc+$code-$c1-1]; $c3 = $Dbl_C3[$cc+$code-$c1-1]; $r3 = $Dbl_R3[$cc+$code-$c1-1]; } $j=1; if ( strcmp($c1,dn)==0 ){ echo "In this case, consider the Single sampling plan, or use the following plan:
"; while( strcmp($Dbl_C1[$cc+$code-1+$j],dn)==0 || $Dbl_C1[$cc+$code-1+$j]<0){ $j=$j+1; } $n = $Sample[$code-1+$j]; $c1 = $Dbl_C1[$cc+$code-1+$j]; $r1 = $Dbl_R1[$cc+$code-1+$j]; $c3 = $Dbl_C3[$cc+$code-1+$j]; $r3 = $Dbl_R3[$cc+$code-1+$j]; } if ($type == 1 || $type == 2){ $r3 = $c3+1; } $nplot2 = $n; $cplot2 = $c1; $rplot2 = $r1; ?>| The Double sampling procedure is: | |
|---|---|
| Step 1: |
echo "Sample ", $n,"";?>* items. If the number of non-conforming items is echo $c1; if ($c1 > 0) { echo " or less"; } echo " --> accept the lot. "; echo $r1," or more --> reject the lot. Otherwise, continue to step 2."; ?> |
| Step 2: |
echo "Sample ", $n,"";?>* additional items. If the total number of non-conforming items is echo " "; echo $c3," or less --> accept the lot. "; echo $r3," or more --> reject the lot."; ?> |
*Note: If the sample size(s) exceeds the lot size, apply 100% sampling of the lot.
}?>| OC Curve | ASN Curve |
|---|---|
| The OC curve describes the probability of accepting a lot, OC(p), as a function of the proportion non-conforming (p), for the single and double sampling plans described above. | The ASN curve describes the average sample size, when employing the double sampling, as a function of the proportion of non-conforming items (p). |