Bayes'
Bayes'
Bayes'
1
Q: Assume that a factory has two machines. Past
records show that machine 1 produced 30% of
the items of output and machine 2 produced
70% of the items. Further 5% of the items
produced by machine 1 were defective and
only 1% produced by machine 2 were
defective. If a defective item is drawn at
random, what is the probability that the
defective item was produced by machine 1 or
machine 2?
2
Let A1 be the event of drawing an item produced by
machine 1;
A2 be the event of drawing an item produced by
machine 2; and
B be the event of drawing a defective item produced
either by machine 1 or machine 2.
3
probability that the defective item was produced by machine 1 = P(A1/B) = ?
= 0.30 x 0.05
0.30 x 0.05 + 0.70 x 0.01
= 0.681 = 68%
4
Implies that
P(A2/B) = 1 - P(A1/B) ; as there are only 2
machines in the given system.
= 1 – 0.681 = 0. 319 = 32%
Implies that
P( defective item coming from Machine 1) >
P( defective item coming from Machine 2)
6
Probability Distribution
Listing out all X values and corresponding
probabilities
7
Discrete Probability Distribution
Where X is discrete
Eg: No. of heads/tails while tossing a coin
Where X is continuous
Eg: Life length of a bulb
8
Expected Value
If X is a discrete random variable with values
X1,
X2, X3, X4, …, Xn with corresponding
probabilities p1, p2, p3, p4, …, pn, where p1 + p2,
p3 + p4 + …, pn = 1,
9
Q: A Petrol pump proprietor sells an average of
Rs. 80,000 petrol on rainy days and an average
of Rs. 95,000 on clear days. Statistics from the
meteorological department show that the
probability is 0.76 for clear weather and 0.24
for raining weather on coming Monday. Find
the expected value of petrol sale.
10
Solution:
X1 = 80,000 p1 = 0.24
X2 = 95,000 p2 = 0.76
Also, p1 + p2 = 1
E(X) = p1 X1 + p2 X2
11
Binomial Distribution - Discrete
Conditions:
a) Experiment need to be performed ‘n’ times
under identical conditions ;
b) There are only two possible outcomes – success
& failure
Or S = { success, failure}
where p+q = 1;
p: P(success) & q: P(failure)
c) The trials are statistically independent
12
If X ~ P (n, p) ----- Binomial Distribution
= P(X=r) = n Cr px (q)n-x
Where r: 0, 1, 2, …n ;
& p+q=1
n: total no. of trials
p: probability of success in a single trial
13
Also…
More appropriate in the case of all
distributions with sample size ≤ 30
And p 0.5
14
15