diff options
Diffstat (limited to '1553/CH31/EX31.5/31Ex5.sce')
-rw-r--r-- | 1553/CH31/EX31.5/31Ex5.sce | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/1553/CH31/EX31.5/31Ex5.sce b/1553/CH31/EX31.5/31Ex5.sce new file mode 100644 index 000000000..eae78e476 --- /dev/null +++ b/1553/CH31/EX31.5/31Ex5.sce @@ -0,0 +1,11 @@ +//chapter 31 Ex 5
+
+clc;
+clear;
+close;
+totalBalls=10; white=6; Black=4; random=2;
+
+sizeS= factorial(totalBalls)/(factorial(totalBalls-random)*factorial(random));
+sizeE=(factorial(white)/(factorial(white-random)*factorial(random)))+(factorial(Black)/(factorial(Black-random)*factorial(random)));
+prob=sizeE/sizeS;
+printf("The probability of getting both balls of same color is %0.2f",prob);
|