StMath 390, Homework set # 2 Due January 17, 2017 Problem 1 (Page 99, number 8). Each time a component is tested, the trial is a success S or failure F . Suppose the component is tested repeatedly until a success occurs on three consecutive trials. Let Y denote the number of trials necessary to achieve this. List all outcomes corresponding to the five smallest possible values of Y , and state which Y value is associated with each one. Solution to Problem 1. I use a sequence of Ss and F s to represent an outcome in this experiment. For example the sequence SF SF represents a sequence of four trials which resulted on successes on the first and third trials, and failures on the second and fourth trials. The table of outcomes with the corresponding five smallest values of Y is shown below. The explanation of how to come up with this table follows. Sequences SSS F SSS F F SSS SF SSS F F F SSS F SF SSS SF F SSS SSF SSS F F F F SSS SF F F SSS F SF F SSS F F SF SSS F SSF SSS SF SF SSS SSF F SSS Value of Y 3 4 5 5 6 6 6 6 7 7 7 7 7 7 7 In order to get at least three consecutive successes we need at least three trials. Therefore the smallest value that Y can take is 3, and we have that Y = 3 when the outcome is the sequence SSS. It makes sense to assume that the five smallest possible values of Y are 3, 4, 5, 6, and 7. We can verify whether this is correct by listing each successive sequences of Ss and F s and determining in each case the value of Y . It is worthwhile trying to see whether some special patterns should occur for each value of Y . For any value of Y the last three trials should be successes, i.e., the outcome will always be of the form · · · SSS. So Y = 3 only for the outcome SSS. For any other value of Y , i.e., for any value greater than 3, the trial before the last three has to be a failure for otherwise Y would be smaller. For example if we have the sequence SSSS then Y 6= 4 but in fact Y = 3. So 1 now we know that SSS is the only sequence which give us Y = 3, and we know that F SSS is the only sequence that gives us Y = 4. For any value of Y greater than 4 we always end with the sequence F SSS and for the trials before the last 4 we can have any arrangement of Ss and F s as long as there no three consecutive Ss. In the cases Y = 5 and Y = 6 there is no room for 3 consecutive Ss before the ending F SSS, and therefore any arrangement of Ss and F s works. In the table above we see that there are two sequences for which Y = 5, and four for which Y = 6. For the case Y = 7 we have to be careful. We know we have to end with F SSS but we also have to consider what is acceptable on the three trails before that ending. A possible outcome of this experiment can be the sequence SSSF SSS in which case Y 6= 7 but in fact Y = 3. Every other arrangement of Ss and F s works, in fact there are 7 such possibilities, all shown in the table above. Problem 2 (Page 107, number 12). Airlines sometimes overbook flights. Suppose that for a plane with 50 seats, 55 passengers have tickets. Define the random variable Y as the number of ticketed passengers who actually show up for the flight. The probability mass function of Y appears in the accompanying table. y p(y) 45 .05 46 .10 47 .12 48 .14 49 .25 50 .17 51 .06 52 .05 53 .03 54 .02 55 .01 (a) What is the probability that the flight will accommodate all ticketed passengers who show up? (b) What is the probability that not all ticketed passengers who show up can be accommodated? (c) If you are the first person on the standby list (which means you will be the first one to get on the plane if there are any seats available after all ticketed passengers have been accommodated), what is the probability that you will be able to take the flight? What is this probability if you are the third person on the standby list? Solution to Problem 2. (a) The flight will accommodate all ticketed passengers who show up if 50 or fewer of such passengers show up, ie., if Y ≤ 50. Therefore the probability that the flight will accommodate all ticketed passengers who show up is P (Y ≤ 50) = 50 X P (Y = i) = p(45) + . . . + p(50) i=45 = .05 + .10 + .12 + .14 + .25 + .17 = .83 2 (b) Not all ticketed passengers who show up can be accommodated if too many show up, i.e., if Y > 50. So the probability that not all ticketed passengers who show up can be accommodated is P (Y > 50) = 1 − P (Y ≤ 50) = 1 − .83 = .17 Obviously this can also be computed as P (Y > 50) = 55 X P (Y = i) = p(51) + . . . + p(55) i=51 = .06 + .05 + .03 + .02 + .01 = .17 (c) The first person on the standby list will be able to take the flight if 49 or fewer ticketed passengers show up. So the probability that first person on the standby list gets on the flight is P (Y ≤ 49) = 49 X P (Y = i) = p(45) + . . . + p(49) i=45 = .05 + .10 + .12 + .14 + .25 = .66 Similarly the third person on the standby list will be able to take the flight if 47 or fewer ticketed passengers show up. So the probability that third person on the standby list gets on the flight is P (Y ≤ 47) = 47 X P (Y = i) = p(45) + p(46) + p(47) = .05 + .10 + .12 = .27 i=45 Computations for item (a) can be done in R as follows: > x=c(.05, .10, .12, .14, .25, .17) > sum(x) [1] 0.83 Problem 3 (Page 117, number 38). Possible values of X, the number of components in a system submitted for repair that must be replaced, are 1, 2, 3, and 4 with corresponding probabilities .15, .35, .35, and .15, respectively. (a) Calculate E(X) and then E(5 - X). (b) Would the repair facility be better off charging a flat fee of $75 or else the amount $[150/(5 − X)]? Solution to Problem 3. 3 (a) Expected values: E(X) = 4 X kP (X = k) k=1 = 1P (X = 1) + 2P (X = 2) + 3P (X = 3) + 4P (X = 4) = 1 × .15 + 2 × .35 + 3 × .35 + 4 × .15 = .15 + .70 + 1.05 + .60 = 2.50 We can compute E(5 − X) in two ways. We learnt that for any two constants a and b we have that E(aX + b) = aE(X) + b. So in our particular case E(5 − X) = 5 − E(X) = 5 − 2.5 = 2.50 The second approach uses the fact that for any function h(x) the expected value of h(X) is given by X E[h(X)] = h(k)P (X = k). (1) k So in our particular case E(5 − X) = 4 X (5 − k)P (X = k) k=1 = 4P (X = 1) + 3P (X = 2) + 2P (X = 3) + 1P (X = 4) = 4 × .15 + 3 × .35 + 2 × .35 + 1 × .15 = .60 + 1.05 + .70 + .15 = 2.50 (b) Would the repair facility be better off charging a flat fee of $75 or else the amount $[150/(5 − X)]? Using formula (1) that we saw above we have that E[150/(5 − X)] = 4 X 150 P (X = k) 5−k k=1 150 150 150 150 = P (X = 1) + P (X = 2) + P (X = 3) + P (X = 4) 4 3 2 1 = 37.5 × .15 + 50 × .35 + 75 × .35 + 150 × .15 = 71.875 The computations can de done in R as follows: 4 > x=1:4 # sets the values of X > p=c(.15, .35, .35, .15) # sets the pmf > sum(p) # verifies that the p’s add to 1 [1] 1 > EX=sum(x*p) # computes E(X) > EX [1] 2.5 > sum((5-x)*p) # computes E(5-X) [1] 2.5 > sum(p*150/(5-x)) # computes E[150/(5-X)] [1] 71.875 Problem 4 (Page 123, number 48 - Why is the binomial model appropriate?). NBC News reported on May 2, 2013, that 1 in 20 children in the United States have a food allergy of some sort. Consider selecting a random sample of 25 children and let X be the number in the sample who have a food allergy. Then X ∼ Bin(25, .05). (a) Determine both P (X ≤ 3) and P (X < 3). (b) Determine P (X ≥ 4). (c) Determine P (1 ≤ X ≤ 3). (d) What are E(X) and σX ? (e) In a sample of 50 children, what is the probability that none has a food allergy? Solution to Problem 4. To answer the questions in this problem we will use the fact that X is a binomial random variable. This can be justified as follows: • A group of n = 25 children is selected. • Each child is checked to see whether the child has a food allergy or not (a yes/no situation). Formally, for the ith child we could define a Bernoulli random variable Xi as follows 1 if the ith child has a food allergy Xi = 0 otherwise • The chance that the ith child has a food allergy is p = 1/20 = .05, i.e., the same for all children. • The fact that the children are selected at random assures independence, i.e., the fact that a given has a food allergy is not affected nor it affects by what happens with the rest of the children. 5 • For each child that has a food allergy we add 1 to the counter X, i.e., X is the total number of children with a food allergy Now we answer the questions (a) P (X ≤ 3) = 3 X P (X = i) = i=0 3 X 25 i=0 i .05i .9525−i ≈ 0.277 + 0.365 + 0.231 + 0.093 = .966 P (X < 3) = 2 X P (X = i) = i=0 2 X 25 .05i .9525−i i i=0 ≈ 0.277 + 0.365 + 0.231 = .873 In R > round(dbinom(0:3, 25, .05),3) [1] 0.277 0.365 0.231 0.093 > round(sum(dbinom(0:3, 25, .05)),3) [1] 0.966 > round(pbinom(3, 25, .05),3) [1] 0.966 > round(pbinom(2, 25, .05),3) [1] 0.873 (b) P (X ≥ 4) = 1 − P (X < 4) = 1 − P (X ≤ 3) ≈ 1 − .966 = .034 (c) Determine P (1 ≤ X ≤ 3). P (1 ≤ X ≤ 3) = 3 X P (X = i) = i=1 3 X 25 i=1 i .05i .9525−i ≈ 0.365 + 0.231 + 0.093 = .689 (d) We know that for a binomial random variable X ∼ Bin(n, p) p E(X) = np and σX = np(1 − p). √ In our case E(X) = 25 × .05 = 1.25 and σX = 25 × .05 × .95 ≈ 1.09. We can verify this using the definition of expected values and doing the computations in R: 6 > n=25 > p=.05 > x=0:25 > mean=sum(dbinom(x,n,p)*x); mean [1] 1.25 > var=sum(dbinom(x,n,p)*(x-mean)^2); var [1] 1.1875 > sqrt(var) [1] 1.089725 (e) Now we want the probability that no children, in a sample of 50, has a food allergy. This we do using Y ∼ Bin(50, .05) and computing 50 P (Y = 0) = .050 .955 0 = .9550 ≈ .077 0 In R > dbinom(0,50,.05) [1] 0.07694498 > .95^50 [1] 0.07694498 Problem 5 (Page 135, number 84). The Centers for Disease Control and Prevention reported in 2012 that 1 in 88 American children had been diagnosed with an autism spectrum disorder (ASD). (a) If a random sample of 200 American children is selected, what are the expected value and standard deviation of the number who have been diagnosed with ASD? (b) Referring back to (a), calculate the approximate probability that at least 2 children in the sample have been diagnosed with ASD? (c) If the sample size is 352, what is the approximate probability that fewer than 5 of the selected children have been diagnosed with ASD? Solution to Problem 5. Let X be the number of children, in a random sample of n children that are diagnosed with ASD. Following a reasoning similar to teh one used in the last problem we can see that X is a binomial random variable with parameters n and p = 1/88. (a) For the case of a random sample of 200 children, then X ∼ B(n = 200, p = 1/88), and so p E(X) = np = 200/88 ≈ 2.273, σX = np(1 − p) ≈ 1.499. 7 (b) The probability that at least 2 children in the sample have been diagnosed with ASD is 200 200 P (X ≥ 2) = 1−P (X ≤ 1) = 1− (87/88)200 + (1/88)(87/88)199 ≈ .665 0 1 Using the Poisson approximation with λ = np ≈ 2.273 we have that P (X ≥ 2) = 1 − P (X ≤ 1) ≈ 1 − e−λ + e−λ λ ≈ .663. In R > n=200 > p=1/88 > round(1-pbinom(1,n,p),3) [1] 0.665 > lam=n*p > lam [1] 2.272727 > round(1-ppois(1,lam),3) [1] 0.663 (c) If the sample size is n = 352 the probability that fewer than 5 of the selected children have been diagnosed with ASD is computed using the Poison approximation with λ = np = 4: P (X < 5) ≈ 4 X e−4 i=0 4i i! 41 42 43 44 40 + + + + =e 0! 1! 2! 3! 4! 32 32 = e−4 1 + 4 + 8 + + ≈ .629 3 3 −4 In R > n=352 > p=1/88 > lam=n*p; lam [1] 4 > round(ppois(4,lam),3) [1] 0.629 8
© Copyright 2026 Paperzz