CSI 23 LECTURE NOTES (Ojakian) Topics 5 and 6: Probability Theory 1. Probability Theory OUTLINE (References: 5.1, 5.2, 6.1, 6.2, 6.3) 2. Compound Events (using Complement, And, Or) 3. Conditional Probability 4. Independence 5. Probability Distributions 6. Binomial Distribution 1. Intro and Recall (a) Probability: The science of chance events. (b) Probability of an event: A measure of how likely it is using a number between 0 and 1. (c) Typical assumption: Equally Likely Outcomes. Unless otherwise stated, we will assume this! PROBLEM 1. Suppose you roll a 6-sided die (with numbers 1 through 6). i. What is the probability of rolling a 5? ii. What is the probability of rolling a number greater than 4? 2. Fundamental Terminology (a) Sample Space: The set of all possible outcomes. (b) Event: A subset of the sample space. (c) If A is an event then P(A) is: The probability of A happening. outcomes within the event (d) P (A) = total number of outcomes PROBLEM 2. Re-do above problem with this terminology. PROBLEM 3. Do guilded exercise 2 from ch. 5 (of 5th edition, p.161). *PROBLEM* 4. Consider rolling two 4-sided dice, with numbers 1, 2, 3, 4 on their faces. i. Write down the sample space. ii. Determine P(both dice are even). iii. Determine P(at least one die is even) 1
3. Real World Probabilities When not assuming Equally Likely Outcomes, how do we guess probabilities?... Relative frequency approach. (a) Take a sample, then estimate: P (A) = number of outcomes within A size of sample PROBLEM 5. Using our class as a sample, find the probability of being an only child. PROBLEM 6. Section 5.1 - Exercises 7 and 8 (wiggle your ears, raise one eyebow) (b) Death statistics: What do you fear most? What should we fear most? 4. Operations on Events PROBLEM 7. Consider a 4-sided die. Sum the probabilities of all the outcomes. *PROBLEM* 8. In general, if you sum the probabilities of all the outcomes in a sample space, what is the answer? (a) Complement Operation PROBLEM 9. Consider a 6-sided die. Let A be the event: rolling a 5 or larger. Determine the following: P (A) and P (A c ). *PROBLEM* 10. In general, what is the relationship between P (A) and P (A c )? (b) And Operation (Intersection of events) PROBLEM 11. Consider a 6-sided die which you roll once. i. Let A be the event: The roll is even. Let B be the event: The roll is less than 5. Find P (A and B). ii. Find P(Even and Odd) (c) Or Operation (Union of events) *PROBLEM* 12. Do the last problem, but replace the word and by the word or. *PROBLEM* 13. Consider the following attempt at a rule: P (A or B) = P (A)+ P (B). Is the rule true or false? Use some examples to get evidence of your view. PROBLEM 14. Create a proper rule for P (A or B). PROBLEM 15. You roll two fair 4-sided dice, one green and one blue. i. What is the probability of getting a sum of 3? ii. What is the probability of getting a sum of 6? iii. What is the probability of getting a sum of 3 or 6? iv. What is the probability of getting a sum of 6 or having at least one of the die being a 4. 5. Conditional Probability P (A B): Probability of event A happening given that event B happens. (a) Informal Idea (via examples) 2
i. P(Dying of esophageal cancer Live in USA) = 0.00004 P(Dying of esophageal cancer Live in Central Asia) = 0.00140 ii. P(Dying of lung cancer Male and smoker) is 22 times larger than P(Dying of lung cancer). iii. Recent vaccines decreased the chance of dying from the flu by 56 percent. Express this statement using conditional probabilities. (b) Mathematical Examples. To find P (A B), limit yourself to the outcomes in B and count how many of them are in A. PROBLEM 16. Suppose you flip a fair coin three times. i. What is the probability of 3 heads? ii. What is the probability of 3 heads given that at least two flips are heads? iii. Calculate P(Exactly two heads At least one tail). (c) Mathematical Formula. P (A and B) P (A B) = P (B) PROBLEM 17. Do ones from the last problem, using the formula. 6. Independence (a) Intuition: Two events are independent if the occurrence or nonoccurrence of one event does not change the probability that the other event will occur. i. Intuitive Examples: Independent or not? A. It rains in Manhattan versus It rains in The Bronx. B. It rains in Manhattan versus It rains in San Juan. ii. Mathematical Examples. Independent or not? A. Roll a blue die and a red die. The blue die being 5 versus The red die being 2. B. Roll one die: Rolling a two versus Rolling an even number. C. Roll one die: Rolling an odd number versus Rolling an even number. (b) Mathematical Definition. Two events A and B are independent if P (A and B) = P (A) P (B) PROBLEM 18. Roll one die one time. Let A be: The value is 2. Let B be: The value is an even number. Are A and B independent or not? PROBLEM 19. Use the fact that the roll of one die is independent of the roll of another die. Suppose two dice are rolled, one blue and one red; what is the probability that the blue die is a 3 and the red die is a 5? PROBLEM 20. Suppose two dice are rolled; what is the probability that one die is a 3 and the other die is a 5? *PROBLEM* 21. Suppose a die is rolled three times; what is the probability that the first roll is a 3, the second roll is a 1, and the final roll is a 1? (c) Why the definition makes sense. If B has no effect on A, then P (A B) = P (A). And then what...? 3
7. Probability Distributions A (discrete) probability distribution for a sample space is a function which assigns a non-negative real number to every outcome of the sample space, so that the sum of the function values is 1. (a) Examples i. Create a biased die with 4 sides... And simulate some rolls using RAND in Excel. ii. Example (http://econ.ucsb.edu/~doug/240a/coin%20flip.htm) Spin a coin: 50-50 chance of heads-tails? NO! For some coins, P(Heads) = 0.2 and P(Tails) = 0.8. iii. Uniform Distribution (b) Representing a probability distribution with a histogram. (c) Expectation of probability distributions Like the mean, except that now instead of dividing at the end, we multiply each outcome by its probability. If you repeatedly carry out the random experiment and find the average, it should be close to the expectation. PROBLEM 22. Consider the above biased die. What is the expectation? Now simulate 15 rolls of this die and find the average (using RAND in Excel). Is the average close to the expectation? 8. Binomial Distribution (a) Binomial Experiment Example i. Flip the same coin 3 times and count the number of heads (biased so probability of heads is 0.2). What is the probability of all heads? What is the probability of 2 heads? Etc? Draw a histogram of the distribution. ii. Parameters/Terminology n = number of trails p = probability of success q = probability of failure r = number of successes iii. Using Excel iv. A. BINOM.DIST(r, n, p,false): For probability of exactly r successes. B. BINOM.DIST(r, n, p,true): For probability of r or fewer successes. PROBLEM 23. Use Excel to verify the above calculations. PROBLEM 24. Use Excel for this question. From Section 6.2 (5th edition), do problem 14. Also answer these questions: A. What is the probability that exactly 3/4 of the men are wearing their ties too tight? B. What is the probability that at least 3/4 of the men are wearing their ties too tight? (b) Key formula P (r successes ) = C n,r p r q n r, where n! C n,r = = number of subsets of S of size r (S is any set with n elements). r! (n r)! 4
PROBLEM 25. Calculate the following: i. (0.4) 3 ii. 3! iii. 1! iv. 0! v. 5 (10 8)! vi. C 3,2 *PROBLEM* 26. Calculate the following: i. (0.1) 4 ii. 4! iii. C 4,1 PROBLEM 27. Use the formula to calculate some of the above probabilities by hand. *PROBLEM* 28. From Section 6.2, do problem 15. Do it by hand, and using Excel. (c) Expectation of binomial distribution Expectation = np PROBLEM 29. Steve Nash has the highest career foul shooting percentage of 90.4% (stats based on the last time I checked...). i. If he shoots 100 foul shots, how many do we expect to go in? ii. If he shoots 25 foul shots, how many do we expect to go in? iii. Do a simulation of 25 foul shots in Excel using RAND, to see how many go in. How close is the simulation to the expected value? 5