summaryrefslogtreecommitdiff
path: root/3808/CH7/EX7.14/Ex7_14.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3808/CH7/EX7.14/Ex7_14.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3808/CH7/EX7.14/Ex7_14.sce')
-rw-r--r--3808/CH7/EX7.14/Ex7_14.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/3808/CH7/EX7.14/Ex7_14.sce b/3808/CH7/EX7.14/Ex7_14.sce
new file mode 100644
index 000000000..bdd04fa52
--- /dev/null
+++ b/3808/CH7/EX7.14/Ex7_14.sce
@@ -0,0 +1,22 @@
+//Chapter 07: Discrete Probability
+
+clc;
+clear;
+
+tot_out=36 //total no of outcomes when 2 dice are rolled
+X=[2,3,4,5,6,7,8,9,10,11,12] //possible sum of 2 dice
+pX2=1/tot_out //no of possible chances
+pX12=pX2 //no of possible chances
+pX3=2/tot_out //no of possible chances
+pX11=pX3 //no of possible chances
+pX4=3/tot_out //no of possible chances
+pX10=pX4 //no of possible chances
+pX5=4/tot_out //no of possible chances
+pX9=pX5 //no of possible chances
+pX6=5/tot_out //no of possible chances
+pX8=pX6 //no of possible chances
+pX7=6/tot_out //no of possible chances
+
+Ex=X(1)*pX2+X(2)*pX3+X(3)*pX4+X(4)*pX5+X(5)*pX6+X(6)*pX7+X(7)*pX8+X(8)*pX9+X(9)*pX10+X(10)*pX11+X(11)*pX12
+
+disp(Ex,'Ex=')