summaryrefslogtreecommitdiff
path: root/291/CH7/EX7.5c/eg7_5c.sce
diff options
context:
space:
mode:
Diffstat (limited to '291/CH7/EX7.5c/eg7_5c.sce')
-rwxr-xr-x291/CH7/EX7.5c/eg7_5c.sce14
1 files changed, 14 insertions, 0 deletions
diff --git a/291/CH7/EX7.5c/eg7_5c.sce b/291/CH7/EX7.5c/eg7_5c.sce
new file mode 100755
index 000000000..dd3baee47
--- /dev/null
+++ b/291/CH7/EX7.5c/eg7_5c.sce
@@ -0,0 +1,14 @@
+initialsample = 30;
+acceptable= 26;
+phat = acceptable/initialsample;
+error = 0.05/2;
+zalpha = 2.58;
+
+samplesize = (error/zalpha)^2/(phat*(1-phat));
+finalsize = ceil(1/samplesize);
+acceptablenew= 1040 + acceptable;
+phat = acceptablenew/finalsize;
+lowerlim = phat - (zalpha*sqrt(phat*(1-phat)/finalsize));
+upperlim = phat + (zalpha*sqrt(phat*(1-phat)/finalsize));
+disp(upperlim, "to ",lowerlim,"The 99% confidence interval is " )
+