Chapter 4 Random Variables & Probability Distributions 1 LEARNING OBJECTIVES After completing this chapter, you should be able to: • Interpret the mean and standard deviation for a discrete random variable • Use the binomial probability distribution to find probabilities • Describe when to apply the binomial distribution • Use the Poisson discrete probability distributions to find probabilities 2 INTRODUCTION TO PROBABILITY DISTRIBUTIONS • Random Variable • A random variable is a variable taking on numerical values determined by the outcome of a random phenomenon. Random Variables Discrete Random Variable Continuous Random Variable 3 DISCRETE RANDOM VARIABLES • Can only take on a countable number of values Examples: • Roll a die twice Let X be the number of times 4 comes up (then X could be 0, 1, or 2 times) • Toss a coin 5 times. Let X be the number of heads (then X = 0, 1, 2, 3, 4, or 5) 4 PROBABILITY DISTRIBUTION • The probability distribution of the random variable tells • What values the random variable can take • The probability that it takes each of those values • Represented by graph, table or formula • Let π be the random variable representing the number of heads observed in a two coin tossing experiment x 0 1 2 P(x) 1/4 1/2 1/4 • The probability distribution of π is: 5 PROBABILITY DISTRIBUTION – DISCRETE RANDOM VARIABLE • Requirements (properties) for a discrete probability distribution • π(π₯) ≥ 0 for all values of π₯ • ∑ π(π₯) = 1 summation over all possible values of π₯ • Example: π(π₯) = π₯/10 πππ π₯ = 1,2,3,4 • Valid probability distribution? • Property 1? • Property 2? 1/10 + 2/10 + 3/10 + 4/10 = 1 6 EXPECTED VALUE Expected Value (or mean) of a discrete distribution (Weighted Average) μ ο½ E(x) ο½ ο₯ xP(x) x Example:Toss 2 coins, x = # of heads, compute expected value of x: E(x) = (0 x .25) + (1 x .50) + (2 x .25) = 1.0 x P(x) 0 .25 1 .50 2 .25 7 EXAMPLE 1 • An insurance company sells a $10,000 whole life insurance policy at annual premium of $290. Historical data reveals probability of death of a person during next year to be 0.001. What is the expected gain for company by selling one policy? 8 SOLUTION • Let π₯ = gain, our random variable of interest in this case Sample Point Gain, x Probability Customer lives $290 0.999 Customer dies $(290 − 10000) = −$9710 0.001 • Expected gain = (290)(0.999) + (−9710)(0.001) = $ 280 • If the company were to sell a very large number of one-year $10,000 policies to such customers, it would (on the average) net $280 per sale in the next year Note: The expected value does not have to be a possible value …..it’s an average value 9 QUESTION • Problem Craps is a popular casino game in which a player throws two dice and bets on the outcome (the sum total of the dots showing on the upper faces of the two dice). Consider a $5 wager. On the first toss (called the come-out roll), if the total is 7 or 11 the roller wins $5. If the outcome is a 2, 3, or 12, the roller loses $5 (i.e., the roller wins - $5). For any other outcome (4, 5, 6, 8, 9, or 10), a point is established and no money is lost or won on that roll (i.e., the roller wins $0). Make a probability distribution table representing x, the expected gain of the come-out roll wager (- $5, $0, or + $5) 10 SOLUTION 11 VARIANCE AND STANDARD DEVIATION ο§ Variance of a discrete random variable X σ ο½ E(X ο μ) ο½ ο₯ (x ο μ) P(x) 2 2 2 x ο§ Standard Deviation of a discrete random variable X σ ο½ σ2 ο½ 2 (x ο μ) P(x) ο₯ x 12 STANDARD DEVIATION EXAMPLE ο§ Example:Toss 2 coins, X = # heads, compute standard deviation (recall E(x) = 1) σο½ 2 (x ο μ) P(x) ο₯ x σ ο½ (0 ο 1)2 (.25) ο« (1 ο 1)2 (.50) ο« (2 ο 1)2 (.25) ο½ .50 ο½ .707 Possible number of heads = 0, 1, or 2 13 EXPECTED VALUE AND VARIANCE – EXAMPLE II • Suppose you have an option of participating in one of these games: • πΊπππ π΄ :You win π π . 2 with probability 2/3 and lose π π . 1 with probability 1/3 • πΊπππ π΅ :You win π π . 1002 with probability 2/3 and lose π π . 2001 with 1/3 • Which one would you choose and why? 14 SOLUTION • Game A : You win Rs. 2 with probability 2/3 and loose Rs. 1 with probability 1/3 π₯ π(π₯) π₯π(π₯) 2 2/3 4/3 −1 1/3 −1/3 1 πΈ(π₯) =1 ∑ 15 SOLUTION • Game B :You win Rs. 1002 with probability 2/3 and loose Rs. 2001 with 1/3 π¦ π(π¦) π¦π(π¦) 1002 2/3 668 −2001 1/3 −667 ∑ 1 πΈ(π¦) = 1 16 EXPECTED VALUE AND VARIANCE • Game A : You win Rs. 2 with probability 2/3 and loose Rs. 1 with probability 1/3 π₯ π(π₯) π₯π(π₯) (π₯ − π) (π₯ − π)2 (π₯ − π)2 π(π₯) 2 2/3 4/3 1 1 2/3 −1 1/3 −1/3 −2 4 4/3 ∑ 1 π =1 πππ[π₯] = 2 π . π = Rs 1.4 17 EXPECTED VALUE AND VARIANCE Game B : You win Rs. 1002 with probability 2/3 and loose Rs. 2001 with 1/3 • π¦ π(π¦) π¦π(π¦) (π¦ − π) (π¦ − π)2 (π¦ − π)2 π(π¦) 1002 2/3 668 1001 1002001 668000 −2001 1/3 −667 −2002 4008004 1336001 ∑ 1 π = 1 πππ[π¦] = 2004002 π . π. = π π 1416 18 Probability Distributions Ch. 4 Discrete Probability Distributions Continuous Probability Distributions Binomial Uniform Poisson Normal Ch. 5 Exponential 19 THE BINOMIAL DISTRIBUTION Probability Distributions Discrete Probability Distributions Binomial Poisson 20 BINOMIAL RANDOM VARIABLE • Consider an experiment with only two outcomes • True/False • Head/Tail • Independent repeated trials • Bernoulli trials 21 BINOMIAL RANDOM VARIABLE • A Binomial Experiment consists of a fixed number of Bernoulli trials • Denoted as B(n, p) • n is the number of trials • p is the probability of success 22 EXAMPLE • Toss a fair coin 5 times and call Heads a success • Our random variable in this case is the number of Heads we observe in the five tosses • Binomial Experiment • B(5, 0.5) • n is the number of trials • p is the probability of success 23 BINOMIAL RANDOM VARIABLE Characteristics of a Binomial Random Variable • The experiment consists of n identical trials • Only two possible outcomes on each trial • We denote π for success and πΉ for failure 24 BINOMIAL RANDOM VARIABLE • The probability of success (π) remains the same from trial to trial • Success (π) denoted by π • Failure (πΉ) is denoted by π, π€βπππ π = 1 − π • p & q remain constant, from trial to trial • The trials are independent • Binomial random variable π₯ is the number of successes (π’π ) in π trials 25 BINOMIAL RANDOM VARIABLE EXAMPLE You randomly select three bonds out of possible ten for an investment portfolio. Unknown to you, seven out of ten shall maintain their present value and the other three will lose value due to change in their ratings. Let π be the number of three bonds you select that loose value. • Is π a Binomial Random Variable or is this experiment a Binomial Experiment? • The probability that the first bond you pick is one of those that will lose value is 3/10 and that the second one you pick is also one that will lose value is 2/9 (because we have already picked up one of those losing bonds).Thus the choices you make are dependent, therefore the variable π is not a binomial variable. 26 BINOMIAL RANDOM VARIABLE – EXAMPLE Before marketing a new product, a consumer survey is usually conducted to determine whether the product is likely to be successful. Suppose a company develops a diet soda and conducts a taste preference survey in which 100 randomly selected customers state their preferences among the new soda and existing leading sellers. Let x be the number of the 100 who choose the new soda over the two (existing) others. • Is π₯ a Binomial Random Variable or is this experiment a Binomial Experiment? • Surveys that use random sampling techniques and produce dichotomous responses are classic binomial experiments. Each respondent has to pick either of the two options: whether they like the new soda or not. The sample is a very small proportion of the totality of customers, so the responses would practically be independent of each other. Thus x is a binomial variable. 27 AND ANOTHER An FMCG company plans to conduct a survey to determine the fraction of households in DHA that would use their new product.They divide DHA in equal sized blocks (in terms of population) and then randomly choose a block to survey all the households in it. Let x be the number of households in the sampled block that would use the company’s new product. • This survey also produces dichotomous responses – Yes to using a product or No to using a product. However, the method is not simple random sampling. For it to be a binomial experiment, it needs to be independent trials and a condition for that is to have random sample, which will produce unbiased results. In this case, people living in the same neighborhood are likely to have similar income, education, thus the model is not a binomial model. 28 BINOMIAL PROBABILITY DISTRIBUTION π π₯ π−π₯ π π₯ = π π π₯ π = ππππππππππ‘π¦ ππ π π π’ππππ π ππ π π πππππ π‘ππππ π = ππππππππππ‘π¦ ππ πππππ’ππ = 1 − π π = ππ’ππππ ππ π‘πππππ π₯ = ππ. ππ π π’ππππ π ππ ππ π π‘πππππ π π! = π₯ π₯! π − π₯ ! (combination rule) 29 MEAN & VARIANCE FOR A BINOMIAL RANDOM VARIABLE ππππ: π = π π ππππππππ: π 2 = π π π ππ‘ππππππ π·ππ£πππ‘πππ: π = π π π 30 BINOMIAL PROBABILITY DISTRIBUTION • Toss a coin 5 times in a row. Note number of tails. What’s the probability of 3 tails? p( x) ο½ n! p x (1 ο p ) n ο x x !(n ο x)! p (3) ο½ 5! 0.53 (1 ο 0.5)5ο3 3!(5 ο 3)! ο½ 0.3125 31 BINOMIAL PROBABILITY DISTRIBUTION - EXAMPLE You’re a telemarketer selling service contracts. You’ve sold 20 in your last 100 calls (p = 0.20). If you call 12 people tonight, what’s the probability of A. No sales? B. Exactly 2 sales? C. At most 2 sales? D. At least 2 sales? 32 SOLUTION (n = 12, p = .20) A. p(0) = .0687 B. p(2) = .2835 33 SOLUTION C. p(at most 2) = p(0) + p(1) + p(2) = .0687 + .2062 + .2835 = .5584 D. p(at least 2) = p(2) + p(3)...+ p(12) = 1 – [p(0) + p(1)] = 1 – .0687 – .2062 = .7251 34 BINOMIAL PROBABILITY - R • Probability Function dbinom(x, size=n, prob=p) where π₯ is the number of successes in π trials, and π is the probability of success in a single trial • For cumulative probability pbinom(x, size=n, prob=p) 35 BINOMIAL PROBABILITY πΆπ’ππ’πππ‘ππ£π ππππππππππ‘π¦ The function πΉ(π₯) = π(π ≤ π₯), is called a cumulative probability distribution. For a discrete random variable π, the cumulative probability distribution πΉ(π₯) is determined π₯ πΉ π₯ = π(π) = π(0) + π(1) + β― + π(π₯) π=0 36 BINOMIAL PROBABILITY πππ‘π: Probability mass function, π(π₯), of a discrete random variable π is distinguished from the cumulative probability distribution, πΉ(π₯), of a discrete random variable π by the use of a lowercase π and an uppercase πΉ. Example: Notation π(3) means π(π = 3), while the notation πΉ(3) means π(π ≤ 3) 37 EXAMPLE Roll 12 dice simultaneously, and let π denote the number of 6’π that appear.We wish to find the probability of getting seven, eight, or nine 6’π . If we let π = {πππ‘ π 6 ππ πππ ππππ}, then π(π ) = 1/6 and the rolls constitute Bernoulli trials; thus π~πππππ(π ππ§π = 12; ππππ = 1/6) and our task is to find π(7 ≤ π ≤ 9). 9 π 7≤π≤9 = π₯=7 12 π₯ 1 6 π₯ 5 6 12−π₯ 38 SOLUTION π π≥7 = π₯=7 π π≥8 = π₯=8 π π≤9 = π₯=9 12 7 1 6 7 5 6 12−7 12 8 1 6 8 5 6 12−8 12 9 1 6 9 5 6 12−9 π 7≤π ≤9 =π π ≥7 +π π ≥8 +π π ≤9 = 0.001291758 39 QUESTION • A machine that produces stampings for automobile engines is malfunctioning and producing 10% defectives. The defective and non defective stampings proceed from the machine in a random manner. If the next five stampings are tested, find the values of p(0), p(1), p(2), p(4) and p(5). Calculate the mean m and standard deviation s. Locate m and the interval m - 2s to m + 2s on the graph. If the experiment were to be repeated many times, what proportion of the x observations would fall within the interval m - 2s to m + 2s? • 40 SOLUTION 41 BINOMIAL PROBABILITY - R π»ππ€ π‘π ππ ππ‘ ππ π : ππππππ(7, π ππ§π = 12, ππππ = 1/6) + ππππππ(8, π ππ§π = 12, ππππ = 1/6) + ππππππ(9, π ππ§π = 12, ππππ = 1/6) [1] 0.001291758 ππππππ(9, π ππ§π = 12, ππππ = 1/6) − ππππππ(6, π ππ§π = 12, ππππ = 1/6) [1] 0.001291758 42 POISSON DISTRIBUTION Probability Distributions Discrete Probability Distributions Binomial Hypergeometric Poisson 43 POISSON DISTRIBUTION • Apply the Poisson Distribution when: • You wish to count the number of times an event occurs in a given continuous interval • The probability that an event occurs in one subinterval is very small and is the same for all subintervals • The number of events that occur in one subinterval is independent of the number of events that occur in the other subintervals • There can be no more than one occurrence in each subinterval • The average number of events per unit is ο¬ (lambda) 44 EXAMPLE • If the average number of people who buy cheeseburgers from a fast-food chain on a Friday night at a single restaurant location is 200, a Poisson distribution can answer questions such as, "What is the probability that more than 300 people will buy burgers?" 45 POISSON DISTRIBUTION FORMULA ολ e λ P(x) ο½ x! x where: x = number of successes per unit ο¬ = expected number of successes per unit e = base of the natural logarithm system (2.71828...) ποΌπ(π ) 46 POISSON DISTRIBUTION CHARACTERISTICS • Mean μ ο½ E(x) ο½ λ ο§ Variance and Standard Deviation σ ο½ E[( X ο ο ) ] ο½ λ 2 2 σο½ λ where ο¬ = expected number of successes per unit 47 • Leah's answering machine receives about six telephone calls between 8 a.m. and 10 a.m. What is the probability that Leah receives ONE call in the next 15 minutes? • Let X = the number of calls Leah receives in 15 minutes. (The interval of interest is 15 minutes or 1/4 hour.) EXAMPLE • π₯=0,1,2,3 • If Leah receives, on the average, six telephone calls in two hours, and there are eight 15 minute intervals in two hours, then Leah receives • (1/8)*6=0.75 calls in 15 minutes, on average. So, π =0.75 for this problem. • π∼π(0.75) • The result is π(π₯=1)= .35427 48 POISSON DISTRIBUTION EXAMPLE • Example: Customers arrive at a rate of 72 per hour. What is the probability of 4 customers arriving in 3 minutes? • Solution: • 72 customers per hour means: • 3.6 customers per 3 minutes interval 49 SOLUTION • Solution: • 72 customers per hour means: • 3.6 customers per 3 minutes interval ππ₯ π −π π π₯ = π₯! (3.6)4 π −3.6 π 4 = = 0.1912 4! 50