blob: 8c1787f7eaf81ff773b61c499c440296c88b222a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
//Caption: Probability
//Example 2.5
//page no 44
//find the probability
clc;
clear;
whiteballs=5;
redballs=3;
balckballs=2;
totalballs=whiteballs+redballs+balckballs;
pw=whiteballs/totalballs;//probability of gettingfirst ball is white
pr=redballs/(totalballs-1);//probability of getting second ball is red
pb=balckballs/(totalballs-2);//probability of getting third ball is black
possbilecases=6;
probabalityof_eachcase=pw*pr*pb;
totalprobability=6*probabalityof_eachcase;//required probability
disp(totalprobability,"Probability of balls will be in different colours");
|