Systems Engineering Program Department of Engineering Management, Information and Systems EMIS 7370/5370 STAT 5340 : PROBABILITY AND STATISTICS FOR SCIENTISTS AND ENGINEERS Conditional Probability and Bayes’ Theorem Dr. Jerrell T. Stracener, SAE Fellow Leadership in Engineering 1 Conditional Probability Basic Concept • Definition • Reduced Sample Space • Rules • Bayes’ Rule 2 Conditional Probability If A and B are any events in S and P(B) 0, the conditional probability of A, given that B has occurred is denoted by P(A | B), and P(A B) P(A | B) P(B) Note: The given event is called the reduced sample space. 3 Conditional Probability: Rules • Rule If A and B are any events in S, then P(A B) = P(A)P(B|A) if P(A) 0 = P(B)P(A|B) if P(B) 0 • Rule Two events A and B are independent if P(A|B) = P(A), and are dependent otherwise. 4 Product Rule continued Rule If A, B and C are events in S for which P(A) > 0, P(B) > 0, and P(C) > 0 , then P(A B C) = P(A)P(B|A)P(C|A B) •Rule For events A1, A2, ... An in S, can occur, then P(A1 A2 ... An) = P(A1)P(A2|A1)P(A3|A1 A2)… P(An|A1 ... An-1) 5 Bayes Theorem Let {B1, B2, ..., Bn} be a set of events forming a partition of the sample space S, where P(Bi) 0, for i = 1, 2, ... , n. Let A be any event of S such that P(A) 0. Then, for k = 1, 2, ..., n, P(B k | A) P(Bk A) n P(B A) i 1 i P(B k )P(A | B k ) n P(B )P(A | B ) i 1 i i 6 In a sense, Bayes’ Rule is updating or revising the prior probability P(B) by incorporating the observed information contained within event A into the model. 7 Example A chain of video stores sells three different brands of VCR’s. Of its VCR sales, 50% are Brand 1 (the least expensive), 30% are Brand 2, and 20% are Brand 3. Each manufacturer offers a 1-year warranty on parts and labor. It is known that 25% of Brand 1’s VCR’s require warranty repair work, whereas the corresponding percentages for Brands 2 and 3 are 20% and 10% respectively. 1. What is the probability that a randomly selected purchaser has bought a Brand 1 VCR that will need repair while under warranty? 2. What is the probability that a randomly selected purchaser has a VCR that will need repair while under warranty? 3. If a customer returns to the store with a VCR that needs warranty repair work, what is the probability that it is a Brand 1 VCR? A Brand 2 VCR? A Brand 3 VCR? 8 Example: solution The probability that a VCR sold will be Brand 1 is P(B1) = 0.50, the probability it will be Brand 2 is P(B2) = 0.30, and the probability that it will be Brand 3 P(B3) = 0.20. Once a Brand of VCR has been selected R represents that the VCR needs repair R’ represents that the VCR does not need repair The probability that a Brand 1 VCR needs repair, P(R|B1) = 0.25 The probability that a Brand 2 VCR needs repair, P(R|B2) = 0.20 The probability that a Brand 3 VCR needs repair, P(R|B3) = 0.10 9 Example: solution Outcome 0.25 B1R 0.125 no repair 0.75 B1R' 0.375 repair B2R 0.060 B2R' 0.240 0.10 B3R 0.020 0.90 B3R' 0.180 repair Brand 1 0.50 Probability Brand 2 0.30 0.20 no repair 0.80 0.20 Brand 3 repair no repair 1.000 10 Example: solution 1. P(B1 and R) = P(B1 R) = P(B1)P(R|B1) = (0.50)(0.25) = 0.125 or, by inspection from the tree diagram P(B1 and R) = 0.125 2. Since R = (B1 R) (B2 R) (B3 R), P(R) = P(B1 R) + P(B2 R) + P(B3 R) = 0.125 + 0.060 + 0.020 = 0.205 11 Example: solution 3. P(B1|R) = P(B1 R)/P(R) = 0.125/0.205 = 0.61 P(B2|R) = P(B2 R)/P(R) = 0.060/0.205 = 0.29 P(B3|R) = P(B2 R)/P(R) = 0.020/0.205 = 0.1 Note: P(B3|R) = 1 - P(B1|R) - P(B2|R) = 0. 10 12 Example An electrical system consists of four components whose reliability configuration is C A B D The system works if components A and B work and either of the components C or D work. The reliability (probability of working) of each component is 0.9. 13 Find the probability that: (a) The entire system works (b) The component C does not work, given that the entire system works. Assume that four components work independently. 14 Solution In this configuration of the system, A, B, and the subsystem C and D constitute a serial circuit system, whereas the subsystem C and D itself is a parallel circuit system. (a) Clearly the probability that the entire system works can be calculated as the following: P( A B (C D)) P( A) P( B) P(C D) P( A) P( B)[1 P(C ' D' )] P( A) P( B)[1 P(C ' ) P( D' )] (0.9)(0.9)[1 (1 0.9)(1 0.9)] 0.8019 The equalities above hold because of the independence among the four components 15 (b) To calculate the conditional probability in this case, notice that P(the system works but C does not work ) P= P(the system works) (0.9)(0.9)(1-0.9)(0.9) P( A B C ' D) = P(the system works) = =0.090909 0.8019 16