* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Probability
Survey
Document related concepts
Transcript
What is Probability? n Probability Peter Lo n n CS218 © Peter Lo 2004 1 Sample Spaces and Events n n n n n CS218 © Peter Lo 2004 0 Impossible 2 Simple Event Sample Space u Complete Collection of Outcomes (the set S) Simple Event (Sample Point) u Outcome With 1 Characteristic; a particular outcome, i.e, an element in S. Joint Event u 2 Events Occurring Simultaneously Compound Event u One or Another Event Occurring Impossible Event u The empty set ∅ in S. CS218 © Peter Lo 2004 Probability is the numerical measure of likelihood that the event will occur. Certain 1 u Simple Event u Joint Event u Compound Event Lies between 0 & 1 .5 Sum of events is 1 A. B. C. D. E. 3 Female Under age 20, < 20 Has 3 credit cards Red card from a deck of bridge cards Ace card from a deck of bridge cards CS218 © Peter Lo 2004 4 1 Joint Event n n Compound Event A and B, (A ∩ B): u Female, Under age 20 D and E, (D ∩ E): u Red, ace card from bridge deck CS218 © Peter Lo 2004 n 5 Example n u u u u n Event that an odd number occurs, B = {1, 3, 5} Event that a prime number occurs, C = {2, 3, 5} Event that an even number or a prime number occurs, 6 Let S be a sample space, let E be the class of events, and let P be a real-value function defined on E. Then P is called a Probability Function, and P(A) is called the probability of the event A if the following hold: u u A ∪ C = {2, 3, 4, 5, 6} Event that an odd prime number occurs, B ∩ C = {3, 5} Event that a prime number does not occurs, C’={1, 4, 6} CS218 © Peter Lo 2004 CS218 © Peter Lo 2004 Theorems of Probability The sample space S consist of the 6 possible numbers, S = {1, 2, 3, 4, 5, 6} u Event that an even number occurs, A = {2, 4, 6} u D or E, (D ∪ E): u Ace or Red card from bridge deck 7 u u For every event A, 0 ≤ P(A) ≤ 1 P(S) = 1 If A and B are mutually exclusive events, then P(A ∪ B) = P(A) + P(B) If A1, A2, … is a sequence of mutually exclusive events, then P(A1 ∪A2 ∪ … ) = P(A1) + P(A2) + … CS218 © Peter Lo 2004 8 2 Theorems of Probability Type of Sample Spaces n n For two events A and B, u P (∅) = 0 u P(A’) = 1 – P(A) u If A ⊆ B, then P(A) ≤ P(B) u P(A\B) = P(A) – P(A∩B) u P(A∪B) = P(A) + P(B) – P(A∩B) CS218 © Peter Lo 2004 n 9 Finite Probability Spaces u A finite probability space is one in which the set S contains a finite number of elements. Finite Equiprobable Spaces u A probability space is equiprobable if it is finite and the probability mass are all equal. CS218 © Peter Lo 2004 Example Example n n Three horses A, B, and C are in a race; A is twice as likely to win as B and B is twice as likely to win as C. What are their respective probabilities of winning, i.e. P(A), P(B) and P(C)? CS218 © Peter Lo 2004 11 10 Let a card be selected at random from an ordinary pack of 52 cards. Let A= {the card is a spade} and B = {the card is a face card}. What is P(A), P(B) and P(A∩B)? CS218 © Peter Lo 2004 12 3 Probability of Simple Event Conditional Probability n n P(Event) = X / T u X = number of outcomes in which the event occurs u T = total number of possible events P(B | A) = n 100 Parts Inspected, 2 Defects! CS218 © Peter Lo 2004 The conditional probability that B occurs, given that A occurred, is defined by 13 Example P( A ∩ B) P( A) Chain Rule for Conditional Probabilities CS218 © Peter Lo 2004 14 Multiplication Theorem n For any events, A1, A2, … An, P(A 1∩A2∩ … ∩An) = P(A1)P(A2|A1)P(A3 |A1∩A2)… P(A n|A1∩A2∩ … ∩An-1) CS218 © Peter Lo 2004 15 CS218 © Peter Lo 2004 16 4 Joint Probability Using Contingency Table Example n A lot contains 12 items of which 4 are defective. Three items are drawn at random from the lot one after the other. Find the probability p that all three are not defective. Event Event B1 P(A 1 ∩ B1) P(A 1 ∩ B2) P(A 1) A2 P(A 2 ∩ B1) P(A 2 ∩ B2) P(A 2) Joint Probability 17 Find the probability for a joint event that a female, and age under 20 is drawn. <20 Simple Event >20 Total Female 47 16 63 Male 45 22 67 Total 92 38 130 S = {F,<20; F,>20; M,<20; M,>20} CS218 © Peter Lo 2004 P(B 1) P(B 2) 1 Marginal (Simple) Probability CS218 © Peter Lo 2004 18 Stochastic Process & Tree Diagrams Example n Total A1 Total CS218 © Peter Lo 2004 B2 Count Total Sample Space 19 n n A (Finite) sequence of experiments in which each experiment has a finite number of outcomes was given probabilities is called a (finite) Stochastic Process. A convenient way of describing such a process and computing the probability of any event is by a Tree Diagram. CS218 © Peter Lo 2004 20 5 Example Independence n n Find the probability of selecting 2 pens from 20 pens which 14 in blue and 6 in red and not replace. P(R) = 6/20 P(B) = 14/20 CS218 © Peter Lo 2004 P(R|R) = 5/19 R P(B|R) = 14/19 P(R|B) = 6/19 B R P(B|B) = 13/19 B R B 21 Example n An event B is said to be independent of an event A if the probability that B occurs is not influenced by whether A has or has not occurred. u Event A and B are independent if t P(A∩B) = P(A)P(B); u Otherwise they are dependent. CS218 © Peter Lo 2004 22 Answer Let a fair coin be tossed three times; we obtain the equiprobable space S= {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}. Consider the events A = {first toss is heads}, B = {second toss is heads}, C = {exactly two heads are tossed in a row}. Show that A and B and A and C are independent events, and that B and C are dependent events. CS218 © Peter Lo 2004 23 CS218 © Peter Lo 2004 24 6 Repeated Trials Example n n Let S be a finite probability space. By nIndependent or Repeated Trials, we mean the probability space T consisting of ordered n-tuples of elements of S with the probability of an n-tuple defined to be the product of the probabilities of its components: u P(S1, S2 , … , Sn) = P(S1)P(S2) … P( Sn) CS218 © Peter Lo 2004 25 Random Variables n Whenever three horses a, b, and c race together, their respective probabilities of winning are 1/2, 1/3 and 1/6. In other words, S = {a, b, c} with P(a) = 1/2, P(b) = 1/3 and P(c) = 1/6. If the horses race twice, what is the probability of horse a winning the first race and horse c winning the second race? Random Variables 26 Distribution A Random Variable X is a rule that assigns a numerical value to each outcome in a sample space S. Experiment CS218 © Peter Lo 2004 Event: Toss 2 Coins. Count No. of Tails. Probability Distribution Values, Xi Probabilities, P(Xi) Possible Values Make 100 Sales Calls No. of Sales 0, 1, 2, ... , 100 0 1/4 = .25 Inspect 70 Radios No. of Defective 0, 1, 2, ... , 70 1 2/4 = .50 2 1/4 = .25 Answer 33 Questions No. of Correct 0, 1, 2, ... , 33 Count Cars at Toll between 11:00 & 1:00 No. of Car Arriving 0, 1, 2, ... , n CS218 © Peter Lo 2004 27 CS218 © Peter Lo 2004 28 7 Expectation Example n n n Expected Value u Mean of Probability Distribution u Weighted Average of All Possible Values u µ = E(X) = ΣXi P(Xi ) Variance u Weighted Average Squared Deviation about Mean u σ2 = E[ (Xi − µ)2 ] = Σ (Xi − µ)2 P(Xi ) CS218 © Peter Lo 2004 29 Answer n n n n n In a game a player is paid $5 if he gets all heads or all tails when three coins are tossed, and he will pay out $3 if either one or two heads show. What is his expected gain (or loss) per game? CS218 © Peter Lo 2004 30 Example Three coins are tossed, the sample space u S = {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}. Assume unbiased coins, so any one of these eight outcomes have equal chance of, say, u P(HHT) = P(H)P(H)P(T) = (1/2)*(1/2)*(1/2) = 1/8. Let E1 = {HHH, TTT}, and E2 = {the other 6 outcomes}. u P{E1} = 1/8 + 1/8 = 1/4, and P{E2} = 1- 1/4 = 3/4. It follows that the expected value is u µ = $5*(1/4) - $3*(3/4) = -$1. So the player is expected to lose one dollar per game. CS218 © Peter Lo 2004 31 CS218 © Peter Lo 2004 32 8 Answer Example n CS218 © Peter Lo 2004 33 Answer CS218 © Peter Lo 2004 34 Binomial Distribution Properties f ( x) = n C x4C 33−x C 37 n n n n CS218 © Peter Lo 2004 A lot containing 7 components is sampled by a quality inspector; the lot contains 4 good components and 3 defective ones. A sample of 3 is taken by the inspector. Find the expected value of the number of good components in this sample. 35 Two Different Sampling Methods u Infinite Population Without Replacement u Finite Population With Replacement Sequence of n Identical Trials Each Trial has 2 Outcomes u ‘Success’(Desired Outcome) or ‘Failure ’ Constant Trial Probability Trials are Independent CS218 © Peter Lo 2004 36 9 Binomial Probability Distribution Function n Probability of x successes Pick x from n ( k) P( X = k | n, p ) = P(X= n = p = k = n! k !( n − k )! n p k (1 − p )n − k A fair die is tossed 180 times. Find the expected number of sixes, and the standard deviation. Probability of (n-k) failures k | n,p) = probability that X = k given n & p sample size probability of ‘success’ number of ‘successes’in sample (X = 0, 1, 2, ..., n) CS218 © Peter Lo 2004 37 Example n Example 38 Bayes’Theorem Formula Toss 1 Coin 4 times in a row. What’s the Probability of 3 tails? P( X = x | n, p ) = P( X = 3 | 4,.5 ) = CS218 © Peter Lo 2004 CS218 © Peter Lo 2004 n! x !(n − x )! 4! 3 !( 4 − 3 )! = .25 P(Bi | A) = p x (1 − p ) n − x = .5 3 (1−.5 )4 − 3 P(A | Bi ) ⋅ P(Bi ) P(A | B1 ) ⋅ P(B1) + L + P(A | Bk ) ⋅ P(Bk ) P(Bi ∩ A) P(A) All Bi ’s are the same event (e.g. B 2)! Same Event 39 CS218 © Peter Lo 2004 40 10 Example n n A box contains 12 items of which 4 are in red color. Three items are drawn at random from the box one after the other. Find the probability that all three are not in red color. Probability = (8/12)(7/11)(6/10) = 14/55 CS218 © Peter Lo 2004 41 11