Survey

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Survey

Document related concepts

Transcript

Chapter 5 Discrete Probability Distributions Random Variables x is a random variable which is a numerical description of the outcome of an experiment. Discrete: If the possible values change by steps or jumps. Example: Suppose we flip a coin 5 times and count the number of tails. The number of tails could be 0, 1, 2, 3, 4 or 5. Therefore, it can be any integer value between (and including) 0 and 5. However, it could not be any number between 0 and 5. We could not, for example, get 2.5 tails. Therefore, the number of tails must be discrete. Continuous: If the possible values can take any value within some range. Example: The height of trees is an example of continuous data. Is it possible for a tree to be 2.105m tall? Sure. How about 2.10567m? Yes. How about 2.105679821014m? Definitely! Discrete Random Variables Consider the sales of cars at a car dealership over the past 300 days. Frequency Distribution: Number of cars sold per day 0 1 2 3 4 5 Number of days (frequency) 54 117 72 42 12 3 300 Define the random variable: Let x = the number of cars sold during a day. Note: We make the assumption that no more than 5 cars are sold per day. Sample Space: S = {0, 1, 2, 3, 4, 5} Notation: P(X = 0) = f(0) = P(X = 1) = f(1) = P(X = 2) = f(2) = P(X = 3) = f(3) = P(X = 4) = f(4) = P(X = 5) = f(5) = probability of 0 cars sold probability of 1 car sold probability of 2 cars sold probability of 3 cars sold probability of 4 cars sold probability of 5 cars sold Copyright Reserved 1 Note: f(x) = probability function The probability function provides the probability for each value of the random variable Probability distribution for the number of cars sold per day at a car dealership f(x) x Number of days (frequency) 0 54 1 117 2 72 3 42 4 12 5 3 300 1 Question: Does the above mentioned probability function fulfill the required conditions for a discrete probability function? There are two requirements: (i) for all ∑ (ii) Yes, both requirements are fulfilled. Probability Graphical representation of the probability distribution for the number of cars sold per day 0.45 0.4 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 0.39 0.24 0.18 0.14 0.04 0 1 2 3 4 0.01 5 Number of cars sold per day Copyright Reserved 2 Questions: a) The probability that 2 cars are sold per day? b) The probability that, at most, 2 cars are sold per day? c) The probability that more than 2 cars are sold per day? d) The probability that at least 2 cars are sold per day? e) The probability that more than 1 but less than 4 cars are sold per day? Copyright Reserved 3 Discrete Uniform probability function: where n = the number of values the random variable may assume Example: Dice for x = 1, 2, 3, 4, 5, 6 x 1 f(x) 2 3 4 5 6 Does the above mentioned probability function fulfill the required conditions for a discrete probability function? There are two requirements: (i) for all ∑ (ii) Yes, both requirements are fulfilled. Another example of a random variable x with the following discrete probability distribution for x = 1, 2, 3, 4 x 1 2 3 4 f(x) Does the above mentioned probability function fulfill the required conditions for a discrete probability function? There are two requirements: (i) for all ∑ (ii) Yes, both requirements are fulfilled. Copyright Reserved 4 Expected value, variance, standard deviation and median: Probability Graphical representation of the probability distribution for the number of cars sold per day 0.45 0.4 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 0.39 0.24 0.18 0.14 0.04 0 1 2 3 4 0.01 5 Number of cars sold per day Expected Value ∑ 1.5 Variance ∑ 1.25 Standard deviation √ √ Median 0 0.18 0 and 1 0.18 + 0.39 = 0.57 > 0.5 Therefore, the median = 1 Copyright Reserved 5 OR use a table to calculate the expected value, variance and standard deviation: x 0 1 2 3 4 5 f(x) 0.18 0.39 0.24 0.14 0.04 0.01 x f(x) 0 0.39 0.48 0.42 0.16 0.05 = 1.5 -1.5 -0.5 0.5 1.5 2.5 3.5 2.25 0.25 0.25 2.25 6.25 12.25 0.4050 0.0975 0.0600 0.3150 0.2500 0.1225 = 1.25 √ Example: A psychologist has determined that the number of hours required to obtain the trust of a new patient is either 1, 2 or 3 hours. Let x = be a random variable indicating the time in hours required to gain the patient’s trust. The following probability function has been proposed: for x = 1, 2, 3 Questions: a) Set up the probability function of x. b) Is this a valid probability function? Explain. c) Give a graphical representation of the probability function of x. d) What is the probability that it takes exactly 2 hours to gain the patient’s trust? e) What is the probability that it takes at least 2 hours to gain the patient’s trust? f) Calculate the expected value, variance and standard deviation. Copyright Reserved 6 Answers: a) x 1 f(x) ⁄ 2 ⁄ 3 ⁄ ̇ ̇ 1 b) There are two requirements: (i) for all ∑ (ii) Yes, both requirements are fulfilled. c) Graphical representation of the probability distribution 0.6 Probability 0.5 0.4 0.3 0.2 0.1 0 1 2 3 x ̇ ⁄ d) ⁄ e) x 1 2 3 f(x) 0.1667 0.3333 0.5 ̇ ̇ ∑ √ ⁄ ̇ ∑ f) ⁄ √ ̇ x f(x) 0.1667 0.6667 1.5000 2.3333 -1.3333 -0.3333 0.6667 1.7778 0.1111 0.4444 0.2963 0.0370 0.2222 0.5556 Copyright Reserved 7 Binomial distribution 1. The experiment consists of a sequence of n identical trials. 2. 3. Two outcomes are possible on each trial. We refer to a Success Failure The probability of a success, denoted by p does not change from trial to trial. Consequently, the probability of a failure, denoted by 1 – p, does not change from trial to trial. 4. The trials are independent In general: Let: x = number of successes Then x has a binomial distribution of n trials and the probability of a success of p. The Binomial probability function is: ( ) Martin clothing store problem: Let us consider the purchase decisions of the next 3 customers who enter the Martin clothing store. On the basis of past experience, the store manager estimates the probability that any one customer will make a purchase is 0.3. Let: S = customer makes a purchase (success) F = customer does not make a purchase (failure) The above mentioned is a Binomial experiment, because: 1. n = 3 identical trials 2. Two possible outcomes • customer makes a purchase (success) • customer does not make a purchase (failure) 3. Probability of a success p = 0.3 and a failure 1 – p = 0.7 4. The trials are independent Let x = number of customers that make a purchase OR x = number of successes Copyright Reserved 8 Tree Diagram: 1st 2nd S S 3rd Value of x S (S, S, S) 3 F (S, S, F) 2 S (S, F, S) 2 (S, F, F) 1 (F, S, S) 2 F (F, S, F) 1 S (F, F, S) 1 F (F, F, F) 0 F F S F Outcomes S F Total number of experimental outcomes: Using the tree diagram we count 8 experimental outcomes. Using the counting rule for multiple-step experiments we get (n1)(n2)(n3) = (2)(2)(2) = 8. Since the binomial distribution only as two possible outcomes on each step (success or failure), we can use the formula which in this case equals where n denotes the number of trials in the binomial experiment. Copyright Reserved 9 Calculating binomial probabilities: ( ) Question 1: Calculate the probability that 2 out of the 3 customers make a purchase. Answer 1: ( ) Question 2: Calculate the probability that 1 out of the 3 customers make a purchase. Answer 2: ( ) Question 3: Calculate the probability that 3 out of the 3 customers make a purchase. Answer 3: ( ) Question 4: Calculate the probability that 0 out of the 3 customers make a purchase. Answer 4: ( ) Copyright Reserved 10 The probability distribution for the number of customers making a purchase: x 0 1 2 3 f(x) 0.343 0.441 0.189 0.027 1 Does it fulfill the basic requirements for a discrete probability function? There are two requirements: (iii) for all ∑ (iv) Yes, both requirements are fulfilled. Calculate the expected value, variance and standard deviation of x: x 0 1 2 3 f(x) 0.343 0.441 0.189 0.027 x f(x) 0 0.441 0.378 0.081 0.9 -0.9 0.1 1.1 2.1 0.81 0.01 1.21 4.41 0.27783 0.00441 0.22869 0.11907 0.63 ∑ ∑ √ √ Formulas of and for the Binomial Probability Distribution: Test: √ Copyright Reserved 11 EXCEL: BINOMDIST(x, n, p, false) – normal probability BINOMDIST(x, n, p, true) – cumulative probability Formula Worksheet Value Worksheet Value Worksheet with explanations Copyright Reserved 12 Example: (Extension of the Martin-experiment) Suppose 10 customers go into the store. The probability of purchasing something is 0.3 Let x = number of customers that make a purchase Questions: 1. What is the distribution of x. Binomial with n = 10 and p = 0.3 2. Calculate the expected value, variance and standard deviation of x. √ 3. Calculate the probability distribution of x. x 0 f(x) f(0) = ( ) 1 f(1) = ( ) 2 f(2) = ( ) 3 f(3) = ( ) 4 f(4) = ( ) 5 f(5) = ( ) 6 f(6) = ( ) 7 f(7) = ( ) 8 f(8) = ( ) 9 f(9) = ( ) 10 f(10) = ( ) Copyright Reserved 13 4. A graphical representation of the probability distribution of x. Probability distribution of 10 customers 0.30 0.267 0.233 0.25 0.200 f(x) 0.20 0.15 0.121 0.103 0.10 0.05 0.037 0.028 0.009 0.001 0.000 0.000 0.00 0 1 2 3 4 5 6 7 8 9 10 x 5. Calculate the cumulative distribution of x. Formula worksheet Copyright Reserved 14 Value worksheet Value worksheet with explanations Copyright Reserved 15 6. Calculate the probability that: (a) At most 3 clients purchase something: (b) Only 3 clients purchase something: or ( ) (c) More than 1 client purchase something: since (d) More than 2 but less than 5 clients purchase something: OR (e) Less than 5 clients purchase something: (f) At least 4 clients purchase something: (g) Exactly 6 clients do not purchase anything: If 6 clients do not purchase something, then 4 clients purchase something or (h) Difficult question: Calculate the probability that the first three clients make a purchase: Copyright Reserved 16 Shape of the Binomial distribution: Binomial: n = 10 and p < 0.5 Skewed to the right 0.35 Probability 0.3 0.25 0.2 0.15 0.1 0.05 0 1 2 3 4 5 6 7 8 9 10 11 10 11 10 11 x Binomial: n = 10 and p = 0.5 Symmetric 0.3 Probability 0.25 0.2 0.15 0.1 0.05 0 1 2 3 4 5 6 7 8 9 x Binomial: n = 10 and p > 0.5 Skewed to the left 0.35 Probability 0.3 0.25 0.2 0.15 0.1 0.05 0 1 2 3 4 5 6 7 8 9 x Copyright Reserved 17