Bernoulli Trials and Binomial Distribution Sec 4.4-4.5 Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Department of Mathematics University of Houston Lecture 10-3339 Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10 ) - 3339 1 / 16
Outline 1 Bernoulli Random Variables 2 Binomial Distribution Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10 ) - 3339 2 / 16
Review Questions The following is a probability distribution: X -10 10 Probability 0.4 0.6 1. Determine the expected value (mean) of this probability distribution. a) 0 b) 2 c) -2 d) 10 2. Determine the variance of this probability distribution. a) 20 b) 100 c) 96 d) 0 Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10 ) - 3339 3 / 16
Review Questions Suppose a random variable X has a mean of 20, E(X) = 20 and standard deviation of 5, SD(X) = 5. We have a new random variable Y, where Y = 3X + 10. 3. What is the mean (epxected value) of Y? a) 20 b) 70 c) 60 d) 30 4. What is the standard deviation of Y? a) 15 b) 25 c) 75 d) 5 Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10 ) - 3339 4 / 16
Introduction Question Wallen Accounting Services specializes in tax preparation for individual tax returns. Data collected from past records reveals that 9% of the returns prepared by Wallen have been selected for audit by the Internal Revenue Service (IRS). 1. What is the probability that a customer of Wallen will be selected for audit? a. 0.09 b. 0.91 c. 1 d. 0 2. What is the probabiity that a customer is not selected for audit? a. 0.09 b. 0.91 c. 1 d. 0 Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10 ) - 3339 5 / 16
Bernoulli Random Variable A Bernoulli random variable has only two possible values, usually desginated as 1 and 0. Suppose we look at the i th cusotmer of Wallen Accounting services. Let X be the random variable that indicates that the customer is selected for audit. Thus X = 1 is the customer is selected for audit, X = 0 if not seclected for audit. Selected for audit is the "success" and not selected for audit is "failure." The probabiity of succes is p and the probabiltiy of failure is 1 p. e.g. a coin is flipped (heads or tails), someone is either audited or not audited, p = 0.09, 1 - p = 0.91. Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10 ) - 3339 6 / 16
Probability Function for Bernoulli Variable p, if x = 1 f (x) = P(x) = 1 p, if x = 0 0, if x 0, 1 A compact way of writing this is: f (x) = P(x) = p x (1 p) 1 x Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10 ) - 3339 7 / 16
The Bernoulli Process The Bernoulli process must possess the following properties: 1. The experiment consists of n repeated trials. 2. Each trial in an outcome that may be classified as a sucess or failure. 3. The probability of success, denoted by p, remains constant from trial to trial. 4. The repeated trials are independent. Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10 ) - 3339 8 / 16
Audit Example Today, Wallen has six new customers. Assume the chances of these six customers being audited are independent. This is a sequence of Bernoulli trials. We are interested in calculation the probabiltiy of obtaining a certian number of people being selected for audit. Let X i indicate the i th customer being selected for audit. Let Y = X 1 + X 2 + X 3 + X 4 + X 5 + X 6. What does Y represent? What is the probability that Y = 0? What is the probabiltiy that Y = 1? What is the probabiltiy that Y = 2? What is the probability that Y = n where n = 0, 1, 2, 3, 4, 5, 6? Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10 ) - 3339 9 / 16
Binomial Probability Distribution The distribution of the count X of successes in the Binomial setting has a Binomial probability distribution. Where the parameters for a binomial probability distribution is: n the number of observations p is the probability of a success on any one observation The possible values of X are the whole numbers from 0 to n. As an abbreviation we say, X B(n, p). Binomial probabilities are calculated with the following formula: P(X = k) = n C k p k (1 p) n k Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10) - 3339 10 / 16
Stopping at an intersection Suppose that only 25% of all drivers come to a complete stop at an intersection with a stop sign when not other cars are visible. What is the probability that of the 20 randomly chosen drivers, 1. Exactly 6 will come to a complete stop? 2. No one will come to complete stop? 3. At least one will come to a complete stop? 4. At most 6 will come to a complete stop? Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10) - 3339 11 / 16
Using R To find P(X =k) use dbinom(k,n,p). From previous example P(X = 6), k = 6, n = 20, p = 0..25 > dbinom(6,20,.25) [1] 0.1686093 To find P(X k) use pbinom(k,n,p). From previous example P(X 6) > pbinom(6,20,0.25) [1] 0.7857819 What is the probability that less than 6 will come to a complete stop? What is the probability of at least 6? Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10) - 3339 12 / 16
Example #2 A fair coin is flipped 30 times. 1. What is the probability that the coin comes up heads exactly 12 times? P(X = 12), n = 30, p = 0.5 > dbinom(12,30,0.5) [1] 0.08055309 2. What is the probability that the coin comes up heads less than 12 times? P(X < 12) = P(X 11) > pbinom(11,30,0.5) [1] 0.1002442 3. What is the probability that the coin comes up heads more than 12 times? P(X > 12) = 1 P(X 12) > 1-pbinom(12,30,0.5) [1] 0.8192027 4. What is the probability that the coin comes up heads between 9 and 13 times, inclusive? P(9 X 13) = P(X 13) P(X 8) > pbinom(13,30,0.5)-pbinom(8,30,.5) [1] 0.28427 Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10) - 3339 13 / 16
Mean and Variance of a Binomial Distribution If a count X has the Binomial distribution with number of observations n and probability of success p, the mean and variance of X are µ X = E[X] = np σ 2 X = Var[X] = np(1 p) Then the standard deviation is the square root of the variance. Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10) - 3339 14 / 16
Example #3 Suppose it is known that 80% of the people exposed to the flu virus will contract the flu. Out of a family of five exposed to the virus, what is the probability that: 1. No one will contract the flu? 2. All will contract the flu? 3. Exactly two will get the flu? 4. At least two will get the flu? Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10) - 3339 15 / 16
Example Continued Suppose it is known that 80% of the people exposed to the flu virus will contract the flu. Suppose we have a family of five that were exposed to the flu. 1. Find the mean 2. Find the variance of this distribution. Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Sec (Department 4.4-4.5 of Mathematics University of Lecture Houston 10) - 3339 16 / 16