Download presentation
Presentation is loading. Please wait.
Published byCecil Lynch Modified over 9 years ago
2
1 1 Slide 統計學 Fall 2003 授課教師:統計系余清祥 日期: 2003 年 10 月 14 日 第五週:機率論介紹
3
2 2 Slide Chapter 4 Introduction to Probability n Experiments, Counting Rules, and Assigning Probabilities Assigning Probabilities n Events and Their Probability n Some Basic Relationships of Probability n Conditional Probability n Bayes’ Theorem
4
3 3 Slide Probability n Probability is a numerical measure of the likelihood that an event will occur. n Probability values are always assigned on a scale from 0 to 1. n A probability near 0 indicates an event is very unlikely to occur. n A probability near 1 indicates an event is almost certain to occur. n A probability of 0.5 indicates the occurrence of the event is just as likely as it is unlikely.
5
4 4 Slide Probability as a Numerical Measure of the Likelihood of Occurrence 01.5 Increasing Likelihood of Occurrence Probability: The occurrence of the event is just as likely as it is unlikely. just as likely as it is unlikely.
6
5 5 Slide An Experiment and Its Sample Space n An experiment is any process that generates well- defined outcomes. n The sample space for an experiment is the set of all experimental outcomes. n A sample point is an element of the sample space, any one particular experimental outcome.
7
6 6 Slide Example: Bradley Investments Bradley has invested in two stocks, Markley Oil and Collins Mining. Bradley has determined that the possible outcomes of these investments three months from now are as follows. Investment Gain or Loss Investment Gain or Loss in 3 Months (in $000) in 3 Months (in $000) Markley Oil Collins Mining Markley Oil Collins Mining 10 8 5 -2 5 -2 0 -20 -20
8
7 7 Slide A Counting Rule for Multiple-Step Experiments n If an experiment consists of a sequence of k steps in which there are n 1 possible results for the first step, n 2 possible results for the second step, and so on, then the total number of experimental outcomes is given by ( n 1 )( n 2 )... ( n k ). n A helpful graphical representation of a multiple-step experiment is a tree diagram.
9
8 8 Slide Example: Bradley Investments n A Counting Rule for Multiple-Step Experiments Bradley Investments can be viewed as a two-step experiment; it involves two stocks, each with a set of experimental outcomes. Markley Oil: n 1 = 4 Collins Mining: n 2 = 2 Total Number of Experimental Outcomes: n 1 n 2 = (4)(2) = 8
10
9 9 Slide Example: Bradley Investments n Tree Diagram Markley Oil Collins Mining Experimental Markley Oil Collins Mining Experimental (Stage 1) (Stage 2) Outcomes (Stage 1) (Stage 2) Outcomes Gain 5 Gain 8 Gain 10 Gain 8 Lose 20 Lose 2 Even (10, 8) Gain $18,000 (10, -2) Gain $8,000 (5, 8) Gain $13,000 (5, -2) Gain $3,000 (0, 8) Gain $8,000 (0, -2) Lose $2,000 (-20, 8) Lose $12,000 (-20, -2)Lose $22,000
11
10 Slide Another useful counting rule enables us to count the number of experimental outcomes when n objects are to be selected from a set of N objects. n Number of combinations of N objects taken n at a time where N ! = N ( N - 1)( N - 2)... (2)(1) n ! = n ( n - 1)( n - 2)... (2)(1) n ! = n ( n - 1)( n - 2)... (2)(1) 0! = 1 0! = 1 Counting Rule for Combinations
12
11 Slide Counting Rule for Permutations A third useful counting rule enables us to count the number of experimental outcomes when n objects are to be selected from a set of N objects where the order of selection is important. n Number of permutations of N objects taken n at a time
13
12 Slide Assigning Probabilities n Classical Method Assigning probabilities based on the assumption of equally likely outcomes. n Relative Frequency Method Assigning probabilities based on experimentation or historical data. n Subjective Method Assigning probabilities based on the assignor’s judgment.
14
13 Slide Classical Method If an experiment has n possible outcomes, this method would assign a probability of 1/ n to each outcome. n Example Experiment: Rolling a die Experiment: Rolling a die Sample Space: S = {1, 2, 3, 4, 5, 6} Sample Space: S = {1, 2, 3, 4, 5, 6} Probabilities: Each sample point has a 1/6 chance Probabilities: Each sample point has a 1/6 chance of occurring. of occurring.
15
14 Slide Example: Lucas Tool Rental n Relative Frequency Method Lucas would like to assign probabilities to the number of floor polishers it rents per day. Office records show the following frequencies of daily rentals for the last 40 days. Number of Number Number of Number Polishers Rentedof Days Polishers Rentedof Days 0 4 1 6 2 18 3 10 4 2
16
15 Slide n Relative Frequency Method The probability assignments are given by dividing the number-of-days frequencies by the total frequency (total number of days). Number of Number Number of Number Polishers Rentedof Days Probability 0 4.10 = 4/40 0 4.10 = 4/40 1 6.15 = 6/40 1 6.15 = 6/40 2 18.45 etc. 2 18.45 etc. 3 10.25 3 10.25 4 2.05 4 2.05 401.00 401.00 Example: Lucas Tool Rental
17
16 Slide Subjective Method n When economic conditions and a company’s circumstances change rapidly it might be inappropriate to assign probabilities based solely on historical data. n We can use any data available as well as our experience and intuition, but ultimately a probability value should express our degree of belief that the experimental outcome will occur. n The best probability estimates often are obtained by combining the estimates from the classical or relative frequency approach with the subjective estimates.
18
17 Slide Example: Bradley Investments Applying the subjective method, an analyst Applying the subjective method, an analyst made the following probability assignments. Exper. Outcome Net Gain/Loss Probability Exper. Outcome Net Gain/Loss Probability ( 10, 8) $18,000Gain.20 ( 10, 8) $18,000Gain.20 ( 10, -2) $8,000Gain.08 ( 10, -2) $8,000Gain.08 ( 5, 8) $13,000Gain.16 ( 5, 8) $13,000Gain.16 ( 5, -2) $3,000Gain.26 ( 5, -2) $3,000Gain.26 ( 0, 8) $8,000Gain.10 ( 0, 8) $8,000Gain.10 ( 0, -2) $2,000Loss.12 ( 0, -2) $2,000Loss.12 (-20, 8) $12,000Loss.02 (-20, 8) $12,000Loss.02 (-20, -2) $22,000Loss.06 (-20, -2) $22,000Loss.06
19
18 Slide Events and Their Probability n An event is a collection of sample points. n The probability of any event is equal to the sum of the probabilities of the sample points in the event. n If we can identify all the sample points of an experiment and assign a probability to each, we can compute the probability of an event.
20
19 Slide Example: Bradley Investments n Events and Their Probabilities Event M = Markley Oil Profitable M = {(10, 8), (10, -2), (5, 8), (5, -2)} M = {(10, 8), (10, -2), (5, 8), (5, -2)} P( M ) = P(10, 8) + P(10, -2) + P(5, 8) + P(5, -2) P( M ) = P(10, 8) + P(10, -2) + P(5, 8) + P(5, -2) =.2 +.08 +.16 +.26 =.2 +.08 +.16 +.26 =.70 =.70 Event C = Collins Mining Profitable Event C = Collins Mining Profitable P( C ) =.48 (found using the same logic) P( C ) =.48 (found using the same logic)
21
20 Slide Some Basic Relationships of Probability n There are some basic probability relationships that can be used to compute the probability of an event without knowledge of al the sample point probabilities. Complement of an Event Complement of an Event Union of Two Events Union of Two Events Intersection of Two Events Intersection of Two Events Mutually Exclusive Events Mutually Exclusive Events
22
21 Slide Complement of an Event n The complement of event A is defined to be the event consisting of all sample points that are not in A. n The complement of A is denoted by A c. n The Venn diagram below illustrates the concept of a complement. Event A AcAcAcAc Sample Space S
23
22 Slide n The union of events A and B is the event containing all sample points that are in A or B or both. The union is denoted by A B The union is denoted by A B n The union of A and B is illustrated below. Sample Space S Event A Event B Union of Two Events
24
23 Slide Example: Bradley Investments n Union of Two Events Event M = Markley Oil Profitable Event C = Collins Mining Profitable Event C = Collins Mining Profitable M C = Markley Oil Profitable M C = Markley Oil Profitable or Collins Mining Profitable or Collins Mining Profitable M C = {(10, 8), (10, -2), (5, 8), (5, -2), (0, 8), (-20, 8)} M C = {(10, 8), (10, -2), (5, 8), (5, -2), (0, 8), (-20, 8)} P( M C) = P(10, 8) + P(10, -2) + P(5, 8) + P(5, -2) P( M C) = P(10, 8) + P(10, -2) + P(5, 8) + P(5, -2) + P(0, 8) + P(-20, 8) =.20 +.08 +.16 +.26 +.10 +.02 =.20 +.08 +.16 +.26 +.10 +.02 =.82 =.82
25
24 Slide Intersection of Two Events The intersection of events A and B is the set of all sample points that are in both A and B. The intersection of events A and B is the set of all sample points that are in both A and B. The intersection is denoted by A The intersection is denoted by A n The intersection of A and B is the area of overlap in the illustration below. Sample Space S Event A Event B Intersection
26
25 Slide n Intersection of Two Events Event M = Markley Oil Profitable Event C = Collins Mining Profitable Event C = Collins Mining Profitable M C = Markley Oil Profitable M C = Markley Oil Profitable and Collins Mining Profitable and Collins Mining Profitable M C = {(10, 8), (5, 8)} M C = {(10, 8), (5, 8)} P( M C) = P(10, 8) + P(5, 8) P( M C) = P(10, 8) + P(5, 8) =.20 +.16 =.20 +.16 =.36 =.36 Example: Bradley Investments
27
26 Slide Addition Law n The addition law provides a way to compute the probability of event A, or B, or both A and B occurring. n The law is written as: P( A B ) = P( A ) + P( B ) - P( A B P( A B ) = P( A ) + P( B ) - P( A B
28
27 Slide Example: Bradley Investments n Addition Law Markley Oil or Collins Mining Profitable Markley Oil or Collins Mining Profitable We know: P( M ) =.70, P( C ) =.48, P( M C ) =.36 We know: P( M ) =.70, P( C ) =.48, P( M C ) =.36 Thus: P( M C) = P( M ) + P( C ) - P( M C ) Thus: P( M C) = P( M ) + P( C ) - P( M C ) =.70 +.48 -.36 =.70 +.48 -.36 =.82 =.82 This result is the same as that obtained earlier using This result is the same as that obtained earlier using the definition of the probability of an event. the definition of the probability of an event.
29
28 Slide Mutually Exclusive Events n Two events are said to be mutually exclusive if the events have no sample points in common. That is, two events are mutually exclusive if, when one event occurs, the other cannot occur. Sample Space S Sample Space S Event B Event A
30
29 Slide Mutually Exclusive Events n Addition Law for Mutually Exclusive Events P( A B ) = P( A ) + P( B ) P( A B ) = P( A ) + P( B )
31
30 Slide Conditional Probability n The probability of an event given that another event has occurred is called a conditional probability. n The conditional probability of A given B is denoted by P( A | B ). n A conditional probability is computed as follows:
32
31 Slide Example: Bradley Investments n Conditional Probability Collins Mining Profitable given Collins Mining Profitable given Markley Oil Profitable Markley Oil Profitable
33
32 Slide Multiplication Law n The multiplication law provides a way to compute the probability of an intersection of two events. n The law is written as: P( A B ) = P( B )P( A | B ) P( A B ) = P( B )P( A | B )
34
33 Slide Example: Bradley Investments n Multiplication Law Markley Oil and Collins Mining Profitable We know: P( M ) =.70, P( C | M ) =.51 We know: P( M ) =.70, P( C | M ) =.51 Thus: P( M C) = P( M )P( M|C ) Thus: P( M C) = P( M )P( M|C ) = (.70)(.51) = (.70)(.51) =.36 =.36 This result is the same as that obtained earlier using the definition of the probability of an event. This result is the same as that obtained earlier using the definition of the probability of an event.
35
34 Slide Independent Events n Events A and B are independent if P( A | B ) = P( A ).
36
35 Slide Independent Events n Multiplication Law for Independent Events P( A B ) = P( A )P( B ) P( A B ) = P( A )P( B ) n The multiplication law also can be used as a test to see if two events are independent.
37
36 Slide Example: Bradley Investments n Multiplication Law for Independent Events Are M and C independent? Does P( M C ) = P( M)P(C) ? We know: P( M C ) =.36, P( M ) =.70, P( C ) =.48 We know: P( M C ) =.36, P( M ) =.70, P( C ) =.48 But: P( M)P(C) = (.70)(.48) =.34 But: P( M)P(C) = (.70)(.48) =.34.34 so M and C are not independent..34 so M and C are not independent.
38
37 Slide Bayes’ Theorem n Often we begin probability analysis with initial or prior probabilities. n Then, from a sample, special report, or a product test we obtain some additional information. n Given this information, we calculate revised or posterior probabilities. n Bayes’ theorem provides the means for revising the prior probabilities. NewInformationNewInformationApplication of Bayes’ TheoremApplication TheoremPosteriorProbabilitiesPosteriorProbabilitiesPriorProbabilitiesPriorProbabilities
39
38 Slide A proposed shopping center will provide strong competition for downtown businesses like L. S. Clothiers. If the shopping center is built, the owner of L. S. Clothiers feels it would be best to relocate. The shopping center cannot be built unless a zoning change is approved by the town council. The planning board must first make a recommendation, for or against the zoning change, to the council. Let: The shopping center cannot be built unless a zoning change is approved by the town council. The planning board must first make a recommendation, for or against the zoning change, to the council. Let: A 1 = town council approves the zoning change A 2 = town council disapproves the change n Prior Probabilities Using subjective judgment: P( A 1 ) =.7, P( A 2 ) =.3 Using subjective judgment: P( A 1 ) =.7, P( A 2 ) =.3 Example: L. S. Clothiers
40
39 Slide Example: L. S. Clothiers n New Information The planning board has recommended against the zoning change. Let B denote the event of a negative recommendation by the planning board. The planning board has recommended against the zoning change. Let B denote the event of a negative recommendation by the planning board. Given that B has occurred, should L. S. Clothiers revise the probabilities that the town council will approve or disapprove the zoning change? Given that B has occurred, should L. S. Clothiers revise the probabilities that the town council will approve or disapprove the zoning change? n Conditional Probabilities Past history with the planning board and the town council indicates the following: Past history with the planning board and the town council indicates the following: P( B | A 1 ) =.2 P( B | A 2 ) =.9
41
40 Slide n Tree Diagram Example: L. S. Clothiers P( B c | A 1 ) =.8 P( A 1 ) =.7 P( A 2 ) =.3 P( B | A 2 ) =.9 P( B c | A 2 ) =.1 P( B | A 1 ) =.2 P( A 1 B ) =.14 P( A 2 B ) =.27 P( A 2 B c ) =.03 P( A 1 B c ) =.56
42
41 Slide Bayes’ Theorem n To find the posterior probability that event A i will occur given that event B has occurred we apply Bayes’ theorem. n Bayes’ theorem is applicable when the events for which we want to compute posterior probabilities are mutually exclusive and their union is the entire sample space.
43
42 Slide Example: L. S. Clothiers n Posterior Probabilities Given the planning board’s recommendation not to approve the zoning change, we revise the prior probabilities as follows. =.34 =.34 n Conclusion The planning board’s recommendation is good news for L. S. Clothiers. The posterior probability of the town council approving the zoning change is.34 versus a prior probability of.70.
44
43 Slide Tabular Approach n Step 1 Prepare the following three columns: Column 1 - The mutually exclusive events for which posterior probabilities are desired. Column 2 - The prior probabilities for the events. Column 3 - The conditional probabilities of the new information given each event.
45
44 Slide Tabular Approach (1) (2) (3) (4) (5) (1) (2) (3) (4) (5) Prior Conditional Prior Conditional Events Probabilities Probabilities A i P ( A i ) P ( B | A i ) A i P ( A i ) P ( B | A i ) A 1.7.2 A 1.7.2 A 2.3.9 A 2.3.9 1.0
46
45 Slide Tabular Approach n Step 2 In column 4, compute the joint probabilities for each event and the new information B by using the multiplication law. Multiply the prior probabilities in column 2 by the corresponding conditional probabilities in column 3. That is, P ( A i B ) = P ( A i ) P ( B | A i ). Multiply the prior probabilities in column 2 by the corresponding conditional probabilities in column 3. That is, P ( A i B ) = P ( A i ) P ( B | A i ).
47
46 Slide Tabular Approach (1) (2) (3) (4) (5) (1) (2) (3) (4) (5) Prior Conditional Joint Prior Conditional Joint Events Probabilities Probabilities Probabilities A i P ( A i ) P ( B | A i ) P ( A i B ) A i P ( A i ) P ( B | A i ) P ( A i B ) A 1.7.2.14 A 1.7.2.14 A 2.3.9.27 A 2.3.9.27 1.0
48
47 Slide Tabular Approach n Step 3 Sum the joint probabilities in column 4. The sum is the probability of the new information P ( B ). We see that there is a.14 probability of the town council approving the zoning change and a negative recommendation by the planning board. There is a.27 probability of the town council disapproving the zoning change and a negative recommendation by the planning board. We see that there is a.14 probability of the town council approving the zoning change and a negative recommendation by the planning board. There is a.27 probability of the town council disapproving the zoning change and a negative recommendation by the planning board. The sum.14 +.27 shows an overall probability of.41 of a negative recommendation by the planning board. The sum.14 +.27 shows an overall probability of.41 of a negative recommendation by the planning board.
49
48 Slide Tabular Approach (1) (2) (3) (4) (5) (1) (2) (3) (4) (5) Prior Conditional Joint Prior Conditional Joint Events Probabilities Probabilities Probabilities A i P ( A i ) P ( B | A i ) P ( A i B ) A i P ( A i ) P ( B | A i ) P ( A i B ) A 1.7.2.14 A 1.7.2.14 A 2.3.9.27 A 2.3.9.27 1.0 P ( B ) =.41 1.0 P ( B ) =.41
50
49 Slide n Step 4 In column 5, compute the posterior probabilities using the basic relationship of conditional probability. Note that the joint probabilities P ( A i B ) are in column 4 and the probability P ( B ) is the sum of column 4. Note that the joint probabilities P ( A i B ) are in column 4 and the probability P ( B ) is the sum of column 4. Tabular Approach
51
50 Slide Tabular Approach (1) (2) (3) (4) (5) (1) (2) (3) (4) (5) Prior Conditional Joint Posterior Prior Conditional Joint Posterior Events Probabilities Probabilities Probabilities Probabilities A i P ( A i ) P ( B | A i ) P ( A i B ) P ( A i | B ) A i P ( A i ) P ( B | A i ) P ( A i B ) P ( A i | B ) A 1.7.2.14.3415 A 1.7.2.14.3415 A 2.3.9.27.6585 A 2.3.9.27.6585 1.0 P ( B ) =.41 1.0000 1.0 P ( B ) =.41 1.0000
52
51 Slide A patient takes a lab test and the result comes back positive. The test returns a correct positive result in 99% of the cases in which the disease is actually present, and a correct negative result in 98% of the cases in which the disease is not present. Furthermore,.001 of all people have this cancer. 貝氏定理可協助我們更理性的判斷 =.047 P(cancer | +) = P ~cancer) =.02.999P(~ cancer) =.001P(cancer) =.01 P cancer) =.99 P(+ | ~cancer) =.98 P(+ | cancer) =
53
52 Slide 計算細節: n 假設某地區有一百萬人: 999,000 人健康, 1,000 人罹患癌症 檢查出陽性反應者: (1) 健康者中有 (2) 癌症患者中有 因此,癌症患者佔陽性反應者的比例: 因此,癌症患者佔陽性反應者的比例:
54
53 Slide Suppose a second test for the same patient returns a positive result as well. What are the posterior probabilities for cancer? P ~cancer) =.02.999P(~cancer) =.001P(cancer) =.01 P cancer) =.99 P(+ | ~cancer) =.98 P(+ | cancer) = =.710 P(cancer | + 1 + 2 ) =
55
54 Slide End of Chapter 4
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.