Anderson u Sweeney u Williams CONTEMPORARY BUSINESS STATISTICS WITH MICROSOFT EXCEL u Slides Prepared by JOHN LOUCKS u © 2001 South-Western/Thomson Learning Slide 1 Chapter 5 Discrete Probability Distributions Random Variables Discrete Probability Distributions Expected Value and Variance Binomial Probability Distribution Poisson Probability Distribution Hypergeometric Probability Distribution Slide 2 Random Variables A random variable is a numerical description of the outcome of an experiment. A random variable can be classified as being either discrete or continuous depending on the numerical values it assumes. A discrete random variable may assume either a finite number of values or an infinite sequence of values. A continuous random variable may assume any numerical value in an interval or collection of intervals. Slide 3 Example: JSL Appliances Discrete random variable with a finite number of values Let x = number of TV sets sold at the store in one day where x can take on 5 values (0, 1, 2, 3, 4) Discrete random variable with an infinite sequence of values Let x = number of customers arriving in one day where x can take on the values 0, 1, 2, . . . We can count the customers arriving, but there is no finite upper limit on the number that might arrive. Slide 4 Discrete Probability Distributions The probability distribution for a random variable describes how probabilities are distributed over the values of the random variable. The probability distribution is defined by a probability function, denoted by f(x), which provides the probability for each value of the random variable. The required conditions for a discrete probability function are: f(x) > 0 f(x) = 1 We can describe a discrete probability distribution with a table, graph, or equation. Slide 5 Example: JSL Appliances Using past data on TV sales (below left), a tabular representation of the probability distribution for TV sales (below right) was developed. Units Sold 0 1 2 3 4 Number of Days 80 50 40 10 20 200 x 0 1 2 3 4 f(x) .40 .25 .20 .05 .10 1.00 Slide 6 Example: JSL Appliances Graphical Representation of the Probability Distribution .50 Probability .40 .30 .20 .10 0 1 2 3 4 Values of Random Variable x (TV sales) Slide 7 Discrete Uniform Probability Distribution The discrete uniform probability distribution is the simplest example of a discrete probability distribution given by a formula. The discrete uniform probability function is f(x) = 1/n where: n = the number of values the random variable may assume Note that the values of the random variable are equally likely. Slide 8 Expected Value and Variance The expected value, or mean, of a random variable is a measure of its central location. • Expected value of a discrete random variable: E(x) = = xf(x) The variance summarizes the variability in the values of a random variable. • Variance of a discrete random variable: Var(x) = 2 = (x - )2f(x) The standard deviation, , is defined as the positive square root of the variance. Slide 9 Example: JSL Appliances Expected Value of a Discrete Random Variable x 0 1 2 3 4 f(x) .40 .25 .20 .05 .10 xf(x) .00 .25 .40 .15 .40 1.20 = E(x) The expected number of TV sets sold in a day is 1.2 Slide 10 Example: JSL Appliances Variance and Standard Deviation of a Discrete Random Variable x x- (x - )2 f(x) 0 1 2 3 4 -1.2 -0.2 0.8 1.8 2.8 1.44 0.04 0.64 3.24 7.84 .40 .25 .20 .05 .10 (x - )2f(x) .576 .010 .128 .162 .784 1.660 = The variance of daily sales is 1.66 TV sets squared. The standard deviation of sales is 1.2884 TV sets. Slide 11 Using Excel to Compute the Expected Value, Variance, and Standard Deviation 1 2 3 4 5 6 7 8 9 10 Formula Worksheet A Sales 0 1 2 3 4 B Probability 0.40 0.25 0.20 0.05 0.10 C Sq.Dev.from Mean =(A2-$B$8)^2 =(A3-$B$8)^2 =(A4-$B$8)^2 =(A5-$B$8)^2 =(A6-$B$8)^2 Mean =SUMPRODUCT(A2:A6,B2:B6) Variance =SUMPRODUCT(C2:C6,B2:B6) Std.Dev. =SQRT(B9) Slide 12 Using Excel to Compute the Expected Value, Variance, and Standard Deviation 1 2 3 4 5 6 7 8 9 10 Value Worksheet A Sales 0 1 2 3 4 B Probability 0.40 0.25 0.20 0.05 0.10 C Sq.Dev.from Mean 1.44 0.04 0.64 3.24 7.84 Mean 1.2 Variance 1.66 Std.Dev. 1.2884 Slide 13 Binomial Probability Distribution Properties of a Binomial Experiment • The experiment consists of a sequence of n identical trials. • Two outcomes, success and failure, are possible on each trial. • The probability of a success, denoted by p, does not change from trial to trial. • The trials are independent. Slide 14 Example: Evans Electronics Binomial Probability Distribution Evans is concerned about a low retention rate for employees. On the basis of past experience, management has seen a turnover of 10% of the hourly employees annually. Thus, for any hourly employees chosen at random, management estimates a probability of 0.1 that the person will not be with the company next year. Choosing 3 hourly employees a random, what is the probability that 1 of them will leave the company this year? Let: p = .10, n = 3, x = 1 Slide 15 Binomial Probability Distribution Binomial Probability Function n! f ( x) p x (1 p ) (n x ) x !( n x )! where: f(x) = the probability of x successes in n trials n = the number of trials p = the probability of success on any one trial Slide 16 Example: Evans Electronics Using the Binomial Probability Function n! f ( x) p x (1 p ) (n x ) x !( n x )! 3! f (1) ( 0.1)1 ( 0. 9 ) 2 1!( 3 1)! = (3)(0.1)(0.81) = .243 Slide 17 Example: Evans Electronics n 3 Using the Tables of Binomial Probabilities x 0 1 2 3 .10 .7290 .2430 .0270 .0010 .15 .6141 .3251 .0574 .0034 .20 .5120 .3840 .0960 .0080 .25 .4219 .4219 .1406 .0156 p .30 .3430 .4410 .1890 .0270 .35 .2746 .4436 .2389 .0429 .40 .2160 .4320 .2880 .0640 .45 .1664 .4084 .3341 .0911 .50 .1250 .3750 .3750 .1250 Slide 18 Example: Evans Electronics Using a Tree Diagram First Worker Second Worker Leaves (.1) Leaves (.1) Third Worker 3 .0010 S (.9) 2 .0090 2 .0090 1 .0810 L (.1) 2 .0090 S (.9) 1 .0810 L (.1) 1 .0810 S (.9) 0 .7290 L (.1) S (.9) Stays (.9) Stays (.9) Probab. L (.1) Stays (.9) Leaves (.1) Value of x Slide 19 Using Excel to Compute Binomial Probabilities Formula Worksheet A 1 2 3 4 5 6 7 8 9 x 0 1 2 3 B 3 = Number of Trials (n ) 0.1 = Probability of Success (p ) f (x ) =BINOMDIST(A5,$A$1,$A$2,FALSE) =BINOMDIST(A6,$A$1,$A$2,FALSE) =BINOMDIST(A7,$A$1,$A$2,FALSE) =BINOMDIST(A8,$A$1,$A$2,FALSE) Slide 20 Using Excel to Compute Binomial Probabilities Value Worksheet A 1 2 3 4 5 6 7 8 9 x 0 1 2 3 B 3 = Number of Trials (n ) 0.1 = Probability of Success (p ) f (x ) 0.729 0.243 0.027 0.001 Slide 21 Using Excel to Compute Cumulative Binomial Probabilities Formula Worksheet A 1 2 3 4 5 6 7 8 9 x 0 1 2 3 B 3 = Number of Trials (n ) 0.1 = Probability of Success (p ) Cumulative Probability =BINOMDIST(A5,$A$1,$A$2,TRUE) =BINOMDIST(A6,$A$1,$A$2,TRUE) =BINOMDIST(A7,$A$1,$A$2,TRUE) =BINOMDIST(A8,$A$1,$A$2,TRUE) Slide 22 Using Excel to Compute Cumulative Binomial Probabilities Value Worksheet A 1 2 3 4 5 6 7 8 9 x 0 1 2 3 B 3 = Number of Trials (n ) 0.1 = Probability of Success (p ) Cumulative Probability 0.729 0.972 0.999 1.000 Slide 23 Binomial Probability Distribution Expected Value E(x) = = np Variance Var(x) = 2 = np(1 - p) Standard Deviation SD( x ) np(1 p) Slide 24 Example: Evans Electronics Binomial Probability Distribution • Expected Value E(x) = = 3(.1) = .3 employees out of 3 • Variance Var(x) = 2 = 3(.1)(.9) = .27 • Standard Deviation SD( x) 3(.1)(.9) .52 employees Slide 25 Poisson Probability Distribution Properties of a Poisson Experiment • The probability of an occurrence is the same for any two intervals of equal length. • The occurrence or nonoccurrence in any interval is independent of the occurrence or nonoccurrence in any other interval. Slide 26 Poisson Probability Distribution Poisson Probability Function f ( x) x e x! where: f(x) = probability of x occurrences in an interval = mean number of occurrences in an interval e = 2.71828 Slide 27 Example: Mercy Hospital Using the Poisson Probability Function Patients arrive at the emergency room of Mercy Hospital at the average rate of 6 per hour on weekend evenings. What is the probability of 4 arrivals in 30 minutes on a weekend evening? = 6/hour = 3/half-hour, x = 4 34 ( 2. 71828) 3 f ( 4) .1680 4! Slide 28 Example: Mercy Hospital Using the Tables of Poisson Probabilities x 0 1 2 3 4 5 6 7 8 2.1 .1225 .2572 .2700 .1890 .0992 .0417 .0146 .0044 .0011 2.2 .1108 .2438 .2681 .1966 .1082 .0476 .0174 .0055 .0015 2.3 .1003 .2306 .2652 .2033 .1169 .0538 .0206 .0068 .0019 2.4 .0907 .2177 .2613 .2090 .1254 .0602 .0241 .0083 .0025 2.5 .0821 .2052 .2565 .2138 .1336 ..0668 .0278 .0099 .0031 2.6 .0743 .1931 .2510 .2176 .1414 .0735 .0319 .0118 .0038 2.7 .0672 .1815 .2450 .2205 .1488 .0804 .0362 .0139 .0047 2.8 .0608 .1703 .2384 .2225 .1557 .0872 .0407 .0163 .0057 2.9 .0550 .1596 .2314 .2237 .1622 .0940 .0455 .0188 .0068 3.0 .0498 .1494 .2240 .2240 .1680 .1008 .0504 .0216 .0081 Slide 29 Using Excel to Compute Poisson Probabilities Formula Worksheet A 1 2 B 3 = Mean No. of Occurrences ( ) Number of 3 Arrivals (x ) 4 0 5 1 6 2 7 3 8 4 9 5 10 6 Etc. Probability f (x ) =POISSON(A4,$A$1,FALSE) =POISSON(A5,$A$1,FALSE) =POISSON(A6,$A$1,FALSE) =POISSON(A7,$A$1,FALSE) =POISSON(A8,$A$1,FALSE) =POISSON(A9,$A$1,FALSE) =POISSON(A10,$A$1,FALSE) Etc. Slide 30 Using Excel to Compute Poisson Probabilities Value Worksheet A 1 2 B 3 = Mean No. of Occurrences ( ) Number of 3 Arrivals (x ) 4 0 5 1 6 2 7 3 8 4 9 5 10 6 Etc. Probability f (x ) 0.0498 0.1494 0.2240 0.2240 0.1680 0.1008 0.0504 Etc. Slide 31 Using Excel to Compute Cumulative Poisson Probabilities Formula Worksheet A 1 2 B 3 = Mean No. of Occurrences ( ) Number of 3 Arrivals (x ) 4 0 5 1 6 2 7 3 8 4 9 5 10 6 Etc. Cumulative Probability =POISSON(A4,$A$1,TRUE) =POISSON(A5,$A$1,TRUE) =POISSON(A6,$A$1,TRUE) =POISSON(A7,$A$1,TRUE) =POISSON(A8,$A$1,TRUE) =POISSON(A9,$A$1,TRUE) =POISSON(A10,$A$1,TRUE) Etc. Slide 32 Using Excel to Compute Cumulative Poisson Probabilities Value Worksheet A 1 2 B 3 = Mean No. of Occurrences ( ) Number of 3 Arrivals (x ) 4 0 5 1 6 2 7 3 8 4 9 5 10 6 Etc. Cumulative Probability 0.0498 0.1991 0.4232 0.6472 0.8153 0.9161 0.9665 Etc. Slide 33 Hypergeometric Probability Distribution The hypergeometric distribution is closely related to the binomial distribution. With the hypergeometric distribution, the trials are not independent, and the probability of success changes from trial to trial. Slide 34 Hypergeometric Probability Distribution Hypergeometric Probability Function where: r N r x n x f ( x) N n for 0 < x < r f(x) = probability of x successes in n trials n = number of trials N = number of elements in the population r = number of elements in the population labeled success Slide 35 Example: Neveready Hypergeometric Probability Distribution Bob Neveready has removed two dead batteries from a flashlight and inadvertently mingled them with the two good batteries he intended as replacements. The four batteries look identical. Bob now randomly selects two of the four batteries. What is the probability he selects the two good batteries? Slide 36 Example: Neveready Hypergeometric Probability Distribution r N r 2 2 2! 2! x n x 2 0 2!0! 0!2! 1 f ( x) .167 6 N 4 4! n 2 2!2! where: x = 2 = number of good batteries selected n = 2 = number of batteries selected N = 4 = number of batteries in total r = 2 = number of good batteries in total Slide 37 Using Excel to Compute Hypergeometric Probabilities Formula Worksheet A 1 2 2 2 3 2 4 4 5 6 f (x ) = 7 B = = = = Number Number Number Number of Successes (x ) of Trials (n ) of Elements in the Population Labeled Success (r ) of Elements in the Population (N ) =HYPGEOMDIST(A1,A2,A3,A4) Slide 38 Using Excel to Compute Hypergeometric Probabilities Value Worksheet A 1 2 2 2 3 2 4 4 5 6 f (x ) = 7 B = = = = Number Number Number Number of Successes (x ) of Trials (n ) of Elements in the Population Labeled Success (r ) of Elements in the Population (N ) 0.167 Slide 39 End of Chapter 5 Slide 40