diff options
Diffstat (limited to '291/CH5/EX5.1b/eg5_1b.sce')
-rwxr-xr-x | 291/CH5/EX5.1b/eg5_1b.sce | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/291/CH5/EX5.1b/eg5_1b.sce b/291/CH5/EX5.1b/eg5_1b.sce new file mode 100755 index 000000000..61ed1264a --- /dev/null +++ b/291/CH5/EX5.1b/eg5_1b.sce @@ -0,0 +1,9 @@ +function result= binomial(n, k, p)
+ result = factorial(n)*(p^k)*((1-p)^(n-k))/(factorial(k)*factorial(n-k))
+endfunction
+
+children = 4;
+reqdblueyes = 2;
+probblueeyes = 0.5*0.5;
+prob = binomial(children, reqdblueyes, probblueeyes);
+disp(prob, "The reqd probability is")
\ No newline at end of file |