From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 1475/CH2/EX2.15/Example_2_15.sce | 19 +++++++++++++++++++ 1475/CH2/EX2.15/Output_2_15.PNG | Bin 0 -> 10894 bytes 2 files changed, 19 insertions(+) create mode 100755 1475/CH2/EX2.15/Example_2_15.sce create mode 100755 1475/CH2/EX2.15/Output_2_15.PNG (limited to '1475/CH2/EX2.15') diff --git a/1475/CH2/EX2.15/Example_2_15.sce b/1475/CH2/EX2.15/Example_2_15.sce new file mode 100755 index 000000000..d4f84ca14 --- /dev/null +++ b/1475/CH2/EX2.15/Example_2_15.sce @@ -0,0 +1,19 @@ +// Example 2.15 A random variable x follow Poisson distribution +clc; +clear; +m=3; +disp(m,"Parameter ="); +function value = poisson(m, x) +value = (exp(-m)*(m^x))/(factorial(x)); +endfunction +X_0=poisson(m,0); +X_1=poisson(m,1); +X_2=poisson(m,2); +X_3=poisson(m,3); + +disp(X_0,"Probability when x=0 is "); +disp(X_1,"Probability when x=1 is "); +disp(X_2,"Probability when x=2 is "); +disp(X_3,"Probability when x=3 is "); +disp(X_0+X_1+X_2,"Probability when the variable assumes the value less than 3 is "); +disp(1-(X_0+X_1),"Probability when the variable assumes the value at least 2 is "); diff --git a/1475/CH2/EX2.15/Output_2_15.PNG b/1475/CH2/EX2.15/Output_2_15.PNG new file mode 100755 index 000000000..88dd40f5d Binary files /dev/null and b/1475/CH2/EX2.15/Output_2_15.PNG differ -- cgit