560 likes | 734 Views
STT 315. Ashwini Maurya. This lecture note is based on Chapter 3. Acknowledgement: Author is thankful to Dr. Ashok Sinha, Dr . Jennifer Kaplan and Dr. Parthanil Roy for allowing him to use/edit some of their slides. Some terminologies.
E N D
STT 315 Ashwini Maurya This lecture note is based on Chapter 3 Acknowledgement: Author is thankful to Dr. Ashok Sinha, Dr. Jennifer Kaplan and Dr. Parthanil Roy for allowing him to use/edit some of their slides.
Some terminologies Probability is used to infer probable feature(s) of sample taken from a population. • An experimentis an action that leads to one of several possible outcomes. • An outcome of an experiment is also called a sample point. • The collection of all possible outcomes (i.e. sample points) of an experiment is known as sample space[will be mostly denoted by S]. • An eventis a subset of the sample space with which we can attach a probability. • We say “the event A occurred” if an outcome from Aresulted in the experiment.
Examples Suppose we toss a coin and observe the resulting face at the top. • Experiment: tossing the coin. • Sample points: Head (H) and Tail (T). • Sample space: S = {H, T}. • Events: {H}, {T}, {H,T} and Φ (the empty set). Suppose we throw a die and observe the resulting face at the top. • Experiment: throwing the die. • Sample points: 1, 2, 3, 4, 5 and 6. • Sample space: S = {1, 2, 3, 4, 5, 6}. • Events: any subset of S, e.g. {1}, or {2,4,6}, {3, 4, 5, 6} etc.
Modeling Probability • Suppose you have a fair/unbiased coin (i.e., a coin with equal chance of getting a head or a tail). Question: If you toss a fair coin, what is the chance of getting a head? Answer: 50% = ½.
Modeling Probability • Suppose you have a fair/unbiased die (i.e., a die with equal chance of getting all the six numbers 1-6). Question: If you toss a fair die, what is the chance of getting a 5? Answer: 1/6.
Modeling Probability • Suppose you have a fair/unbiased die (i.e., a die with equal chance of getting all the six numbers 1-6). Question: If you toss a fair die, what is the chance of getting an even outcome (2 or 4 or 6)? Answer: 3/6 = ½ = 50%.
In General Number of outcomes in A P(A) = Total number of possible outcomes provided all the outcomes are equally likely. We typically denote events (whose probabilities are calculated) by capital letters A, B, C etc. Probability of an event A,
Example • Suppose you toss a fair coin twice. What is the probability that the two outcomes are different? All possible outcomes = {HH, HT, TH, TT}. Since the coin is fair, all the 4 outcomes are equally likely. Let A denote the event that the two outcomes are different. Then A = {HT, TH}. P(A)= 2/4 = ½ .
Example • Suppose you toss a fair coin twice. What is the probability that at least one head occurred? All possible outcomes = {HH, HT, TH, TT}. Since the coin is fair, all the 4 outcomes are equally likely. Let A denote the event that at least one had occurred. Then A = {HH, HT, TH}. P(A)= ¾.
Rules of Probability Basic rules: • Probability of any event is a number between 0 and 1, i.e. for any event A, i.e.,
Complement of a set The complement of an event A (denoted by Ac) is the event that A does not occur. Ac means “not A”.
An Example • Suppose that the probability that the traffic light is green on a crossing is 35%. What is the chance that the light is not green? P(not green) = 1-P(green) = 1 - 0.35 = 0.65.
Intersection of sets “A and B” denotes the event that A and B both occur, denoted by It consists of all outcomes that belong to both A and B.
Union of sets In this picture, “” is the complete colored region. “A or B” means either A occurs or B occurs or both occur (i.e., “or” means and/or). It is denoted by and is called “A union B”.
Example of and Suppose you toss a fair coin twice. Here S = {HH, HT, TH, TT}. Define A = second outcome is head = {HH, TH} and B = first outcome is tail = {TH, TT}. Then = {TH} = the first outcome is tail and the second outcome is head, and = {HH, TH, TT}.
Example of Suppose I pick a student at random from this class. Let A be the event that the chosen student is a vegetarian and B be the event that he/she is a junior. Suppose further that 6% of the students present in this class are vegetarians and 30% are juniors and only 2% are both junior and vegetarian. What is the chance that selected student is either a vegetarian or a junior?
Example of • Suppose I pick a student at random from this class. Let A be the event that the chosen student is a vegetarian and B be the event that he/she is a junior. • Suppose further that 6% of the students present in this class are vegetarians and 30% are juniors and only 2% are both junior and vegetarian. • What is the chance that selected student is either a vegetarian or a junior? • P(A or B) = P(A) + P(B) - P(A and B) = 0.06 + 0.30 - 0.02 = 0.34.
Another Example • A survey found out that 56% of MSU students live in a campus dorm, 62% participate in a campus meal program and 42% do both. • What is the probability that a randomly selected MSU student either lives on campus dorm or has a campus meal plan? Let L = {student lives on campus}, and M = {student has a campus meal plan}. P(either lives on campus or has a campus meal plan) = P(L or M) = P(L) + P(M) - P(L and M) = 0.56 + 0.62 - 0.42 = 0.76.
Another Example • A survey found out that 56% of MSU students live in a campus dorm, 62% participate in a campus meal program and 42% do both. • What is the probability that a randomly selected MSU student lives on campus but does not have a campus meal plan? Let L = {student lives on campus} and M = {student has a campus meal plan}. P(a student lives on campus but does not have a campus meal plan) = P[L and (not M)] = ?
Solve Using a Picture P[L and (not M)] = P(L) - P(L and M) = 0.56 - 0.42 = 0.14.
Similarly … P[M and (not L)] = P(M)-P(L and M) = 0.62-0.42 = 0.20. Therefore, there is a 20% chance that a randomly selected MSU student lives off campus but participates in a campus meal program.
Another Example • A survey found out that 56% of MSU students live in a campus dorm, 62% participate in a campus meal program and 42% do both. • What is the probability that a randomly selected MSU student neither lives on campus nor participates in a campus meal plan? Let L = {student lives on campus}, and M = {student has a campus meal plan}. P(neither lives on campus nor participates in a campus meal plan) = P(neither L nor M)= ?
Once again, use a picture P(neither L nor M) = P[not(L or M)] = 1 - P(L or M) = 1 - [P(L) + P(M) - P(L and M)] = 1 - (0.56 + 0.62 - 0.42) = 0.24.
Another Example • A survey found out that 56% of MSU students live in a campus dorm, 62% participate in a campus meal program and 42% do both. • What is the probability that a randomly selected MSU student either lives on campus or participates in a campus meal plan but not both? Let L = {student lives on campus}, and M = {student has a campus meal plan}. P(either lives on campus or participates in a campus meal plan but not both) = P(exactly one of L and M) = ?
Draw Picture Again! P(exactly one of L and M) = P[L and (not M)] + P[M and (not L)] = 0.14+0.20 = 0.34.
Disjoint Events Two events A and B are called disjoint or mutually exclusive if they can never occur together, i.e. (empty set). If A and B are disjoint then,
Example of Disjoint Events Suppose you toss a fair coin twice. Here S = {HH, HT, TH, TT}. Define A = both outcomes are head = {HH}, and B = first outcome is tail = {TH, TT}. Then A and B are disjoint because they can never occur together.
Independent Events Two events A and B are called independent if Roughly speaking, this means that the occurrence (or non-occurrence) of A has nothing to do with the occurrence (or non-occurrence) of B.
Example of Independent Events Suppose you toss a fair coin twice. Here S = {HH, HT, TH, TT}. Define A = second outcome is head = {HH, TH}, and B = first outcome is tail = {TH, TT}. Then A and B = {TH} and P(A and B)= ¼ while P(A) = P(B) = 2/4 = ½ and therefore P(A and B) = ¼ = ½ × ½ =P(A)P(B), which means A and B are independent.
Disjoint and Independent • Suppose A and B are two events. • If A and B are disjointthen • On the other hand, A and B are independent if
Disjoint and Independent • If two events A and B are disjoint then can they be independent as well? Ans: Only if either P(A)=0, or P(B)=0, or both. This is because if A and B are disjoint and independent then and hence either P(A)=0, or P(B)=0, or both.
Disjoint and Independent: An Example Suppose a word is chosen at random from the sentence “Dave loves cupcakes” and then a letter is selected at random from the chosen word. Suppose A is the event that the word “cupcakes” is chosen and B is the event that the letter “v” is selected. Then A and B are • independent, • disjoint. • neither.
Disjoint and Independent: Another Example Suppose a fair coin is tossed twice. Suppose A = head occurs in the first toss and B = head occurs in the second toss. Then A and B are • independent, • disjoint. • neither.
Application of Independence If it is known that two events A and B are independent only then we can calculate P(A and B) as follows: . Sometimes the independence of A and B is assumed implicitly although it is not explicitly stated.
Example • If the probability that one will encounter a red light in a traffic signal is 0.61 then find the probability that you will find the light to be red on both Monday and Tuesday. Here “red on Monday” and “red on Tuesday” are implicitly assumed to be independent. Therefore, P(red on Monday and red on Tuesday) =P(red on Monday) × P(red on Tuesday) =(0.61) × (0.61) = 0.3721.
More on Independence More than two events can also be independent. For example if 4 events A, B, C, D are independent then P(A B C D) = P(A)P(B)P(C)P(D). Just as in the case of two events, the independence of 4 events may not always be stated explicitly.
Harder Example • If the probability that one will encounter a red light in a traffic signal is 0.61 then find the probability that you will have to stop in a red light at least once during the work week? P(at least one red in 5 days of a week) =1 – P(no red in 5 days of a week) =1 – P[(no red on Monday) and (no red on Tuesday) and (no red on Wednesday) and (no red on Thursday) and (no red on Friday)] =1 – (0.39) × (0.39) × (0.39) × (0.39) × (0.39) =0.991.
Example Suppose a letter is chosen at random from the sentence “Dave loves cupcakes”. What is the probability that the letter “v’’ will be selected? There are total 17 letters and two of them are “v”. So P(“v” is selected) = 2∕17 = 0.118.
Some Formulas Given two events A and B. Probability at least one of A or B occurs =P(A U B) Probability that both A “and” B occurs =P(A “and” B) Probability Exactly one of A or B occurs =P(A “ and” not B) + P( not A “and” B) Probability of Neither of A nor B =P( not A “and” not B)=1-P(AUB) In general, Probability of at least 1 of A and B =1-P( None of A “and” B)
Example A consumer organization estimates that over a 1-year period 19% of the cars will need to be repaired once, 12% will need repairs twice, 5% will require three of more repairs. Suppose two cars are chosen at random. What is the probability that: • Neither will need repair ? • Both will need repair ? • At least one car will need repair ? • Exactly 1 need repair ?
Conditional Probability And Bayes’ Rule
Conditional Probability Consider the below example: Example 1:What is probability that you get a “5” in single throw of a die. Example 2: If I tell you, that the number is odd, what is probability that the number is “5” ? Why these two probabilities are different ? Since the later, we have more information and we condition the known information to get the outcome. It maximizes the event outcome. Definition: Probability of An event “A” given event “B” is given by P(A/B)=P(A and B) / P(B) Another example : What is probability that tomorrow’s whether is rainy ? What is tomorrow’s weather if if I tell you today’s weather sunny ?
Example Toss a fair coin thrice. A = at least two heads = {HHH,HHT,HTH,THH}, B = all three are heads = {HHH}. Hence, P(A) = and P(B) = What is P(B|A)? What is P(A|B)? Here . So and
Multiplication rule From the definition of conditional probability that P(A ∩ B) = P(B) P(A|B) = P(A) P(B|A). For events A, B and C we have P(A ∩ B ∩ C) = P(A) P(B|A) P(C| A∩B). It can be extended similarly to larger number of events.
Example Suppose a letter is chosen at random from the sentence “Dave loves cupcakes”. What is the probability that the letter “v’’ will be selected? There are total 17 letters and two of them are “v”. So P(“v” is selected) = 2∕17 = 0.118.
Example Suppose first a word is chosen at random from the sentence “Dave loves cupcakes” and then a letter is selected at random from the chosen word. What is the probability that the letter “v’’ will be selected? Here it depends on which word is selected first. • P(“v” | “Dave”) = P(“v” is selected, under the condition that “Dave” is selected first) = ¼ = 0.25. P(“v” | “Dave”) is the conditional probability of selecting “v” given that “Dave” is selected first. • P(“v” | “loves”) = P(“v” is selected, under the condition that “loves” is selected first) = 1∕5= 0.2. • P(“v” | “cupcakes”) = 0.
Example Suppose first a word is chosen at random from the sentence “Dave loves cupcakes” and then a letter is selected at random from the chosen word. What is the probability that the letter “v’’ will be selected? So we found that the chance of selecting “v” is NOT independent of the words selected first. In this case, P(“Dave” and “v” are selected) = P(“Dave” is selected first) P(“v” | “Dave”) = ⅓ × ¼ = 1∕12. Similarly, P(“loves” and “v” are selected) = ⅓ × 1∕5 = 1∕15, and P(“cupcakes” and “v” are selected) = ⅓ × 0 = 0. So P(“v” is selected) = 1∕12 + 1∕15 + 0 = 0.15. The computation is easily understood with the following tree diagram.
Example Suppose a word is chosen at random from the sentence “Dave loves cupcakes” and then a letter is selected at random from the chosen word. What is the probability that the letter “v’’ will be selected? ⅓ ⅓ ⅓ Dave loves cupcakes ¼ ¾ 1/5 4/5 1 0 v not “v” not “v” v v not “v” P(“v” is selected) = ⅓ × ¼ + ⅓ × 1∕5+ ⅓ × 0 =0.15.