summaryrefslogtreecommitdiff
path: root/1553/CH31/EX31.4/31Ex4.sce
diff options
context:
space:
mode:
Diffstat (limited to '1553/CH31/EX31.4/31Ex4.sce')
-rw-r--r--1553/CH31/EX31.4/31Ex4.sce11
1 files changed, 11 insertions, 0 deletions
diff --git a/1553/CH31/EX31.4/31Ex4.sce b/1553/CH31/EX31.4/31Ex4.sce
new file mode 100644
index 000000000..7c46ad158
--- /dev/null
+++ b/1553/CH31/EX31.4/31Ex4.sce
@@ -0,0 +1,11 @@
+//chapter 31 Ex 4
+
+clc;
+clear;
+close;
+
+E={'(2,6)','(3,5)','(3,6)','(4,4)','(4,5)','(4,6)','(5,3)','(5,4)','(5,5)','(5,6)','(6,2)','(6,3)','(6,4)','(6,5)','(6,6)'};
+sizeS=6*6; //rolling 2 dice
+sizeE=size(E,"c");
+prob=sizeE/sizeS;
+printf("The probability of getting total more than 7 is %0.3f",prob);