summaryrefslogtreecommitdiff
path: root/1553/CH31/EX31.2/31Ex2.sce
diff options
context:
space:
mode:
Diffstat (limited to '1553/CH31/EX31.2/31Ex2.sce')
-rw-r--r--1553/CH31/EX31.2/31Ex2.sce10
1 files changed, 10 insertions, 0 deletions
diff --git a/1553/CH31/EX31.2/31Ex2.sce b/1553/CH31/EX31.2/31Ex2.sce
new file mode 100644
index 000000000..786b67486
--- /dev/null
+++ b/1553/CH31/EX31.2/31Ex2.sce
@@ -0,0 +1,10 @@
+//chapter 24 Ex 2
+
+clc;
+clear;
+close;
+S={'HH','HT','TH','TT'};
+E={'TT','HT','TH'};
+sizeS=size(S,"c"); sizeE=size(E,"c");
+prob=sizeE/sizeS;
+printf("The probability of getting at most one head is %0.2f",prob);