summaryrefslogtreecommitdiff
path: root/3808/CH7/EX7.5/Ex7_5.sce
diff options
context:
space:
mode:
Diffstat (limited to '3808/CH7/EX7.5/Ex7_5.sce')
-rw-r--r--3808/CH7/EX7.5/Ex7_5.sce22
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')