Lect 2 Ondprob

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 67

Lecture 2

2
AAOC C111: PROBABILITY &
STATISTICS
BITS-PILANI HYDERABAD CAMPUS
Presented by
Dr. M.S. Radhakrishnan
Email: msr@bits-hyderabad.ac.in
Lecture 2
Conditional Probability
Bayes Theorem
Text Book: J. SUSAN MILTON and
JESSE C. ARNOLD, Introduction to
Probability and Statistics, Tata McGraw-
Hill Edition, Fourth Reprint 2008.
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 2
In this lecture we look at

• Conditional Probability
• Independent events
• Theorem on Total Probability
• Bayes theorem
• Some simple examples

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 3


5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 4
Suppose we toss a coin two times. Then the
probability that we get two heads is
1
4

Suppose now that a coin is tossed two


times. And suppose it is known that one of
the tosses yielded a head. Now what is the
probability that both the tosses give heads?

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 5


Now the possible outcomes are

{ TH, HT, HH }

Hence the probability that both tosses


yielded heads given that one of the tosses
is a head is
1
3

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 6


Suppose we now define B as the event that
one of the tosses gives a head and A as the
event that both tosses are heads, then
3 1
P( B)  , P( A)   P( A  B)
4 4

And the probability that we get both times


tosses given that one of the tosses yielded
head is 1 1/ 4 P( A  B)
 
3 3/ 4 P( B)

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 7


As a second example, consider the rolling
of a fair die. Then the probability of getting
the number 2 on the top is 1
6

Suppose we are given that one of the


numbers on the top was even. Then the
probability of getting the number 2 on the
top is 1
3

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 8


Suppose we now define B as the event that
the number on the top is even and A as the
event that the number on the top is 2, then
1 1
P( B)  , P( A)   P( A  B)
2 6

And the probability that we get the number


on the top is 2 given that the number on the
top is even is 1 1/ 6 P( A  B)
 
3 1/ 2 P( B)

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 9


Thus whenever we speak of the
“conditional probability” – probability of
an event A given that the event B has
happened, we are talking of the
probability in relation to the “reduced
sample space”. In the first example the
reduced sample space was {TH, HT, TT}
and in the second it was {2, 4, 6}. Inspired
by the results of the two examples above,
we then define
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 10
Conditional Probability
If A, B are two events associated with a
random experiment, then we define the
conditional probability of the event A given
that B has happened as
P  A  B
P  A B  if P  B   0
P  B

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 11


Thus we get the multiplication Rule:

P  A  B  P B P A | B

Equivalently P  A  B   P  A P  B | A

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 12


Example
Two cards are drawn at random from a pack
of 52 cards without replacement. Find the
probability that both cards drawn are aces.
Solution: Let A be the event that the first card
drawn was an ace. Let B be the event that the
second card drawn was an ace. We want
P(A  B) = P(A)  P(B | A) 
4 3
 
1
.
52 51 221

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 13


We can generalize the above result
(Multiplication Rule) for three events:

Theorem
If A, B, C are three events such that
P(A  B)  0, then
P (A  B  C)
= P (A)  P (B | A)  P ( C | A  B)

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 14


Example 14
Three cards are drawn at random from a pack
of 52 cards without replacement. Find the
probability that all the three cards drawn are
aces.

Solution: Let A be the event that the first


card drawn was an ace. Let B be the event that
the second card drawn was an ace. Let C be
the event that the third card drawn was an ace.
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 15
We want

P (A  B  C)

= P (A)  P (B | A)  P ( C | A  B)

4 3 2 1
   
52 51 50 5525

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 16


Independence
Two events are called independent if

P  A | B  P  A
or equivalently if

P  A  B  P A PB

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 17


One can easily show that if A and B are
independent, then

(a) A andB are independent,

(b)A and B are independent,

(c)A andB are independent.

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 18


We first show that A and B are independent.
A  B and A  B are m.e. events whose
union is B.
Hence P(B) = P(A  B ) + P(A  B )

Now P(A  B ) = P(B) - P(A  B )


= P(B) - P(A) P(B )
(as A and B are independent).
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 19
= P(B) [ 1 - P(A)] = P (A) P(B )

Hence A and B are independent.

Changing A into B and B into A, we get


A andB are independent
Hence by the earlier result,
A andB are independent.

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 20


Example 15
An electronic system has 2 subsystems A and
B. It is known that
P (A fails) = 0.2
P (B fails alone) = 0.15
P (A and B fail) = 0.15
Find (a) P(A fails | B has failed)
(b) P(A fails alone)
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 21
A fails alone A and B fail

B fails alone
0.15 0.15

Solution P(B fails)


= P(B fails alone) + P( A and B fail)
= 0.15 + 0.15 = 0.30
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 22
A fails alone A and B fail
P( A) = 0.2

B fails alone
0.15 0.15

0.15
P(A fails| B has failed) =  0.5
0.30
P(A alone fails) = P(A fails) - P( A and B fail)
 0.2  0.15  0.05
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 23
Example 16
A binary number is a number having digits 0
and 1. Suppose a binary number is made up
of ‘n’ digits. Suppose the probability of
forming an incorrect binary digit is p. Assume
independence between errors. What is the
probability of forming an incorrect binary
number?
Ans: 1- P (forming a correct no.) = 1 – (1-p)n .
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 24
Example 17
A question paper consists of 20 Multiple
choice questions each of which has 4 choices
(of which only one is correct). If a student
answers all the 20 questions randomly, find
the probability that he answers all questions
correctly.
20
  13
1
Answer    9.0910
4
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 25
Theorem on Total Probability
If B1, B2……, Bn are n mutually exclusive
and exhaustive events, then for any event A,

P  A   P  B1   P  A B1   P  B2   P  A B2   ...

 P Bn  P A Bn 

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 26


S

B1 B2 Bn

A  B1 A  B2 A  Bn
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 27
Proof: A is the union of the m.e. events
A  B1, A  B2, …, A  Bn.
Thus P(A)
= P(A  B1) + P(A  B2) + … + P(A  Bn)

= P(B1)  P(A | B1) + P(B2)  P(A | B2) + ….


+ P(Bn)  P(A | Bn) .

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 28


Example 18

There are 2 urns. The first one has 4 red balls


and 6 black balls. The second has 5 red balls
and 4 black balls. A ball is chosen at random
from the 1st and put in the 2nd. Now a ball is
drawn at random from the 2nd urn. Find the
probability it is red.

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 29


Solution
We define B1 as the event that the ball
taken from Urn I is red; let B2 be the
complementary event. Let A be the event
that the ball taken from Urn II is red.

4R 5R P(R)?
6B 4B

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 30


A
B1 4 6
10 P(A | B1)=
10

5
B2 P(A | B2)= 10
6
10 A
By the theorem on total probability,
P(A) = P(B1) P(A | B1) + P(B2) P(A | B2)
4 6 6 5
    = 0.54
10 10 10 10

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 31


In the above example the events A and B1 are
neither independent nor m.e. They are not
independent as
P(A | B1) = 0.60  0.54 = P(A)
They are NOT m.e. as
P (A  B1) = P(B1)  P(A | B1)
4 6
   0.24  0.0
10 10

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 32


Suppose an urn contains 4 Red and 6 Black
balls. Suppose now we draw two balls at
random with replacement. Let B be the
event that the first ball drawn is red. Let A
be the event that the second ball drawn is
red. It is clear that the two events A and B
are independent but NOT m.e.
Suppose now we define A as the event that
the first ball drawn is red and B as the event
that the first ball drawn is black.
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 33
It is obvious that A and B are m.e.

A and B are NOT independent as

P(A) . P(B) = 0.4 0.6 = 0.24  0 = P(A B)

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 34


Example 19
A consulting firm rents cars from three
agencies D, E, F. 20% of the cars are
rented from D, 20% from E and the
remaining 60% from F. If 10% of cars
rented from D, 12% of cars rented from E,
4% of cars rented from F have bad tires,
find the probability that a car rented from
the consulting firm will have bad tires.
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 35
Bad tire
0.2
D 0.10

0.2
E Bad tire
0.12
F
0.6 Bad tire
0.04
Ans. (0.2) (0.10) + (0.2) (0.12) + (0.6) (0.04)

= 0.025056
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 36
Example 20
A and B play the following game. They throw
alternatively a pair of dice. Whosoever gets
sum of the two numbers on the top as seven
wins the game and the game stops. Suppose A
starts the game. Find the probability (a) A
wins the game (b) B wins the game.
Solution: Let Aj be the event that A gets a
sum 7 on the jth throw. Let Bk be the event
that B gets a sum 7 on the kth throw.
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 37
If A is the event that A wins, then

A  A1  ( A1  B2  A3 )  ( A1  B2  A3  B4  A5 )  .....
Note that all the ‘events’ in the RHS are m.e.
Hence P(A wins)
1 5 5 1 5 5 5 5 1
          ...
6 6 6 6 6 6 6 6 6
1/ 6 6 5
  . P(B wins)  .
1  (25/ 36) 11 11
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 38
Bayes’ Theorem (Reasoning from effect
to cause)
If B1, B2, ……Bn are n m.e. and exhaustive
events and if A is any event, then
P Br  P A Br 
PBr A 
 P B  P A B 
n

i i
i 1

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 39


P( A  Br )
Proof P( Br | A) 
P( A)
Now, by the theorem on total probability,

P  A  P  B1   P  A B1   P  B2   P  A B2   ...

 P Bn  P A Bn 

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 40


Also P( A  Br )  P( Br )  P( A | Br )

Thus
P Br  P A Br 
PBr A 
 P B  P A B 
n

i i
i 1

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 41


Example 21
At an electronics firm, it is known from past
experience that the probability a new worker who
attended the company’s training programme meets
the production quota is 0.86. The corresponding
probability for a new worker who did not attend the
training program is 0.35. It is also known that 80%
of all new workers attend the company’s training
program. Find probability that a new worker who
met the production quota would have attended the
company’s training programme.
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 42
Solution
Let B1 be the event that a new worker attended
the company’s training programme. Let B2 be
the complementary event, namely a new
worker did not attend the training programme.
Let A be the event that a new worker met the
production quota. Then we want
P( A  B1 ) P( B1 )  P( A | B1 )
P(B1 | A)  
P( A) P( A)
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 43
A
0.8 0.86
B1

B2 A
0.2
0.35

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 44


Hence P(B1|A)

P( B1 )  P( A | B1 )

P( A)

0.8  0.86

0.8  0.86  0.2  0.35
= 0.91

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 45


Example 22
Miss ‘X’ is fond of seeing movies. The
probability that she sees a movie on the day
before the test is 0.7. Miss X is any way good
at studies. The probability that she gets
maximum marks in the test is 0.3 if she sees a
movie on the day before the test and the
corresponding probability is 0.8 if she does not
see the film. If Miss ‘X’ got maximum marks
in the test, find the probability that she saw a
movie on the day before the test.
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 46
Solution
Let B1 be the event that Miss ‘X’ saw a
movie on the day before the test. Let B2 be
the complementary event, namely she did
not see a movie on the day before the test.
Let A be the event that she got maximum
marks in the test. Thus we want
P( A  B1 ) P( B1 )  P( A | B1 )
P(B1 | A)  
P( A) P( A)
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 47
A
B1 0.3
0.7

A
B2
0.3 0.8
P( B1 )  P( A | B1 )
Hence P(B1|A) 
P( A)
0.7  0.3
 = 0.47
0.7  0.3  0.3  0.8
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 48
End of Lecture 3

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 49


Problems for Practice
1. Let A and B be two events associated with
an experiment. Suppose that P (A) = 0.4
while P (A  B) = 0.7. Let P (B) = p.
(a) For what choice of p are A and B
mutually exclusive ?
(b) For what choice of p are A and B
independent ?

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 50


2. If the probabilities that a satellite launching
rocket will explode during lift-off or have its
guidance system fall in flight are 0.0002 and
0.0005, find the probabilities that such a
rocket will
(a) not explode during lift-off
(b) explode during lift-off or have its
guidance system fail in flight
(c) neither explode during lift-off nor
have its guidance system fail in flight.
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 51
3. Prove: If P (A | B ) > P (A), then P (B | A )
> P (B). (Assume P (A), P(B) > 0.)

4. Among 60 automobile repair parts loaded


on a truck to San Francisco, 45 are destined
for Seattle and 15 for Vancouver. If two of
the parts are unloaded in Portland by
mistake and the “selection” is random,
what are the probabilities that
(a) both parts should have gone to Seattle;
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 52
(b) both parts should have gone to Vancouver;
(c) one should have gone to Seattle and one to
Vancouver?
5. If six bullets, of which three are blanks, are
randomly inserted into a gun, what is the
probability that the first three bullets fired
will all be blank?
6. In a certain city during the month of May,
the probability that a rainy day will be
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 53
followed by another rainy day is 0.80 and
the probability that a sunny day will be
followed by a rainy day is 0.60. Assuming
that each day is classified as being either
rainy or sunny and that the weather on any
day depends only on the weather the day
before, find the probability that in the given
city a rainy day in May is followed by two
more rainy days, then a sunny day, and
finally another rainy day.
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 54
7. A department store which bills its charge-
account customers once a month has found
that if a customer pays promptly one month,
the probability is 0.90 that he will also pay
promptly next month; however, if a customer
does not pay promptly one month, the
probability that he will pay promptly the
next month is only 0.50. What is the
probability that a customer who has paid
promptly one month will not pay promptly
the next three months?
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 55
8. A bag contains three coins, one of which is
Amitabh Bachchan’s coin (i.e. coined
with two heads) while the other two coins
are normal and not biased. A coin is
chosen at random from the bag and tossed
four times in succession. If heads turn up
each time, what is the probability that the
coin chosen was the two-headed coin?

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 56


9. In a bolt factory, machines A, B and C
manufacture 25, 35, and 40 percent of the
total output, respectively. Of their outputs,
5, 4, and 2 percent, respectively, are
defective bolts. A bolt is chosen at random
and found to be defective. What is the
probability that the bolt came from
machine A? B? C?

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 57


10. A printing machine can print n “letters”, say
a1, a2, …, an. It is operated by electrical impulses,
each letter being produced by a different impulse.
Assume that there exists a constant probability p
of printing the correct letter and also assume
independence. One of the n impulses, chosen at
random, was fed into the machine twice and both
times the letter a1 was printed. Compute the
probability that the impulse chosen was meant to
print a1.
(Hint: The probability that the impulse meant to print the
letter ak, prints any other letter aj ( j  k) is (1 – p)/(n – 1).)
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 58
11. 1 2
L 3 R
4 5

In the figure above, assume that the


probability of each relay being closed is p,
and assume that each relay is open or closed
independently of any other relay. Find the
probability that current flows from L to R.

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 59


12. Two machines A, B, being operated
independently, may have a number of
breakdowns each day. The table below gives
the probability distribution of breakdowns
for each machine.
Number of
0 1 2 3 4 5 6
breakdowns
A 0.1 0.2 0.3 0.2 0.09 0.07 0.04

B 0.3 0.1 0.1 0.1 0.1 0.15 0.15

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 60


Compute the following probabilities:

(a) A and B have the same number of


breakdowns
(b) The total number of breakdowns is less
than 4; less than 5
(c) A has more breakdowns than B
(d) B has twice as many breakdowns as A

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 61


Compute the following probabilities:

(e) B has 4 breakdowns, when it is known


that B has at least 2 breakdowns.
(f) The minimum number of breakdowns of
the two machines is 3; less than 3.
(g) The maximum number of breakdowns of
the two machines is 3; more than 3.

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 62


13.Two dice are rolled. Given that the faces
show different numbers, what is the
probability that one face is 4?
14. Two firms V and W consider bidding
on a road-building job, which may or
may not be awarded depending on the
amount of bids. Firm V submits a bid
and the probability is ¾ that it will get
the job provided firm W does not bid.

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 63


The probability is ¾ that W will bid, and if
it does, the probability that V will get the
job is only 1/3.
(a) What is the probability that V will get
the job?
(b) If V gets the job, what is the
probability that W did not bid?
15. Amy commutes to work by two different
routes A and B. If she comes home by route A,
then she will be home no later than 6 P.M.
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 64
with probability 0.8, but if she comes home
by route B, then she will be home no later
than 6 P.M. with probability 0.7. In the past,
the proportion of time Amy chose route A is
0.4.
(a) What proportion of time is Amy home
no later than 6.00 P.M. ?
(b) If Amy is home after 6 P.M. today, what
is the probability that she took route B?
***
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 65
Answers
1. (a) 0.3 (b) 0.5
2. (a) 0.9998 (b) 0.6999 10-3 (c) 0.9993
4. (a) 66/118 (b) 7/118 (c) 45/118

5. 0.05 6. 0.0768 7. 0.025 8. 8/9


9. (a) 0.3623 (b) 0.4058 (c) 0.2319
(n  1) p 2
10.
1  2 p  np 2
11. 2p2 + 2p3 – 5p4 + 2p5
5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 66
12. (a) 0.1255 (b) 0.340, 0.400 (c) 0.417
(d) 0.110 (e) 1/6 (f) 0.120, 0.80
(g) 0.17, 0.52
13. 1/3 14. (a) 7/16 (b) 3/7
15. (a) 0.74 (b) 9/13 (= 0.69)

***

5-Aug-19 Prepared by Dr. M.S. Radhakrishnan, BITS, Pilani (Rajasthan) 67

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy