summaryrefslogtreecommitdiff
path: root/1553/CH31/EX31.2/31Ex2.sce
blob: 786b67486ecb262e29ee4c9da937247f90a58d9b (plain)
1
2
3
4
5
6
7
8
9
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);