summaryrefslogtreecommitdiff
path: root/291/CH13/EX13.4a/eg13_4a.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /291/CH13/EX13.4a/eg13_4a.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '291/CH13/EX13.4a/eg13_4a.sce')
-rwxr-xr-x291/CH13/EX13.4a/eg13_4a.sce26
1 files changed, 26 insertions, 0 deletions
diff --git a/291/CH13/EX13.4a/eg13_4a.sce b/291/CH13/EX13.4a/eg13_4a.sce
new file mode 100755
index 000000000..492c9c724
--- /dev/null
+++ b/291/CH13/EX13.4a/eg13_4a.sce
@@ -0,0 +1,26 @@
+defect = [6 5 3 0 1 2 1 0 2 1 1 3 2 0 1 1 0 2 1 2];
+F = [0.12 0.10 0.06 0.00 0.02 0.04 0.02 0.00 0.04 0.02 0.02 0.06 0.04 0.00 .02 0.02 0.00 0.04 0.02 0.04];
+total = 1000;
+Fbar = sum(defect)/total;
+n=50;
+val = sqrt(Fbar*(1-Fbar)/n);
+lcl = Fbar - (3*val);
+ucl = Fbar + (3*val);
+disp(lcl,"LCL is" );
+disp(ucl, "UCL is");
+for i= 1:20
+ if( F(i)>ucl | F(i)<lcl)
+ totald=sum(defect)-defect(i);
+ //total = total -50;
+ end
+end
+//disp(totald);
+total = total - 50;
+Fbar = totald/total;
+val = sqrt(Fbar*(1-Fbar)/n);
+//disp(Fbar);
+disp("After recomputation");
+lcl = Fbar - (3*val);
+ucl = Fbar + (3*val);
+disp(lcl,"LCL is" );
+disp(ucl, "UCL is"); \ No newline at end of file