Presentation is loading. Please wait.

Presentation is loading. Please wait.

Conditional Probability. Conditional Probability of an Event Illustrating Example (1): Consider the experiment of guessing the answer to a multiple choice.

Similar presentations


Presentation on theme: "Conditional Probability. Conditional Probability of an Event Illustrating Example (1): Consider the experiment of guessing the answer to a multiple choice."— Presentation transcript:

1 Conditional Probability

2 Conditional Probability of an Event Illustrating Example (1): Consider the experiment of guessing the answer to a multiple choice question of 8 choices. The probability of guessing the right answer is 1/8. But if knowing that three of these choices are certainly wrong answers and should be disregarded, then the probability of getting the right answer swells to 1/5.

3 Illustrating Example (2): Consider the usual rolling of the die experiment, where the sample space is S = { 1, 2, 3 4, 5, 6 } Let B be the event that an even number occurs, then: B = {2, 4, 6 } and p(B) = n(B) / n(S) = 3/6 = ½ Supposed that the die is rolled out of our view and we are told that a number greater than three occurred. The event F of a number greater than 3 is: A = { 4, 5, 6 } Knowing that A has occurred, the probability that an even number occurs will increases and becomes equal to p({4,6}) / p(A) = 2/3. We denote that by p(B/A) and read it “ the probability of B given A” Notice that B∩A = { 4, 6 } Thus: p(B/A) = n (B∩A) / n(A) = [n (B∩A) / n (S)] / [n(A) / n (S) ] = p(B∩A) / p(A) = (2/6) /(3/6) = 2/3

4 Formula of Conditional Probability of an Event If E & A are two events in an experiment and p(A) is not equal to 0, then the conditional probability p(E│A) that E will occur given that A has already occurred is equal to p(A∩E) / p(A ) p(E│A) = p(A∩E) / p(A ) p(E│A) is pronounced “ the probability of E given A” → Product Rule: p(A∩E) = p(A ). p(E│A)

5 Example (3) A man has two kids. What’s the probability that both are boys, given that one of them is a boy Solution Let the notation BG mean the first child is a boy and the second is a girl, and read the notations BB, GB and GG in the same manner. The sample space S = {BB, BG, GB, GG} Let E be the event tat both of the children are boys and F the event that at least one of them is a boy. Then, E = {BB} and F = {BB, BG, GB} Then p(F) = ¾, E∩F = {BB}, p( E∩F ) = ¼ Therefore; P(E/F) = p( E∩F ) / p(F) = ¼ / ¾ = ¼ (4/3) = 1/3

6 Example (4) Assuming that 32% of the readers of a magazine will read an ad for a certain product in that magazine and 2% of those will buy the product. What’s the probability that a reader of the magazine will buy the product? Solution Let F be the event that a reader reads the ad and E the event that a reader buys the product. Then, E∩F is the event that a reader reads the ad and buys the product, p(F) = 0.32 and p(E/F) = 0.02 P(E/F) = p(E∩F ) / p(F) Or p(E∩F ) = P(E/F) p(F) = 0.02 (0.32)= 0.0064

7 Stochastic Processes A finite stochastic process is an experiment consisting of a finite numbers of stages in which the outcomes and associated probabilities of each stage depend on the outcomes and associated probabilities of the preceding (previous) stages.

8 Illustrating Example (5) Consider the experiment of drawing 2 cards without replacement from a deck of playing cards(52 cards). We think of the experiment as a stochastic process of 2 stages Stage(1): First Drawing Let F be the event that the card drawn is a face card. Then: F C is the event that the card drawn is not a face card, n(F) =12 and n(F C ) = 52 – 12 = 40 And so p(F) = 12/52 and p(F C ) = 40/52 Stage(2): Second Drawing Let G be the event that the card drawn is a face card. Then: G C is the event that the card drawn is not a face card. 1. If the outcome of the first stage is a face card, then n(G) = 11 and n(G C )=40, and hence p(G/F) = 11/51 and p(G C /F) = 40/51 2. If the outcome of the first stage is not a face card, then n(G) = 12 and n(G C )=39, and hence p(G/F C ) = 12/51 and p(G C /F C ) = 39/51

9 Tree Diagram for Stochastic Process F FCFC P(F)=12/52 P(F C )=40/52 P(G/F)=11/51 P(G C /F)=40/51 P(G/F C )=12/51 P(G C /F C )=39/51 GCGC G G GCGC

10 1. The probability that the first and the second card are face cards: P(F∩G) = p(F) p(G/F) = (12/52 ) (11/51) 2. The probability that the second card is a face card and the first is not : P(F C ∩G) = p(F C ) p(G/F C ) = (40/52 ) (12/51) F∩G and F C ∩G are mutually exclusive. 3. The probability that the second card is a face card = p(G) =p[ (F∩G) U (F C ∩G) ] ( notice that are mutually exclusive) = p(F∩G) + p(F C ∩G) = p(F) p(G/F) + p(F C ) p(G/F C ) = (12/52 ) (11/51) + (40/52 ) (12/51) = 12(11+40) / (51)(52) = 12/52 = 3/13

11 Independent Events 1. If A & B are independent events, then p(E│F) = p(E) and p(F│E) = p(F) Or equivalently; p(E∩F) = p(E). p(F) (Why?) Because p(E∩F) = p(E). p(F│E) 2. A group of events E 1, E 2,….,E n are independent if: p(E 1 ∩ E 2 ∩ …. ∩ E n ) = p(E 1 ) p(E 2 )….. p(E n )

12 Example (6) In the experiment of tossing a coin twice. Let E be the event that the outcome of the first toss is head and let F be the event that the outcome is tail in the second toss Show that E & F are independent. Solution: The sample space S= {HH, HT, TH, TT} E = {HH, HT} andF = {HT, TT}and so E∩F = {HT} → p(E) = 2/4 = ½,p(F) = 2/4 = ½ and p(E∩F ) = ¼ P(E) p(F) = ½ (½) = ¼ = p(E∩F ) → E & F are independent events

13 Example (7) Assume that E & F & G are independent events and p(E)=0.25, p(F) = 0.2 and p(G) = 0.4. Find: P(E ∩ F), p(E ∩ F ∩ G) Solution: p(E∩F ) = p(E) p(F) = (0.25 )(0.2) = 0.05 p(E ∩ F ∩ G) = p(E) p(F) p(G) = (0.25 )(0.2)(0.4) = 0.02

14 Posteriori & Priori Probabilities 1. Posteriori Probability is the probability calculated after the outcomes of an experiment have been observed. 2. Priori Probability is the probability of the likelihood that an event will occur

15 Partition of the Sample Space A partition of the sample space S is a family A 1, A 1, A 3,….., A n of mutually exclusive events ( disjoint subsets of S) whose union is S. In the opposite illustration, we have: A 1 U A 1 U A 3 = S A 1 ∩A 2 = Φ, A 1 ∩A 3 = Φ and A 2 ∩A 3 = Φ S E1E1 E3E3 E2E2 A1A1 A3A3 A2A2 S

16 Partition of the Sample Space Given a partition {A 1, A 1, A 3,….., A n } of S, for any event D, we have: D = (A 1 ∩D) U (A 2 ∩D) U (A 3 ∩D) U …… (A n ∩D) In the opposite illustration, we have: D= (A 1 ∩D) U (A 2 ∩D) U (A 3 ∩D) S E1E1 E3E3 E2E2 A1A1 A3A3 A2A2 S A 1 ∩D A 2 ∩D A 3 ∩D

17 Bayes’ Theorem

18 Simple Case: A sample Space Partitioned to two sets Let A 1, A 2 be a partition of a sample space S and let E be an event of the experiment such that p(E), p(A 1 ) and p(A 2 ) not equal to 0. And let: Σ = p(A 1 ) p( E │A 1 ) + p(A 2 ) p( E │A 2 ) Then a posteriori probabilities p(A 1 │E) and p(A 2 │E) are given by: p(A 1 │E) = p(A 1 ). p(E │A 1 ) / Σ = p(A 1 ) P(E / A 1 ) / [ p(A 1 ) P(E / A 1 ) + p(A 2 ) P(E / A 2 ) ] = product of Probabilities along path through A 1 and E / Sum of all products of probabilities along each paths to E p(A 2 │E) = p(A 2 ). p(E │A 2 ) / Σ = p(A 2 ) P(E / A 2 ) / [ p(A 1 ) P(E / A 1 ) + p(A 2 ) P(E / A 2 ) ] = product of Probabilities along path through A 2 and E / Sum of all products of probabilities along each paths to E

19 A1A1 E E P(A 1 ) P(A 2 ) P(E/A 2 ) P(E/A 1 ) P(A 2 / E) = p(A 2 ) P(E / A 2 ) / [ p(A 1 ) P(E / A 1 ) + p(A 2 ) P(E / A 2 ) ] p(A 2 ) P(E/A 2 ) ECEC ECEC A2A2 p(A 1 ) P(E/A 1 ) P(A 1 / E) = p(A 1 ) P(E / A 1 ) / [ p(A 1 ) P(E / A 1 ) + p(A 2 ) P(E / A 2 ) ]

20 General Case: A sample Space Partitioned to n sets Let A 1, A 2, …,A n be a partition of a sample space S and let E be an event of the experiment such that p(E) and p(A k ) not equal to 0, for all k = 1,2,…,n and Σ = p(A 1 ) p( E │A 1 ) + p(A 2 ) p( E │A 2 ) + … + p(A n ) p(E │A n ) Then a posteriori probability p(A k │E) is given by: p(A k │E) = p(A k ). p(E │A k ) / Σ = product of Probabilities along path through A k and E / Sum of all products of probabilities along each paths to E

21 A1A1 AnAn A2A2 E E E E P(A 1 ) P(A 2 ) P(A 3 ) P(A n ) P(E/A n ) P(E/A 3 ) P(E/A 2 ) P(E/A 1 ) p(A 1 ) P(E/A 1 ) p(A n ) P(E/A n ) p(A 2 ) P(E/A 2 ) ECEC ECEC ECEC

22 1. p(A 1 │E) = p(A 1 ). p(E │A 1 ) / Σ = p(A 1 ). p(E │A 1 ) / [ p(A 1 ) p( E │A 1 ) + p(A 2 ) p( E │A 2 ) + … + p(A n ) p(E │A n ) ] 2. p(A 2 │E) = p(A 2 ). p(E │A 2 ) / Σ = p(A 2 ). p(E │A 2 ) / [ p(A 1 ) p( E │A 1 ) + p(A 2 ) p( E │A 2 ) + … + p(A n ) p(E │A n ) ] 3. p(A 3 │E) = p(A 3 ). p(E │A 3 ) / Σ = p(A 3 ). p(E │A 3 ) / [ p(A 1 ) p( E │A 1 ) + p(A 2 ) p( E │A 2 ) + … + p(A n ) p(E │A n ) ]

23 4. p(A 4 │E) = p(A 4 ). p(E │A 4 ) / Σ = p(A 4 ). p(E │A 4 ) / [ p(A 1 ) p( E │A 1 ) + p(A 2 ) p( E │A 2 ) + … + p(A n ) p(E │A n ) ] 5. p(A 5 │E) = p(A 5 ). p(E │A 5 ) / Σ = p(A 5 ). p(E │A 5 ) / [ p(A 1 ) p( E │A 1 ) + p(A 2 ) p( E │A 2 ) + … + p(A n ) p(E │A n ) ] …………. ………….. n. p(A n │E) = p(A n ). p(E │A n ) / Σ = p(A n ). p(E │A n ) / [ p(A 1 ) p( E │A 1 ) + p(A 2 ) p( E │A 2 ) + … + p(A n ) p(E │A n ) ]

24 Example (8) The panels of an electronic apparatus is manufactured in three different locations (Plants A, B and C) before sent for final assembly. The table on the next slides indicates the percentage of panels produced by these plants, as well as, the percentage of the defective ones among them. If a manufactured unit is selected randomly and that the panel is found to be defective, what’s the probability that the panel was manufactured in plant C?

25 Detective Panels Produced Panels Plant 1 %50 %A 2 %30 %B 2 % 20 %C

26 Solution Let A, B & C be the events that the selected apparatus has a panel manufactured in plants A, B and C respectively. Let D e the event that the apparatus has a defective panel. P(C/D) = p(C) p(D/C) / Σ Where: Σ = p(A) p(D/A) + p(B) p(D/B) + p(C) p(D/C) A C B D D D DCDC DCDC DCDC P(A) = 0.5 P(C) = 0.2 P(B) = 0.3 P(D/A) = 0.1 P(D/C) = 0.12 P(D/B) = 0.2

27 Solution - Details Let A, B & C be the events that the selected apparatus has a panel manufactured in plants A, B and C respectively. Let D e the event that the apparatus has a defective panel. Then p(A) = 0.50, p(B) = 0.30, p(C) = 0.20 & Then p(D/C) The probability that the selected apparatus is defective given that it came from plant C = 0.02. Similarly; p(D/A) = 0.01 and p(D/B) = 0.02 By Bayes’ Theorem; The probability that the selected apparatus came from plant C given that it is defective given that it is defective P(C/D) = p(C) p(D/C) / Σ = p(C) p(D/C) / [ p(A) p(D/A) + p(B) p(D/B) + p(C) p(D/C) ] = (0.20) (0.02) / [ (0.50) (0.01) + (0.30) (0.02) + (0.20) (0.02) ] = 027

28 Example (9) The percentage of people carrying the ‘Math-hatin” virus who test positive by a blood test for that virus is 95% and the percentage of those not carrying the virus who, all the same, test positive is 3%. Assume that a person is selected at random and given the test. If the result is positive, what’s the probability that the person has the virus, knowing that 8% of the population have the virus?

29 Solution Let V, T be the event that the selected person “has the virus” and the event “ the selected person tested positive” respectively. We have: P(V) = 0.08 P(T/V) = 095 P(T/ V C ) = 0.03 V T T VCVC TCTC P(V) = 0.08 P(T/V) = 0.95 P(V C ) = 0.92 P(T/V C ) = 0.03 TCTC

30 Let V, and T be the events “having the virus” and “testing positive” respectively, then V C, and T C be the event “ not having the virus” and “not testing positive” respectively. We have: the sample space is the population S = V U V C partitioned into the V and V C P(V) = 0.08, p(T/V) = 0.95 and p(T / V C ) = 0.03 Hence: P(V C ) = 1 - P(V) = 1 - 0.08 = 0.92 & By Bayes’ Theorem; P(V/T) = p(V) p(T/V) / Σ = p(V) p(T/V) / [p(V) p(T/V) + p(V C ) p(T/V C ) ] = (0.08) (0.95) / [(0.08) (0.95) + (0.92) (0.03) ] = 0.733591 ≈ 0.734

31 Example (3) Two girls who are identical twin (can not be distinguished) dressed exactly the same. The first girl, Fatima, has in her purse one QR note & one SR note, while the other girl, Maryam, has in her identical purse two QR notes. One of the girl is selected at random and asked to hand a note from her purse at random. The note turned out to be a QR note. What’s the probability that the other note left in her purse is also a QR note?

32 Solution Let, F and Q be the events that “the selected girl if Fatima” and “ the selected note is a QR note” respectively. We have: p(F) = 0.5 p(F C ) = p(Maryam) = 0.5 p(Q/F) = 0.5 p(Q/ F C ) = 1.0 F Q Q F C = M QCQC P(F) = 0.5 P(Q/F) = 0.5 P(F C ) = 0.5 P(Q/ F C ) = 1.0 QCQC

33 Let F, and Q be the events that “Fatima is selected” and “QR note is selected” respectively, then F C is the event that “ Fatima is not selected” or equivalently “ Maryam is selected”. We have the sample space parttioned into the sets F & F C S = F U F C P(F) = 0.5, p(Q/F) = 0.5 and p(Q / F C ) = 1.0 We want to find the conditional probability that the selected girl is Maryam ( the event F C ) given that the selected note is a QR note (the event Q), that’s p(F C /Q) ( which, of course, what’s meant by the probability that the remaining note is a QR note) By Bayes’ Theorem; P(F C /Q) = p(F C ) p(Q/ F C ) / Σ = p(F C ) p(Q/ F C ) / [ p(F C ) p(Q/ F C ) + p(F) p(Q/F) ] = (0.5) (1.0) / [(0.5) (1.0) + (0.5) (0.5) ] = 0.6666 ≈ 0.67 Or Exactly: P(M/Q) = ( 1/2) (1) / [ ( 1/2) (1) + ( ( 1/2) (1/2) ) ] = 1/2 / (3/4) = 2/3


Download ppt "Conditional Probability. Conditional Probability of an Event Illustrating Example (1): Consider the experiment of guessing the answer to a multiple choice."

Similar presentations


Ads by Google