120C-Choi-Spring-2019 1 Chapter 6: Discrete Probability Distributions Section 6.1: Discrete Random Variables... p. 2 Section 6.2: The Binomial Probability Distribution... p. 10 The notes are based on Statistics: Informed Decisions Using Data, 5th edition, Michael Sullivan III, Pearson You may report critical errors and typos to tchoi@cypresscollege.edu.
Section 6.1: Discrete Random Variables 2 Random Variable A random variable is a variable that holds a numerical value that is associated with the outcome of a probability experiment. Random variables are typically denoted using capital letters such as X. As an outcome happens with randomness, we can not predict what the random variable will hold. Hence, it is called a random variable. Example 1. For the probability experiment of rolling two dice, let the random variable X hold the sum of two dots. Then the random variable X holds the values X = 2, X = 3,..., or X = 12. Example 2. For the probability experiment of rolling two dice, let the random variable X hold the absolute value of the difference of two dots. Then the random variable X holds the values X = 0, X = 1,..., or X = 5. Discrete and Continuous Random Variables A discrete random variable has either a finite or countable number of values. The values of a discrete random variable can be plotted on a number line with space between each point. Informally, quantities that can be counted. A continuous random variable has infinitely many values between any two values. The values of a continuous random variable can be plotted on a line in an uninterrupted fashion. Informally, quantities that can be measured or computed. Example. Determine if the random variable is discrete or continuous. (a) The time it takes for a light bulb to burn out. (b) The weight of a T-bone steak. (c) In a random sample of 20 people, the number of people with type A blood. (d) The distance a baseball travels in the air after being hit. (e) The number of points scored during a basketball game. (f) The square footage of a house. Probability Distribution The probability distribution (or probability mass function) of a discrete random variable X provides the possible values of the random variable and their corresponding probabilities. A probability distribution can be in the form of a table, graph, or mathematical formula. If x is a possible value of X, then the probability that X = x is denoted by P (X = x).
Section 6.1: Discrete Random Variables 3 Example. For the probability experiment of rolling a die, let X be the number of dots. For instance, the probability that we roll a four dots (i.e. X = 4) is denoted by P (X = 4) = 1 6. In fact, P (X = x) = 1 6. The probability distribution is given by x 1 2 3 4 5 6 P (X = x) 1 6 1 6 1 6 1 6 1 6 1 6 Example: Sum of Two Dots For the random variable X which holds the sum of two dots from rolling two dice, the possible values of X are integers from 2 to 12. Out of 36 (the size of sample space S when two dice are rolled) outcomes, the sum 4 comes from three outcomes (1, 3), (2, 2), and (3, 1) as 4 = 1 + 3 = 2 + 2 = 3 + 1. 2 = 1 + 1 3 = 1 + 2 = 2 + 1 4 = 1 + 3 = 2 + 2 = 3 + 1 5 = 1 + 4 = 2 + 3 = 3 + 2 = 4 + 1 6 = 1 + 5 = 2 + 4 = 3 + 3 = 4 + 2 = 5 + 1 7 = 1 + 6 = 2 + 5 = 3 + 4 = 4 + 3 = 5 + 2 = 6 + 1 8 = 2 + 6 = 3 + 5 = 4 + 4 = 5 + 3 = 6 + 2 9 = 3 + 6 = 4 + 5 = 5 + 4 = 6 + 3 10 = 4 + 6 = 5 + 5 = 6 + 4 11 = 5 + 6 = 6 + 5 12 = 6 + 6 For instance, P (X = 4) = 3 36 = 0.0833. Also P (X = 10) = 0.0833. The table form and the graph of the probability distribution for the random variable X are
Section 6.1: Discrete Random Variables 4 x P (X = x) 2 1/36 = 0.0278 3 2/36 = 0.0556 4 3/36 = 0.0833 5 4/36 = 0.1111 6 5/36 = 0.1389 7 6/36 = 0.1667 8 5/36 = 0.1389 9 4/36 = 0.1111 10 3/36 = 0.0833 11 2/36 = 0.0556 12 1/36 = 0.0278 Rules for a Discrete Probability Distribution Let P (x) denote the probability that the random variable X equals x. Then P (x) = 1 where the sum is over all possible values of X. 0 P (x) 1 The first rule says that the sum of all probabilities assigned for the random variable over all possible numerical values that the random variable holds is 1. Example. For the sum of two dots from throwing two dice, 12 x=2 P (x) = P (2) + P (3) + P (4) + P (5) + P (6) + P (7) + P (8) + P (9) + P (10) + P (11) + P (12) = 1 36 + 2 36 + 3 36 + 4 36 + 5 36 + 6 36 + 5 36 + 4 36 + 3 36 + 2 36 + 1 36 = 36 36 = 1 Mean of Discrete Random Variable The mean of a discrete random variable X is given by the formula µ X = x P (x) For each x, we multiply x by its corresponding probability P (x). Then sum the products.
Section 6.1: Discrete Random Variables 5 Example. For the sum of two dots when rolling two dice, x P (x) x P (x) L1 L2 L3 = L1 * L2 2 1/36 2/36 3 2/36 6/36 4 3/36 12/36 5 4/36 20/36 6 5/36 30/36 7 6/36 42/36 8 5/36 40/36 9 4/36 36/36 10 3/36 30/36 11 2/36 22/36 12 1/36 12/36 the mean of the random variable X is µ X = sum(l3) = 7. Interpretation of the Mean of Discrete Random Variable Suppose an experiment is repeated n independent times and the value of the random variable X is recorded. As the number of repetitions of the experiment increases, the mean value of the n trials will approach µ X, the mean of the random variable X. In other words, let x 1 be the value of the random variable X after the first experiment, x 2 be the value of the random variable X after the second experiment, and so on. Then x = x 1 + x 2 + + x n n The difference between x and µ X gets closer to 0 as n increases. Example. As we roll two dice forever, we will note that the intermediate mean x of sum of two dots will approach 7. Interpret the Mean as an Expected Value The mean of a random variable represents what we would expect to happen in the long run, it is also called the expected value of the random variable X, denoted by E(X). That is, E(X) = µ X. Example 1. When we roll two dice, the expected value E(X) of the random variable X which holds the sum of two dots is 7 as µ X = 7.
Section 6.1: Discrete Random Variables 6 Example 2. When flipping four coins, let X be the random variable that holds the number of heads. Then the probability distribution is given by x 0 1 2 3 4 P (x) 1/16 4/16 6/16 4/16 1/16 = 0.0625 = 0.25 = 0.375 = 0.25 = 0.0625 The expected value is E(X) = 0(0.0625) + 1(0.25) + 2(0.375) + 3(0.25) + 4(0.0625) = 2. Most of the time, we expect to see two heads when flipping four coins. Examples Example 1. You pay $1 to roll two dice. If two dots are differed by one dot, then you win $3. If two dots are differed by two dots, then you win $5. If two dots are the same, then you lose $4. What is the expected value of the game? x (Payout) P (x) 3 /36 5 /36-4 /36 0 /36 Example 2. A life insurance company sells a $250,000 1-year term life insurance policy to a 20-year-old male for $350. According to the National Vital Statistics Report, 58(21), the probability that the male survives the year is 0.998734. Compute and interpret the expected value of this policy to the insurance company. x (Payout) 350 (survived) 350-250,000 (did not survive) P (x)
Section 6.1: Discrete Random Variables 7 Standard Deviation of a Discrete Random Variable The standard deviation of a discrete random variable X is given by (x ( σ X = µx ) 2 P (x) or x2 P (x)) (µ X ) 2 where µ X is the mean of the random variable X. Example. For the sum of two dots when rolling two dice, x P (x) (x µ X ) 2 P (x) L1 L2 L3 = (L1-7) 2 *L2 2 1/36 0.69444 3 2/36 0.88889 4 3/36 0.75000 5 4/36 0.44444 6 5/36 0.13889 7 6/36 0.00000 8 5/36 0.13889 9 4/36 0.44444 10 3/36 0.75000 11 2/36 0.88889 12 1/36 0.69444 the standard deviation of the random variable X is σ X = sum(l3) = 5.83333 = 2.4152. Example: Four Coins Previously we considered the probability distribution of the random variable X that holds the number of times the head appear in flipping four coins. Recall that the mean of the random variable X is µ X = 0(0.0625) + 1(0.25) + 2(0.375) + 3(0.25) + 4(0.0625) = 2. Let us compute the standard deviation σ X of the random variable X using the formula σ X = (x µ X ) 2 P (x). x P (x) (x µ X ) 2 P (x) 0 0.0625 (0 2) 2 (0.0625) = 0.25 1 0.2500 (1 2) 2 (0.2500) = 0.25 2 0.3750 (2 2) 2 (0.3750) = 0.00 3 0.2500 (3 2) 2 (0.2500) = 0.25 4 0.0625 (4 2) 2 (0.0625) = 0.25 Then the standard deviation is σ X = 0.25 + 0.25 + 0.00 + 0.25 + 0.25 = 1 = 1. Compute the standard deviation using an alternative formula.
Section 6.1: Discrete Random Variables 8 Examples Example 1. Let X be the absolute value of the difference of two dots when rolling two dice. For instance, if (4, 6) are rolled, then X = 2. (a) Construct a discrete probability distribution. (b) Compute and interpret the mean of the random variable X. (c) Compute the standard deviation of the random variable X. Example 2. Let X be the larger of two dots when rolling two dice. For instance, if (4, 6) are rolled, then X = 6. (a) Construct a discrete probability distribution. (b) Compute and interpret the mean of the random variable X. (c) Compute the standard deviation of the random variable X.
Section 6.1: Discrete Random Variables 9 Example: Waiting in Line A Wendy s manager performed a study to determine a probability distribution for the number of people, X, waiting in line during lunch. The results were as follows: x P (X = x) x P (X = x) 0 0.011 7 0.098 1 0.035 8 0.063 2 0.089 9 0.035 3 0.150 10 0.019 4 0.186 11 0.004 5 0.172 12 0.006 6 0.132 (a) Verify that this is a discrete probability distribution. (b) Compute and interpret the mean of the random variable X. (c) Compute the standard deviation of the random variable X. (d) What is the probability that eight people are waiting in line? (e) What is the probability that 10 or more people are waiting in line? Would this be unusual?
Section 6.2: The Binomial Probability Distribution 10 Criteria for a Binomial Probability Experiment An experiment is said to be a binomial experiment (or Bernoulli trial) if The experiment is performed a fixed number of times. Each repetition of the experiment is called a trial. The trials are independent. This means that the outcome of one trial will not affect the outcome of the other trials. For each trial, there are two mutually exclusive (disjoint) outcomes: Success or Failure. The probability of success is the same for each trial of the experiment. In this section, we let X be the random variable that holds the number of successes in n trials of a binomial experiment. Since we count the number of successes, the random variable is discrete. We call X a binomial random variable. Notation used in the Binomial Probability Distribution n: the number of binomial experiment trials (this is fixed constant) p: the probability of success for each trial, i.e. p = P (Success) 1 p: the probability of failure for each trial, i.e. 1 p = P (Failure) X: the binomial random variable that holds the number of successes in n independent trials of the experiment x: specific value for the binomial random variable X We can have from no success (i.e. x = 0) to n many successes (i.e. x = n). Hence, x can be any whole number between 0 and n inclusively. That is, 0 x n. Example. Is flipping a coin a binomial experiment? Say a coin is biased so that the tail appears with the probability P (tail) = 0.7. If we define a success in flipping the coin once as observing a tail, then p = 0.7 and 1 p = 0.3 = P (failure). In flipping the coin seven times, if we are concerned about observing the tail 4 times, then n = 7 and x = 4. Examples: Carbon Tax According to a poll, 76% of American voters are in favor of a carbon tax. Suppose that five voters in the United States are randomly sampled and asked whether they favor a carbon tax. Let X be the number of answering in the affirmative is recorded.
Section 6.2: The Binomial Probability Distribution 11 n = 5 p = 0.76 and 1 p = 1-0.76 = 0.24 x can be 0, 1, 2, 3, 4, or 5. Here are outcomes of the poll. o : affirmative, and x : negative. x Outcomes that are relevant 0 xxxxx 1 oxxxx, xoxxx, xxoxx, xxxox, xxxxo 2 ooxxx, xooxx, xxoox, xxxoo, oxoxx, xoxox, xxoxo, oxxox, xoxxo, oxxxo 3 xxooo, oxxoo, ooxxo, oooxx, xoxoo, oxoxo, ooxox, xooxo, oxoox, xooox 4 xoooo, oxooo, ooxoo, oooxo, oooox 5 ooooo For instance, the probability of obtaining the outcome oxoxo is (0.76)(0.24)(0.76)(0.24)(0.76). In fact, all outcomes that are relevant to x = 4 have the probability (0.76) 3 (0.24) 2. Since we have 5 C 3 = 10 such outcomes, P (X = 4) = 10(0.76) 3 (0.24) 2. Binomial Probability Distribution The probability of obtaining x successes in n independent trials of a binomial experiment is given by P (x) = n C x p x (1 p) n x where x can be any of values from 0, 1, 2,..., n and p is the probability of success. Example. In clinical trails of Clarinex-D, 5% of the patients in the study experienced insomnia as a side effect. A random sample of 20 Clarinex-D users is obtained, and the number of patients who experienced insomnia is recorded. Find the probability that exactly 3 experienced insomnia as a side effect. Then n = 20, p = 0.05, and x = 3. P (X = 3) = 20 C 3 (0.05) 3 (1 0.05) 20 3 = (1140)(0.05) 3 (0.95) 17 = 0.0596 Note: Make sure that you know how to calculate a binomial probability using the formula above. Using TI calculator to find Binomial Probability We can compute binomial probability calculations using TI calculator. The TI calculator has two functions: binompdf and binomcdf. In order to access them we press [DISTR] ([2nd] + [VARS]) and scroll down to binompdf( or binomcdf(.
Section 6.2: The Binomial Probability Distribution 12 binompdf(n, p, x) finds the binomial probability of x successes in n trials with the probability of success p. binompdf(n, p, x) = P (X = x) = n C x (p) x (1 p) n x binomcdf(n, p, x) finds the binomial probability of at most x successes in n trials with the probability of success p. binomcdf(n, p, x) = P (X x) = P (X = 0) + + P (X = x) P (X < x) = P (X x 1) = binomcdf(n, p, x 1) P (X > x) = 1 P (X x) = 1 - binomcdf(n, p, x) P (X x) = 1 P (X < x) = 1 P (X x 1) = 1 - binomcdf(n, p, x 1) An English Lesson Phrase Math Symbol at least; no less than; greater than or equal to more than; greater than > fewer than; less than < no more than; at most; less than or equal to exactly; equals; is = Example: Clarinex-D In clinical trails of Clarinex-D, 5% of the patients in the study experienced insomnia as a side effect. A random sample of 20 Clarinex-D users is obtained, and the number of patients who experienced insomnia is recorded. Then n = 20 and p = 0.05. Let X be the number of patients who experienced insomnia is recorded. (a) The probability that at most 4 experienced insomnia as a side effect is P (X 4) = binomcdf(20, 0.05, 4) = 0.9974. (b) The probability that fewer than 4 experienced insomnia as a side effect is P (X < 4) = P (X 3) = binomcdf(20, 0.05, 3) = 0.9841. (c) The probability that at least 6 experienced insomnia as a side effect is P (X 6) = 1 P (X < 6) = 1 P (X 5) = 1 - binomcdf(20, 0.05, 5) = 0.0003. (d) The probability that more than 3 experienced insomnia as a side effect is P (X > 3) = 1 P (X 3) = 1 - binomcdf(20, 0.05, 3) = 0.0159.
Section 6.2: The Binomial Probability Distribution 13 Examples: Carbon Tax (revisited) According to a poll, 76% of American voters are in favor of a carbon tax. Suppose that 10 voters in the United States are randomly sampled and asked whether they favor a carbon tax. Let X be the number of answering in the affirmative is recorded. Then n = 10 and p = 0.76. (a) Compute the probability that seven will answer in the affirmative using the formula. Verify using binompdf. Answer: 0.2429 (b) Compute P (X 5). Answer: 0.0670 (c) Find the probability that less than five will answer in the affirmative. Answer: 0.0161 (d) Find the probability that at least three will answer in the affirmative. 0.9997 (e) Compute P (X > 4). Answer: 0.9839 Answer: Mean (or Expected Value) and Standard Deviation of a Binomial Random Variable A binomial experiment with n independent trials and probability of success p has a mean and standard deviation given by the formulas µ X = np and σ X = np(1 p) Example. In clinical trails of Clarinex-D, 5% of the patients in the study experienced insomnia as a side effect. A random sample of 20 Clarinex-D users is obtained, and the number of patients who experienced insomnia is recorded. Let X be the binomial random variable of the number of patients who experienced insomnia. The mean of the binomial random variable X is µ X = 20(0.05) = 1. Since the mean is also expected value, we can interpret 1 as the expected number of patient who experienced insomnia in a random sample of 20 Clarinex-D users. The standard deviation of the binomial random variable X is σ X = 20(0.05)(1 0.05) = 0.9747.
Section 6.2: The Binomial Probability Distribution 14 Graphing Binomial Probability Distribution To graph a binomial probability distribution with n trials and success probability p: 1. Construct a probability distribution table with two columns: First column (L1) lists the number of successes from x = 0 to x = n. Second column (L2) lists the binomial probabilities P (X = x). Use L2 = binompdf(n, p, L1). 2. Draw the graph using the horizontal axis for the x values the vertical axis for the probabilities 3. Label the bottom of each vertical line segment with the x-value. 4. Label the vertical axis with P (x). Example: n = 5, p = 0.2 Graph the binomial probability distribution for n = 5 and p = 0.2. x P (X = x) L1 L2 = binompdf(5, 0.2, L1) 0 0.3277 1 0.4096 2 0.2048 3 0.0512 4 0.0064 5 0.0003 Mean: µ X = 5(0.2) = 1 SD: σ X = 5(0.2)(1 0.2) = 0.8 = 0.8944 The distribution is skew-right. Interpretation of Binomial Distribution of Fixed Success Probability For a fixed p,
Section 6.2: The Binomial Probability Distribution 15 as the number of trials n in a binomial experiment increases, the binomial probability distribution becomes bell-shaped. Convention: If np(1 p) 10, the binomial probability distribution will be approximately bell-shaped. Note that the standard deviation σ of the binomial random variable is np(1 p). Since the variance is σ 2 = ( np(1 p)) 2 = np(1 p), the second statement above states that if the variance is greater than or equal to 10, then the binomial probability distribution will be approximately bell-shaped. Example. n = 70 and p = 0.2, so np(1 p) = 70(0.2)(0.8) = 11.2 10. Unusual Results of Binomial Probability Distribution When np(1 p) 10, the binomial probability distribution is bell-shaped. We can use the Empirical Rule to estimate the percentage of the observations. Recall that Binomial Probability Mean: µ X = np Binomial Probability Standard Deviation: σ X = np(1 p) By the Empirical Rule, middle 95% of the observations lie within two standard deviations, i.e. µ 2σ x µ + 2σ. If the observation is outside this middle 95%, then it is considered unusual, i.e. if then it is unusual. x < µ 2σ or x > µ + 2σ, Example: Trusting Government A survey reported that 11% of adult Americans had a great deal of trust and confidence in the federal government handling domestic issues. Suppose a survey of a random sample
Section 6.2: The Binomial Probability Distribution 16 of 1100 adult Americans finds that 84 have a great deal of trust and confidence in the federal government handling domestic issues. The nature of the survey suggests a binomial random variable X. Note that n = 1100 is the number of trials, p = 0.11 is the probability of success (trusting the government), and let x be the number of successes in 1100 trials. Since np(1 p) = 1100(0.11)(1 0.11) = 107.69 10, the probability distribution of X is roughly bell-shaped. The mean is µ X = np = 1100(0.11) = 121, and the standard deviation is σ X = np(1 p) = 107.69 = 10.3774. The two standard deviation mark on the left of the mean is µ 2σ = 107.69 2(10.3774) = 86.9352, and the observation 84 is less than 86.9352. Hence, the observation is unusual. Example: Singulair Singulair is a medication whose purpose is to control asthma attacks. In clinical trials of Singulair, 18.4% of the patients in the study experienced headaches as a side effect. Would it be unusual to observe 86 patients who experience headaches in a random sample of 400 patients who use this medication? Why? n = p = µ = σ = np(1 p) = Is the probability distribution roughly bell-shaped? µ 2σ = µ + 2σ =