summaryrefslogtreecommitdiff
path: root/803/CH8/EX8.4/ex8_4.sce
diff options
context:
space:
mode:
Diffstat (limited to '803/CH8/EX8.4/ex8_4.sce')
-rw-r--r--803/CH8/EX8.4/ex8_4.sce18
1 files changed, 18 insertions, 0 deletions
diff --git a/803/CH8/EX8.4/ex8_4.sce b/803/CH8/EX8.4/ex8_4.sce
new file mode 100644
index 000000000..274ea86a4
--- /dev/null
+++ b/803/CH8/EX8.4/ex8_4.sce
@@ -0,0 +1,18 @@
+clc
+b=[0 1 2 3 4 5 6];..........................//breakdown/day
+f=[340 121 53 30 12 4 0];...................//frequency
+Den=sum(f);
+ans=0;
+for i=1:7
+ ans=ans+[f(i) * b(i)];
+end
+Mean=ans/Den;...............................//calculation of expectance
+disp(Mean,"mean");
+
+k=0:1:6;
+y=(exp(-Mean)*(Mean^k)). /factorial(k);
+disp(y);
+plot2d(k,y);......................//Poisson distribution
+title("Poisson Distribution",k,y);
+xlabel("Breakdown/day");
+ylabel("Probability");