diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3808/CH7/EX7.5/Ex7_5.sce | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '3808/CH7/EX7.5/Ex7_5.sce')
-rw-r--r-- | 3808/CH7/EX7.5/Ex7_5.sce | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/3808/CH7/EX7.5/Ex7_5.sce b/3808/CH7/EX7.5/Ex7_5.sce new file mode 100644 index 000000000..0e73ebb24 --- /dev/null +++ b/3808/CH7/EX7.5/Ex7_5.sce @@ -0,0 +1,22 @@ +//Chapter 07: Discrete Probability + +clc; +clear; + +total_balls=50 //total no of balls in bin +pr=1 +//Part-(A) Sampling without replacement +given_no=5 //11 4 17 39 23 +select_ways=1 //ways in which that particular order can be drawn +n=total_balls-given_no +for i=total_balls:-1:n+1 +pr=pr*i +end +prob=select_ways/pr +disp(prob,'The probability that 11,4,17,39,23 are drawn in that order is') + +//Part-(B) Sampling with replacement +total_ways=total_balls**given_no //5 is the no.of balls ,i.e, 11 4 17 39 23 +select_ways=1 //numbers are drawn in that order +prob=select_ways/total_ways +disp(prob,'The probability that 11,4,17,39,23 are drawn in that order is') |