The Probability Distribution of a Discrete Random Variable What is a random variable? In contrast to a constant, a variable is a quantity that takes on different values. A random variable is a variable whose values are determined through a random experiment or a random process. Each random experiment has different outcomes. When these outcomes generate numeric values, the values are assigned to the random variable. Example When you toss two coins (or a coin twice) there are four outcomes: (H,H), (H,T), (T,H), (T,T). Suppose we are interested in the number of tails in tossing two coins. Let X denote the number of tails. Then X is a random variable which takes on three values: x = 0, 1, 2. These values are assigned through the outcomes of the random experiment. Outcomes of the Values of random random variable x experiment Number of tails (π», π») 0 (π», π), (π, π») 1 (π, π) 2 Page 1 of 13 Example When you guess the answer to a multiple choice question, you are conducting a random experiment. The outcomes are, you are either correct or incorrect. If a quiz has five multiple choice questions and you guess the answers for all five, you are conducting a random experiment which consists of five identical trials. Each trial has two outcomes. Since there are five trials, then the total number of outcomes is 25 = 32. Now, let π be the random variable denoting the number of correct guesses. The outcomes of this random experiment and values generated and assigned to the random variable π are shown below. For ease of presentation, “0” represents “incorrect” and “1” is for a “correct” guess. For example, the outcome (0,0,0,0,0) represent all incorrect guesses. Outcomes of the random experiment (0 = Incorrect guess; 1 = Correct guess) (0,0,0,0,0) (1,0,0,0,0), (0,1,0,0,0), (0,0,1,0,0), (0,0,0,1,0), (0,0,0,0,1) (1,1,0,0,0), (1,0,1,0,0), (1,0,0,1,0), (1,0,0,0,1), (0,1,1,0,0), (0,1,0,1,0), (0,1,0,0,1), (0,0,1,1,0), (0,0,1,0,1), (0,0,0,1,1) (1,1,1,0,0), (1,1,0,1,0), (1,1,0,0,1), (1,0,1,1,0), (1,0,1,0,1), (1,0,0,1,1), (0,1,1,1,0), (0,1,1,0,1), (0,1,0,1,1), (0,0,1,1,1) (1,1,1,1,0), (1,1,1,0,1), (1,1,0,1,1), (1,0,1,1,0), (0,1,1,1,1) (1,1,1,1,1) π₯ Correct guesses 0 1 2 3 4 5 Page 2 of 13 Probability Distribution of a Discrete Random Variable What makes π a random variable is that, although we know the different values it can take on, its specific value is not known until we conduct the random experiment. For discrete (versus continuous) random variables, all possible values of the random variable can be listed. Furthermore, each value of the discrete random variable has a distinct probability of occurring. Thus, if we list all possible values of a discrete random variable and the corresponding probability of each value, then we have a probability distribution of that discrete random variable. Example Let π be the random variable denoting the number of tails when tossing two coins. Let π₯π denote the values and π(π₯π ) the probability of each value. The probability distribution of π is: Outcomes (π», π») (π», π), (π, π») (π, π) π₯π 0 1 2 π(π₯π ) 0.25 0.50 0.25 1.00 Page 3 of 13 Example A company employs salespersons to market its product. Keeping track of sales for 100 weeks, the following table shows the number of units of the product sold per week and the frequency of the weeks. For example, in 15 of the weeks, a salesperson sold 11 units, and in 40 of the weeks, 12 units were sold. Number of units sold Weeks x Frequency 10 10 11 15 12 40 13 30 14 5 100 Using this table, we can generate the probability (relative frequency) distribution of the random variable π (the number of units sold in a given week), as shown below. Probability Distribution of π Number of items sold Probability π(π₯) π₯ 10 0.10 11 0.15 12 0.40 13 0.30 14 0.05 1.00 Page 4 of 13 Expected Value of a Random Variable The expected value of x, denoted by π(π), is the weighted mean of π₯ values. The weights are the probability of each value of the random variable. In the previous chapter the formula for the weighted mean was: µ = ο₯π₯π π€π . To find the expected value of the random variable X, just replace π€π with π(π₯π ): E(π₯) ≡ µ = ο₯π₯π π(π₯π ) Example Find the expected value of the number of units sold per week in the previous example. π₯π 10 11 12 13 14 π(π₯π ) 0.10 0.15 0.40 0.30 0.05 π₯π π(π₯π ) 1.00 1.65 4.80 3.90 0.70 12.05 E(π₯ ) ≡ µ = ο₯π₯π π(π₯π ) = 12.05 This means that the mean weekly sales is 12.05 units. Page 5 of 13 Variance of a Random Variable The variance of X is the measure of dispersion of π₯π about the center of gravity µ = E(π₯π ). The variance of a random variable is the expected value or the (weighted) mean of the squared deviations (π₯ − µ)2 var(π₯) = E[(π₯ − µ)2 ] = ο₯(π₯ − µ)2 π(π₯) To find the weighted mean of (π₯ − µ)2 multiply each squared deviation by the corresponding weight π(π₯) and the sum the products. Example Find the variance of the number of units sold per week in the previous example. π₯ 10 11 12 13 14 π(π₯) 0.10 0.15 0.40 0.30 0.05 (π₯ − µ)2 4.2025 1.1025 0.0025 0.9025 3.8025 (π₯ − µ)2 π(π₯) 0.4203 0.1654 0.0010 0.2708 0.1901 1.0475 πΈ (π₯ ) = 12.05 var(π₯) = ο₯(π₯ − µ)2 π(π₯) = 1.0475 sd(π₯) = √var(π₯) = 1.0235 Page 6 of 13 Computational Formula for π―ππ«(π) Just a simple derivation! var(π₯) = E(π₯ 2 ) − µ2 var(π₯) = ο₯π₯ 2 π(π₯) − µ2 π₯ 10 11 12 13 14 π(π₯) 0.10 0.15 0.40 0.30 0.05 π₯ 2 π(π₯) 10.00 18.15 57.60 50.70 9.80 146.25 var(π₯ ) = 146.25 − 12.052 = 1.0475 Page 7 of 13 Arithmetic Properties Of Expected Value And Variance The arithmetic properties of E(x) and var(π₯) shows what happens to the expected value and variance of x if the random variable is linearly transformed. The random variable Y is a linear transformation of X, if for any constant a and a nonzero constant b, π¦ = π + ππ₯ Then for any linear transformation of X, the following holds: 1. πΈ(π¦) = π + ππΈ(π₯) π¦ = π + ππ₯ E(π¦) = E(π + ππ₯) E(π¦) = πΈ (π) + πΈ(ππ₯) E(π¦) = π + ππΈ(π₯) 2. var(π¦) = π 2 var(π₯ ) var(π¦) = var(π + ππ₯) var(π¦) = var(π) + var(ππ₯) var(π¦) = π 2 var(π₯) Also note that sd(π¦) = π β sd(π₯) Page 8 of 13 Example In the salesperson example, suppose Bob receives a sales commission of $20 per unit sold plus a fixed weekly salary of $500. What is the expected weekly income? π¦ = 500 + 20π₯ E(π¦) = 500 + 20E(π₯) E(π¦) = 500 + 20(12.05) = $741 Find the variance and standard deviation of the weekly income. var(π¦) = 20²var(π₯) = 400(1.0475) = 419 sd(π¦) = $20.47 Example If bob works 45 weeks a year, what is expected annual income? What is the standard deviation of the annual income? π§ = ππππ’ππ ππππππ π§ = 45π¦ E(π§) = 45E(π¦) = 45(741) = $33,345 sd(π§) = 45sd(π¦) = 45(20.47) = $921.15 Page 9 of 13 The Binomial Distribution Any random process that has the following features, 1. 2. 3. The experiment consists of identical and independent repeated trials (the number of trials is denoted by n); Each trial consists of two mutually exclusive outcomes: success or failure; The probability of success, P(π) = π, or failure, P(πΉ) = 1 − π, remains the same for all repetitive trials, Generates a random variable with a binomial distribution. Example Guessing the answers to a five-question multiple choice quiz with four choices (a, b, c, and d) per question is a random experiment with above three properties. 1. 2. 3. π = 5; Guess correctly (S = 1) or guess incorrectly (F = 0); P(π) = π = 0.25, and P(πΉ) = 1 − π = 0.75, remain the same for all five questions. Let π₯ be the random variable denoting the number of correct guesses. Find the probability of each value of π₯, that is, develop the probability distribution of π₯. Page 10 of 13 Outcomes of the random experiment (0,0,0,0,0) (1,0,0,0,0), (0,1,0,0,0), (0,0,1,0,0), (0,0,0,1,0), (0,0,0,0,1) (1,1,0,0,0), (1,0,1,0,0), (1,0,0,1,0), (1,0,0,0,1), (0,1,1,0,0), (0,1,0,1,0), (0,1,0,0,1), (0,0,1,1,0), (0,0,1,0,1), (0,0,0,1,1) (1,1,1,0,0), (1,1,0,1,0), (1,1,0,0,1), (1,0,1,1,0), (1,0,1,0,1), (1,0,0,1,1), (0,1,1,1,0), (0,1,1,0,1), (0,1,0,1,1), (0,0,1,1,1) (1,1,1,1,0), (1,1,1,0,1), (1,1,0,1,1), (1,0,1,1,0), (0,1,1,1,1) (1,1,1,1,1) π₯ 0 1 2 3 4 5 π(π₯) 1 × 0.25β° × 0.75β΅ = 0.2373 5 × 0.25¹ × 0.75β΄ = 0.3955 10 × 0.25² × 0.75³ = 0.2637 10 × 0.25³ × 0.75² = 0.0879 5 × 0.25β΄ × 0.75¹ = 0.0146 1 × 0.25β΅ × 0.75β° = 0.0010 The number of outcomes in the first column above is obtained by using the combination formula with the terms π for the number of trials in the experiment and π₯ for the number of successes. C(π, π₯ ) = π! (π − π₯ )! π₯! Thus, the binomial distribution formula can simply be written as: π(π₯ ) = C(π, π₯)ππ₯ (1 − π)(π−π₯) Example The probability that Bob sells 12 units in a given week is π = 0.40. In a 10-week period (π = 10), what is the probability that Bob sells 12 units in π₯ = 6 of these ten weeks? π(π₯ = 6) = C(10, 6)(0.4βΆ)(0.6β΄) = 210(0.4βΆ)(0.6β΄) = 0.1115 Example In the previous example, what is the probability that Bob sells 12 units in at least 2 weeks of the 10-week period? π(π₯ ≥ 2) = 1 − π(π₯ ≤ 1) = 1 − [π(0) + π(1)] = 1 − [0.0060 + 0.0403] = 0.9537 Page 11 of 13 Example What is the probability that Bob sells 12 units in at most 7 weeks of the 10-week period? π(π₯ ≤ 7) = 1 − π(π₯ ≥ 8) = 1 − [π(8) + π(9) + π(10)] = 1 − [0.0106 + 0.0016 + 0.0001] = 0.9877 Example What is the probability that Bob sells 12 units in between 4 and 6 weeks (inclusive) of the 10-week period? π(4 ≤ π₯ ≤ 6) = π(4) + π(5) + π(6) = 0.2508 + 0.2007 + 0.1115 = 0.5630 Expected Value and Variance of the Binomial Distribution The expected value of a binomial distribution can be found as the product of the number of trials (π) times the probability of success per trial (π) E(π₯ ) = ππ In tossing a balanced coin, the probability of tails is π = 0.5. If you toss the coin π = 50 times, what is the expected number of tails? E(π₯) = 50(0.5) = 25 Suppose a multiple choice test has π = 20 questions and each question has 5 choices, which makes π = 1⁄5 = 0.2. If every student guessed the answers, what is the expected (the average) number of correct guesses? E(π₯) = 20(0.2) = 4 Page 12 of 13 The variance of binomial distribution can be found using the following formula: var(π₯) = ππ(1 − π) The standard deviation is the square root of the variance. sd(π₯ ) = √ππ(1 − π) Page 13 of 13