Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
統計學 授課教師:統計系余清祥 日期:2010年10月26日 第五章:離散機率分配 Fall 2010 Chapter 5 Discrete Probability Distributions Random Variables Discrete Probability Distributions Expected Value and Variance Binomial Probability Distribution Poisson Probability Distribution Hypergeometric Probability .40 Distribution .30 .20 .10 0 1 2 3 4 Random Variables A (隨機變數) is A random random variable variable(隨機變數) is aa numerical numerical description description of of the the outcome outcome of of an an experiment. experiment. A A discrete discrete random random variable variable may may assume assume either either aa finite finite number number of of values values or or an an infinite infinite sequence sequence of of values. values. A A continuous continuous random random variable variable may may assume assume any any numerical numerical value value in in an an interval interval or or collection collection of of intervals. intervals. Discrete Random Variables Example1. The certified public accountant (CPA) examination has four parts. Define a random variable as x = the number of parts of the CPA examination passed and It is a discrete random variable because it may assume the finite number of values 0, 1, 2, 3, or 4. Discrete Random Variables Example 2. An experiment of cars arriving at a tollbooth. The random variable is x = the number of cars arriving during a one-day period. The possible values for x come from the sequence of integers 0, 1, 2, and so on. x is a discrete random variable assuming one of the values in this infinite sequence. Discrete Random Variables Examples of Discrete Random Variables Example: JSL Appliances Discrete random variable with a finite number of values Let Let xx == number number of of TVs TVs sold sold at at the the store store in in one one day, day, where where xx can can take take on on 55 values values (0, (0, 1, 1, 2, 2, 3, 3, 4) 4) Example: JSL Appliances Discrete random variable with an infinite sequence of values Let Let xx == number number of of customers customers arriving arriving in in one one day, day, where where xx can can take take on on the the values values 0, 0, 1, 1, 2, 2, .. .. .. We can count the customers arriving, but there is no finite upper limit on the number that might arrive. Random Variables Question Family size Random Variable x x = Number of dependents reported on tax return Type Discrete Distance from x = Distance in miles from home to the store site home to store Continuous Own dog or cat Discrete x = 1 if own no pet; = 2 if own dog(s) only; = 3 if own cat(s) only; = 4 if own dog(s) and cat(s) Continuous Random Variables Example 1. Experimental outcomes based on measurement scales such as time, weight, distance, and temperature can be described by continuous random variables. Continuous Random Variables Example 2. An experiment of monitoring incoming telephone calls to the claims office of a major insurance company. Suppose the random variable of interest is x = the time between consecutive incoming calls in minutes. This random variable may assume any value in the interval x ≥ 0. Continuous Random Variables Example of Continuous Random Variables 5.2 Discrete Probability Distributions The 機率分配) for The probability probability distribution distribution ((機率分配) for aa random random variable variable describes describes how how probabilities probabilities are are distributed distributed over over the the values values of of the the random random variable. variable. We We can can describe describe aa discrete discrete probability probability distribution distribution with with aa table, table, graph, graph, or or equation. equation. Discrete Probability Distributions The The probability probability distribution distribution is is defined defined by by aa probability probability function 機率函數), denoted (x), which function ((機率函數), denoted by by ff(x), which provides provides the the probability probability for for each each value value of of the the random random variable. variable. The The required required conditions conditions for for aa discrete discrete probability probability function function are: are: ff(x) (x) > 0 f(x) = 1 f(x) Discrete Probability Distributions Example: Probability Distribution for the Number of Automobiles Sold During a Day at Dicarlo Motors. Discrete Probability Distributions Using past data on TV sales, … a tabular representation of the probability distribution for TV sales 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 80/200 Discrete Probability Distributions Graphical Representation of Probability Distribution .50 Probability .40 .30 .20 .10 0 1 2 3 4 Values of Random Variable x (TV sales) Discrete Uniform Probability Distribution The 均勻) probability The discrete discrete uniform uniform ((均勻) probability distribution distribution is is the the simplest simplest example example of of aa discrete discrete probability probability distribution distribution given given by by aa formula. formula. The The discrete discrete uniform uniform probability probability function function is is ff(x) (x) = 1/ n 1/n the values of the random variable are equally likely where: n = the number of values the random variable may assume Discrete Uniform Probability Distribution Example: An experiment of rolling a die we define the random variable x to be the number of dots on the upward face. There are n = 6 possible values for the random variable; x = 1, 2, 3, 4, 5, 6. The probability function for this discrete uniform random variable is f (x) = 1/6 x = 1, 2, 3, 4, 5, 6. x 1 2 3 4 5 6 f (x) 1/6 1/6 1/6 1/6 1/6 1/6 Discrete Uniform Probability Distribution Example: Consider the random variable x with the following discrete probability distribution. x 1 2 3 4 f (x) 1/10 2/10 3/10 4/10 This probability distribution can be defined by the formula f (x) = x/ 10 for x = 1, 2, 3, or 4. 5.3 Expected Value and Variance The The expected expected value value,, or or mean, mean, of of aa random random variable variable is is aa measure measure of of its its central central location. location. E (x) = = xf(x) E(x) xf(x) The The variance variance summarizes summarizes the the variability variability in in the the values values of of aa random random variable. variable. Var( x) = 2 = (x - )2ff(x) (x) Var(x) (x The The standard standard deviation deviation,, ,, is is defined defined as as the the positive positive square square root root of of the the variance. variance. Expected Value and Variance Example: Calculation of the Expected Value for the Number of Automobiles Sold During A Day at Dicarlo Motors. Expected Value and Variance Example: Calculation of the Variance for the Number of Automobiles Sold During A Day at Dicarlo Motors. The standard deviation is 1.25 1.118 Expected Value and Variance Expected Value x 0 1 2 3 4 f(x) xf(x) .40 .00 .25 .25 .20 .40 .05 .15 .10 .40 E(x) = 1.20 expected number of TVs sold in a day Expected Value and Variance Variance and Standard Deviation x x- 0 1 2 3 4 -1.2 -0.2 0.8 1.8 2.8 (x - )2 f(x) (x - )2f(x) 1.44 0.04 0.64 3.24 7.84 .40 .25 .20 .05 .10 .576 .010 .128 .162 .784 Variance of daily sales = 2 = 1.660 TVs squared Standard deviation of daily sales = 1.2884 TVs 5.4 Binomial(二項) Distribution Four Properties of a Binomial Experiment 1. 1. The The experiment experiment consists consists of of aa sequence sequence of of nn identical identical trials. trials. 2. and failure failure,, are are possible possible 2. Two Two outcomes, outcomes, success success and on on each each trial. trial. 3. 3. The The probability probability of of aa success, success, denoted denoted by by pp,, does does not not change change from from trial trial to to trial. trial. stationarity assumption 4. The trials are independent. 4. The trials are independent. Binomial Distribution Our Our interest interest is is in in the the number number of of successes successes occurring occurring in in the the nn trials. trials. We We let let xx denote denote the the number number of of successes successes occurring occurring in in the the nn trials. trials. Binomial 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. Binomial Distribution Binomial Probability Function n! f (x) p x (1 p )( n x ) x !(n x )! n! x !( n x )! Number Number of of experimental experimental outcomes outcomes providing providing exactly exactly xx successes successes in in nn trials trials p x (1 p)( n x ) Probability Probability of of aa particular particular sequence sequence of of trial trial outcomes outcomes with with xx successes successes in in nn trials trials Binomial Distribution Example: The experiment of tossing a coin five times and on each toss observing whether the coin lands with a head or a tail on its upward face. we want to count the number of heads appearing over the five tosses. Does this experiment show the properties of a binomial experiment? Binomial Distribution Note that: 1. The experiment consists of five identical trials; each trial involves the tossing of one coin. 2. Two outcomes are possible for each trial: a head or a tail. We can designate head a success and tail a failure. 3. The probability of a head and the probability of a tail are the same for each trial, with p = .5 and 1- p = .5. 4. The trials or tosses are independent because the outcome on any one trial is not affected by what happens on other trials or tosses. Binomial Distribution Example: Evans Electronics Evans is concerned about a low retention rate for employees. In recent years, management has seen a turnover of 10% of the hourly employees annually. Thus, for any hourly employee chosen at random, management estimates a probability of 0.1 that the person will not be with the company next year. Binomial Distribution Using the Binomial Probability Function Choosing 3 hourly employees at random, what is the probability that 1 of them will leave the company this year? Let: p = .10, n = 3, x = 1 n! f ( x) p x (1 p ) ( n x ) x !( n x )! 3! f (1) (0.1)1 (0.9)2 3(.1)(.81) .243 1!(3 1)! Binomial Distribution Tree Diagram 1st Worker 2nd Worker Leaves (.1) Leaves (.1) 3rd Worker L (.1) x 3 Prob. .0010 S (.9) 2 .0090 L (.1) 2 .0090 S (.9) 1 .0810 L (.1) 2 .0090 S (.9) 1 .0810 1 .0810 0 .7290 Stays (.9) Leaves (.1) Stays (.9) L (.1) Stays (.9) S (.9) Binomial Distribution Using Tables of Binomial Probabilities p n x .05 .10 .15 .20 .25 .30 .35 .40 .45 .50 3 0 1 2 3 .8574 .1354 .0071 .0001 .7290 .2430 .0270 .0010 .6141 .3251 .0574 .0034 .5120 .3840 .0960 .0080 .4219 .4219 .1406 .0156 .3430 .4410 .1890 .0270 .2746 .4436 .2389 .0429 .2160 .4320 .2880 .0640 .1664 .4084 .3341 .0911 .1250 .3750 .3750 .1250 Binomial Distribution Expected Value E(x) = = np Variance Var(x) = 2 = np(1 p) Standard Deviation np(1 p ) Binomial Distribution Expected Value E(x) = = 3(.1) = .3 employees out of 3 Variance Var(x) = 2 = 3(.1)(.9) = .27 Standard Deviation 3(.1)(.9) .52 employees 5.5 Poisson(布阿松)Distribution A A Poisson Poisson distributed distributed random random variable variable is is often often useful useful in in estimating estimating the the number number of of occurrences occurrences over over aa specified specified interval interval of of time time or or space space ItIt is is aa discrete discrete random random variable variable that that may may assume assume an an infinite infinite sequence sequence of of values values (x (x == 0, 0, 1, 1, 2, 2, .. .. .. ).). Poisson Distribution Examples Examples of of aa Poisson Poisson distributed distributed random random variable: variable: the the number number of of knotholes knotholes in in 14 14 linear linear feet feet of of pine pine board board the the number number of of vehicles vehicles arriving arriving at at aa toll toll booth booth in in one one hour hour Bell Bell Labs Labs used used the the Poisson Poisson distribution distribution to to model model the the arrival arrival of of phone phone calls. calls. Poisson Distribution Two Properties of a Poisson Experiment 1. 1. The The probability probability of of an an occurrence occurrence is is the the same same for for any any two two intervals intervals of of equal equal length. length. 2. 2. The The occurrence occurrence or or nonoccurrence nonoccurrence in in any any interval interval is is independent independent of of the the occurrence occurrence or or nonoccurrence nonoccurrence in in any any other other interval. interval. Poisson 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. Poisson Distribution Example: We are interested in the number of arrivals at the drive-up teller window of a bank during a 15-minute period on weekday mornings. Assume that the probability of a car arriving is the same for any two time periods of equal length and that the arrival or nonarrival of a car in any time period is independent of the arrival or nonarrival in any other time period. Poisson Distribution The Poisson probability function is applicable. Suppose that the average number of cars arriving in a 15-minute period of time is 10; in this case, the following probability function applies. 10 10 e f ( x) x! x The random variable here is x = number of cars arriving in any 15-minute period. Poisson Distribution Example: Mercy Hospital M ERCY 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? Poisson Distribution Using the Poisson Probability Function = 6/hour = 3/half-hour, x = 4 34 (2.71828)3 f (4) .1680 4! M ERCY Poisson Distribution M ERCY Using Poisson Probability Tables 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 M ERCY Poisson Distribution Poisson Distribution of Arrivals Poisson Probabilities 0.25 Probability 0.20 actually, the sequence continues: 11, 12, … 0.15 0.10 0.05 0.00 0 1 2 3 4 5 6 7 8 9 Number of Arrivals in 30 Minutes 10 Poisson Distribution A A property property of of the the Poisson Poisson distribution distribution is is that that the the mean mean and and variance variance are are equal. equal. = 2 Poisson Distribution Variance for Number of Arrivals During 30-Minute Periods == 22 == 33 M ERCY 5.6 Hypergeometric(超幾何)Distribution The The hypergeometric hypergeometric distribution distribution is is closely closely related related to to the the binomial binomial distribution. distribution. However, However, for for the the hypergeometric hypergeometric distribution: distribution: the the trials trials are are not not independent, independent, and and the the probability probability of of success success changes changes from from trial trial to to trial. trial. Hypergeometric Distribution Hypergeometric Probability Function r N r x n x f ( x) N n for 0 < x < r where: 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. Hypergeometric Distribution Hypergeometric Probability Function f (x) r N r x n x N n number of ways x successes can be selected from a total of r successes in the population for 0 < x < r number of ways n – x failures can be selected from a total of N – r failures in the population number of ways a sample of size n can be selected from a population of size N Hypergeometric Probability Distribution Hypergeometric Probability Function The probability function ff(x) (x) on the previous slide is usually applicable for values of x = 0, 1, 2, … nn.. However, only values of x where: 1) x < r and 2) n – x < N – r are valid. If these two conditions do not hold for a value of xx,, the corresponding ff(x) (x) equals 0. Hypergeometric Distribution Example: A Quality Control Application. Electric fuses produced by Ontario Electric are packaged in boxes of 12 units each. Suppose an inspector randomly selects 3 of the 12 fuses in a box for testing. If the box contains exactly 5 defective fuses, what is the probability that the inspector will find exactly 1 of the 3 fuses defective? In this application, n = 3 and N = 12. With r = 5 defective fuses in the box. Hypergeometric Distribution The probability of finding x = 1 defective fuse is 5 7 5! 7! 1 2 ( 5 )( 21 ) 1!4! 2!5! . 4773 f (1) 220 12 ! 12 3!9! 3 What is the probability of finding at least 1 defective fuse? The probability of x = 0 is 5 7 5! 7 ! 0 3 0 ! 5 ! 3 ! 4 ! (1 )( 35 ) . 1591 f (0 ) 220 12 ! 12 3!9 ! 3 we conclude that the probability of finding at least 1 defective fuse must be 1 - .1591 = .8409. Hypergeometric Distribution ZAP Example: Neveready 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? ZAP ZAP ZAP Hypergeometric Distribution Using the Hypergeometric Function r N r 2 2 2! 2! x n x 2 0 2!0! 0!2! 1 .167 f ( x ) 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 Hypergeometric Distribution Mean r E ( x) n N Variance r N n r Var ( x) n 1 N N N 1 22 Hypergeometric Distribution Mean r 2 n 2 1 N 4 Variance 2 2 4 2 1 2 1 .333 4 4 4 1 3 22 Hypergeometric Distribution Consider a hypergeometric distribution with n trials and let p = (r/n) denote the probability of a success on the first trial. If the population size is large, the term (N – n)/(N – 1) approaches 1. The expected value and variance can be written E(x) = np and Var(x) = np(1 – p). Note that these are the expressions for the expected value and variance of a binomial distribution. continued Hypergeometric Distribution When When the the population population size size is is large, large, aa hypergeometric hypergeometric distribution distribution can can be be approximated approximated by by aa binomial binomial distribution distribution with with nn trials trials and and aa probability probability of of success success pp == ((r/N). r/N). 期望值與變異數的計算: E ( X ) xf ( x) x Var ( X ) ( x ) f ( x) E[( X ) ] 2 2 2 x E[ X 2 2 X 2 ] E ( X ) 2 E ( X ) 2 E ( X ) 2 2 2 2 2 E( X 2 ) E( X )2 或是 2 Var ( X ) E[ X ( X 1)] E ( X ) E ( X ) 二項分配的來源: 二項分配源自二項式展開,例如 10 (a b) ( 10x ) a x b10 x 10 x 0 因此 a3b7 的係數= 10 =120。 3 ( ) 二項分配即由這個想法衍生而成,或是 n 1 [ p (1 p )] ( ) p (1 p ) n x 0 n x 也就是令 f ( x) ( ) p (1 p ) n x x x n x n x n (1) ,則 f ( x) 1。 x 0 期望值的計算如下: n! E( X ) x f (x) x px (1 p)nx x x0 x!(n x)! n n! x nx p (1 p) x1 (x 1)!(n x)! n n(n 1)! p px (1 p)(n1)( x1) x1 (x 1)![(n 1) (x 1)]! n (n 1)! (令 t x 1) np pt (1 p)(n1)t t 0 t![(n 1) t]! np1 np n 變異數的計算也類似: n! p x (1 p ) n x E[ X ( X 1)] x( x 1) f ( x) x( x 1) x x 0 x!(n x)! n n! p x (1 p ) n x x 2 ( x 2)!( n x )! n2 (n 2)! 2 ( n 2 ) t t t x n n p p p (令 2) ( 1) (1 ) t 0 t![( n 2) t ]! n n(n 1) p 2 因此,Var ( X ) E[ X ( X 1)] E ( X ) E ( X ) 2 n(n 1) p 2 np n 2 p 2 np (1 p ) 布阿松分配的來源: 布阿松分配源自自然指數的展開式 2 3 n t t t et 1 t 2! 3! n! x 因為機率函數為 f ( x) e ,推導可得 x! f ( x) e x 0 同理可算出 E( X ) x 0 x x! e e 1 及 E[ X ( X 1)] 2 Var ( X ) End of Chapter 5