Intro to Probability Martina Litschmannov martina litschmannovavsb cz
Intro to Probability Martina Litschmannová martina. litschmannova@vsb. cz EA 538
Probability basics
Statistical (random) experiment A random experiment is an action or process that leads to one of several possible outcomes. For example: Experiment Outcomes Flip a coin Heads, Tails Exam Marks Numbers: 0, 1, 2, . . . , 100 Assembly Time t > 0 seconds Course Grades F, D, C, B, A, A+
Statistical (random) experiment All statistical experiments have three things in common: § The experiment can have more than one possible outcome. § Each possible outcome can be specified in advance. § The outcome of the experiment depends on chance.
Probability Terminology •
Probability Terminology •
Types of Events § Two events are mutually exclusive if they have no sample points in common. § Two events are independent when the occurrence of one does not affect the probability of the occurrence of the other.
Requirements of Probabilities •
Approaches to Assigning Probabilities •
Classical Approach If an experiment has n possible outcomes (all equally likely to occur), this method would assign a probability of 1/n to each outcome.
1. You are rolling a fair die. What is the probability that one will fall? •
2. • What about randomly selecting a student from this class and observing their gender?
3. Experiment: Rolling 2 (fair) die (dice) and summing 2 numbers on top. • 1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 10 11 12
3. Experiment: Rolling 2 (fair) die (dice) and summing 2 numbers on top. • 1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 10 11 12
3. Experiment: Rolling 2 (fair) die (dice) and summing 2 numbers on top. • 1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 10 11 12
3. Experiment: Rolling 2 (fair) die (dice) and summing 2 numbers on top. • 1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 10 11 12
3. Experiment: Rolling 2 (fair) die (dice) and summing 2 numbers on top. • 1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 10 11 12
3. Experiment: Rolling 2 (fair) die (dice) and summing 2 numbers on top. • 1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 10 11 12
Relative Frequency Approach 4. Computer Shop tracks the number of desktop computer systems it sells over a month (30 days): For example, 10 days out of 30 2 desktops were sold. Desktops Sold # of Days 0 1 1 2 2 10 3 12 4 5 From this we can construct the “estimated” probabilities of an event (i. e. the # of desktop sold on a given day).
Relative Frequency Approach… Desktops Sold [X] # of Days 0 1 1 2 2 10 3 12 4 5 Desktops Sold probabilities
Relative Frequency Approach… Desktops Sold [X] # of Days 0 1 1 2 2 10 3 12 4 5 30 Desktops Sold probabilities
Relative Frequency Approach… Desktops Sold [X] # of Days 0 1 1 2 2 10 3 12 4 5 30 Desktops Sold probabilities
Relative Frequency Approach… Desktops Sold [X] # of Days 0 1 1 2 2 10 3 12 4 5 30 Desktops Sold probabilities
Relative Frequency Approach… Desktops Sold [X] # of Days 0 1 1 2 2 10 3 12 4 5 30 Desktops Sold probabilities 1, 00
Relative Frequency Approach… Desktops Sold [X] # of Days 0 1 1 2 2 10 3 12 4 5 30 Desktops Sold probabilities 1, 00 There is a 40% chance Computer Shop will sell 3 desktops on any given day (Based on estimates obtained from sample of 30 days).
Subjective Approach In the subjective approach we define probability as the degree of belief that we hold in the occurrence of an event. For example: § P(you drop this course) § P(NASA successfully land a man on the moon) § P(girlfriend/boyfriend says yes when you ask her to marry you)
Events & Probabilities •
Events & Probabilities •
Interpreting Probability One way to interpret probability is this: If a random experiment is repeated an infinite number of times, the relative frequency for any given outcome is the probability of this outcome. For example, the probability of heads in flip of a balanced coin is 0, 5, determined using the classical approach. The probability is interpreted as being the long-term relative frequency of heads if the coin is flipped an infinite number of times.
Joint, Marginal and Conditional Probability •
5. Why are some mutual fund managers more successful than others? One possible factor is where the manager earned his or her MBA. The following table compares mutual fund performance against the ranking of the school where the fund manager earned their MBA: Where do we get these probabilities from? Mutual fund outperforms the market Mutual fund doesn’t outperform the market Top 20 MBA program . 11 . 29 Not top 20 MBA program . 06 . 54 E. g. This is the probability that a mutual fund outperforms AND the manager was in a top 20 MBA program; it’s a joint probability [intersection].
Alternatively, we could introduce shorthand notation to represent the events: A 1 = Fund manager graduated from a top-20 MBA program A 2 = Fund manager did not graduate from a top-20 MBA program B 1 = Fund outperforms the market B 2 = Fund does not outperform the market 0, 11 0, 29 0, 06 0, 54
Marginal Probabilities Marginal probabilities are computed by adding across rows and down columns; that is they are calculated in the margins of the table: 0, 11 0, 29 0, 06 0, 54
Marginal Probabilities Marginal probabilities are computed by adding across rows and down columns; that is they are calculated in the margins of the table: 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83
Marginal Probabilities Marginal probabilities are computed by adding across rows and down columns; that is they are calculated in the margins of the table: 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00 BOTH margins must add to 1 (useful error check)
Marginal Probabilities Marginal probabilities are computed by adding across rows and down columns; that is they are calculated in the margins of the table: 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00 What’s the probability a fund manager isn’t from a top school?
Marginal Probabilities Marginal probabilities are computed by adding across rows and down columns; that is they are calculated in the margins of the table: 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00 What’s the probability a fund manager isn’t from a top school?
Marginal Probabilities Marginal probabilities are computed by adding across rows and down columns; that is they are calculated in the margins of the table: 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00 What’s the probability a fund outperforms the market?
Marginal Probabilities Marginal probabilities are computed by adding across rows and down columns; that is they are calculated in the margins of the table: 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00 What’s the probability a fund outperforms the market?
Conditional Probability •
Rule of Multiplication •
6. What’s the probability that a fund will outperform the market given that the manager graduated from a top-20 MBA program? • 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00
6. What’s the probability that a fund will outperform the market given that the manager graduated from a top-20 MBA program? • 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00
6. What’s the probability that a fund will outperform the market given that the manager graduated from a top-20 MBA program? 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00 Thus, there is a 27, 5% chance that a fund will outperform the market given that the manager graduated from a top-20 MBA program.
Independence •
Independence • 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00
Union 7. Determine the probability that a fund outperforms (B 1) or the manager graduated from a top-20 MBA program (A 1). 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00
Rule of addition 7. Determine the probability that a fund outperforms (B 1) or the manager graduated from a top-20 MBA program (A 1). 0, 11 0, 29 0, 40 0, 06 0, 54 0, 60 0, 17 0, 83 1, 00
Probability Rules and Trees •
8. A graduate statistics course has seven male and three female students. The professor wants to select two students at random to help her conduct a research project. What is the probability that the two students chosen are female? •
9. The professor in last example is unavailable. Her replacement will teach two classes. His style is to select one student at random and pick on him or her in the class. What is the probability that the two students chosen are female? (Both classes have 3 female and 7 male students. ) •
10. In a large city, two newspapers are published, the Sun and the Post. The circulation departments report that 22% of the city’s households have a subscription to the Sun and 35% subscribe to the Post. A survey reveals that 6% of all households subscribe to both newspapers. What proportion of the city’s households subscribe to either newspaper? That is, what is the probability of selecting a household at random that subscribes to the Sun or the Post or both? •
Probability Trees [Decision Trees] A probability tree is a simple and effective method of applying the probability rules by representing events in an experiment by lines. The resulting figure resembles a tree. This is P(F 1), the probability of selecting a female student first. First selection ) P(F 1 P( M This is P(F 2|F 1), the probability of selecting a female student second, given that a female was already chosen first. 10 / 3 = 1) = 7 F 1 M 1 /10 Second selection /9 =2 ) F | 1 P(F 2 P( M 2 |F 1 ) ) M 1 | F 2 P( P( M F 2 = 7/9 M 2 = 3/9 2 |M ) 1 F 2 = 6/9 M 2
Probability Trees (Decision Trees) At the ends of the “branches”, we calculate joint probabilities as the product of the individual probabilities on the preceding branches. First selection (F 1) P P( M 10 / 3 = 1) F 1 = 7/ M 1 10 Second selection |F 1) F 2 ( P F 2 = 2/9 M 2 P( M |F 2 1 ) = 7/9 F 2 9 = 3/ ) |M 1 P(F 2 M 2 P( M 2 |M ) 1 = 6/9 Joint probabilities
Probability Trees Note: there is no requirement that the branches splits be binary, nor that the tree only goes two levels deep, or that there be the same number of splits at each sub node…
11. Law school grads must pass a bar exam. Suppose pass rate for first-time test takers is 72%. They can re-write if they fail and 88% pass their second attempt. What is the probability that a randomly grad passes the bar?
11. Law school grads must pass a bar exam. Suppose pass rate for first-time test takers is 72%. They can re-write if they fail and 88% pass their second attempt. What is the probability that a randomly grad passes the bar? First exam Second exam 1) s s Pa 72 , 0 = P( P( F a 8 il 1) = , 8 0 = ) |Fail 1 ss 2 a P ( 0, 28 P P( F ail 2| Fa il 1) = 0, 12
Bayes’ Law • P(B|A) P(A|B) for example …
Breaking News: New test for early detection of cancer has been developed. •
12. Clinical trials indicate that the test is accurate 95% of the time in detecting cancer for those patients who actually have cancer, but unfortunately will give a “+” 8% of the time for those patients who are known not to have cancer. It has also been estimated that approximately 10% of the population have cancer and don’t know it yet. You take the test and receive a “+” test results. Should you be worried?
12. Clinical trials indicate that the test is accurate 95% of the time in detecting cancer for those patients who actually have cancer, but unfortunately will give a “+” 8% of the time for those patients who are known not to have cancer. It has also been estimated that approximately 10% of the population have cancer and don’t know it yet. You take the test and receive a “+” test results. Should you be worried? ) P( C 10 , 0 = C C P(+| )= P( - | C ) = 0, 95 0, 05 + - Joint probabilities Test Cancer
Bayesian Terminology •
Students Work – Bayes Problem
1. Transplant operations for hearts have the risk that the body may reject the organ. A new test has been developed to detect early warning signs that the body may be rejecting the heart. However, the test is not perfect. When the test is conducted on someone whose heart will be rejected, approximately two out of ten tests will be negative (the test is wrong). When the test is conducted on a person whose heart will not be rejected, 10% will show a positive test result (another incorrect result). Doctors know that in about 50% of heart transplants the body tries to reject the organ. *Suppose the test was performed on my mother and the test is positive (indicating early warning signs of rejection). What is the probability that the body is attempting to reject the heart? *Suppose the test was performed on my mother and the test is negative (indicating no signs of rejection). What is the probability that the body is attempting to reject the heart?
3. Marie is getting married tomorrow, at an outdoor ceremony in the desert. In recent years, it has rained only 5 days each year. Unfortunately, the weatherman has predicted rain for tomorrow. When it actually rains, the weatherman correctly forecasts rain 90% of the time. When it doesn't rain, he incorrectly forecasts rain 10% of the time. What is the probability that it will rain on the day of Marie's wedding?
- Slides: 66