name: · web viewexpectation and variance of discrete random variables). suppose a discrete random...

13
CS 237—Midterm Exam Two Summer 2016 You must complete 5 of the 6 problems on this exam for full credit. Each problem is of equal weight. Please leave blank, or draw an X through, or write “Do Not Grade,” on the problem you are eliminating; I will grade the first 5 I get to if I can not figure out your intention. If answers are on the back of the page please tell me so. Circle final answers. No calculators allowed, and you may leave complicated formulae uncomputed, but please do multiply 1/2 * 1/2 to get 1/4 if the occasion presents itself. In composing your answers, remember that your goal is to show me you understand the techniques presented in the course; if you can not completely solve the problem, show me as much as you know and I will attempt to give you partial credit. Problem One (Expectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF: f(x) = 1/9 if x is an integer in the range [-4 .. 4] 0 otherwise and let Z = X 2 . (a) Draw the CDF of X. Name: Solution Key

Upload: others

Post on 22-Jun-2021

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Name: · Web viewExpectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF: f(x) = 1/9 if x is an

CS 237—Midterm Exam TwoSummer 2016

You must complete 5 of the 6 problems on this exam for full credit. Each problem is of equal weight. Please leave blank, or draw an X through, or write “Do Not Grade,” on the problem you are eliminating; I will grade the first 5 I get to if I can not figure out your intention. If answers are on the back of the page please tell me so. Circle final answers. No calculators allowed, and you may leave complicated formulae uncomputed, but please do multiply 1/2 * 1/2 to get 1/4 if the occasion presents itself.

In composing your answers, remember that your goal is to show me you understand the techniques presented in the course; if you can not completely solve the problem, show me as much as you know and I will attempt to give you partial credit.

Problem One (Expectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF:

f(x) = 1/9 if x is an integer in the range [-4 .. 4]

0 otherwise

and let Z = X2.

(a) Draw the CDF of X.

(b) Give the range Rng(Z) and probability function pX for Z.

Rng(Z) = { 0, 1, 4, 9, 16 }

pX = { 1/9, 2/9, 2/9, 2/9, 2/9 }

Name: Solution Key

Page 2: Name: · Web viewExpectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF: f(x) = 1/9 if x is an

(c) What is E[Z]?

E[Z] = 0*1/9 + 1*2/9 + 4*2/9 + 9*2/9 + 16*2/9 = 20/3 = 6.6667.

(d) What is Var(X)?

Since E[X] = 0, this is relatively easy:

Var(X) = ( (-4)2 + (-3)2 + (-2)2 + (-1)2 + 02 + 12 + 22 + 32 + 42 ) / 9

= 60 / 9 = 6.6667

Page 3: Name: · Web viewExpectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF: f(x) = 1/9 if x is an

Problem Two (Poisson and Exponential Distributions) The probability that a meteorite lands anywhere in the Sahara desert is modeled as a Poisson random variable with a mean of 10 days. (a) Using the Poisson Distribution, answer the following question: It is currently midnight; what is the probability that at least one meteorite lands by noon?

Solution: We must convert the time unit from 10 days to 12 hour periods, converting the mean from λ = 1 in 10 days to λ = 0.05 in 12 hours; using X ~ Poi( 0.05 ), we seek

P(X ≥ 1) = 1.0 - P(X = 0) = 1.0 - e-0.05 λ0 / 0! = 1.0 - e-0.05 = 1.0 - 0.9512 = 0.0488.

(b) Using the Poisson Distribution, answer the following question: It is currently midnight; supposing no meteorite lands by 6am, what is the probability that at least one will land by noon?

Solution: Since every time unit in the Poisson is independent, we simply calculate the probability of a meteorite landing in a 6 hour period; analogous to (a), we have X ~ Poi( 0.025 ), and we seek

P(X ≥ 1) = 1.0 - P(X = 0) = 1.0 - e-0.025 λ0 / 0! = 1.0 - e-0.025 = 1.0 - 0.9753 = 0.0247.

(c) Redo problem (a) using the Exponential Distribution.

Solution: This is now a question of a random variable X ~ Exp( 0.1 ), i.e., where the mean waiting time between arrivals of meteorites is 10 days. Our units are days. Using the familiar formula

we have

P(X < 0.5) = 1.0 - P(X ≥ 0.5) = 1.0 - e-(0.1*0.5) = 1.0 - e-0.05 = 0.0488.

(d) Using the Exponential Distribution, answer the following question: It is currently midnight; what is the probability that the first meteorite lands some time between 6am and 6pm?

Solution: Now we have

Note that you might also reason using the memory-less property (as we did in this class) that this is the same as “It is now 6am (and no meteorite has landed in the last half hour), what is the probability of one landing in the next 12 hours,” i.e., it is equivalent to (a), which would give the same answer as (a), or 1.0 - e-0.05 = 0.0488. However, this does not account for the fact that at midnight, you had no idea whether a meteorite would show up in the next 6 hours, but at 6am, you knew that none did. The situations are not identical, and it is not surprising that having more information (i.e., that no meteorite would land in the next 6 hours) changes the answer. I would give full credit to either answer (since it is so confusing!). Damn word problems!

(e) Although the Poisson and Exponential are intimately related, we did not give the Poisson as an example of a distribution that has the memory-less property. Explain the technical reason why this is true.

Solution: The Poisson does not have the mathematical property that

and indeed the Geometric Distribution is the only discrete distribution to have such a property. The Poisson characterizes the number of arrivals in a given time unit, each of which is independent, and independence is a kind of informal “memory-less” property (no time unit “remembers” what happened in the previous time unit); this corresponds to the formal notion of “memory-less” in the corresponding Exponential distribution. So independence in time units corresponds to memorylessness in waiting times. The same

Page 4: Name: · Web viewExpectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF: f(x) = 1/9 if x is an

situation occurs with the Bernoulli and the Geometric: the individual Bernoulli trials when waiting for the first head are independent, but only the Geometric is memoryless.

The confusion occurs with the phrase “the first meteorite” -- does this mean you know that none shows up in the first six hours, or not? One might lean towards the latter interpretation, but it is not completely clear!

Page 5: Name: · Web viewExpectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF: f(x) = 1/9 if x is an

Problem Three (Joint Discrete Random Variables). Suppose we flip two fair coins. Let X = the number of heads showing on the first flip and Y = the total number of heads showing on both flips.

(a) Analyze the joint random variable (X,Y) using the matrix/table approach and give the joint distribution and each of the marginal distributions.

(b) Calculate the correlation coefficient for (X,Y).

(c) Give the (conditional) random variable Z = Y|A, where A = “at least one coin shows a head.”

Solution: Rng(Z) = { 1, 2 } pZ = { 2/3, 1/3 }

(b)

Page 6: Name: · Web viewExpectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF: f(x) = 1/9 if x is an

Problem Four (Limit Theorems). We load on a plane 100 packages whose weights are independent random variables that are uniformly distributed between 5 and 50 points. What is the probability that their total weight will exceed 3000 pounds?

(a) Answer this question using the Markov Inequality.

Solution: We are considering a continuous random variable X100 which is the sum of 100 i.i.d random variables X ~ Uniform(5,50), and so we know that E[X] = (50-5)/2 = 22.5 and E[X100] = 2250. Therefore

P(X ≥ 3000) ≤ 2250 / 3000 = 0.75

The probability is less than 75 %.

(b) Answer this question using the Chebyshev Inequality.

Solution: Var(X) = (50-5)2 / 12 = 675 / 4 = 168.75 and so Var(X100) = 16875. Thus:

P(X100 ≥ 3000 ) = P( X100 - 2250 ≥ 750 ) ≤ P( |X100 - 2250 | ≥ 750 ) ≤ 16875 / 7502

= 0.03.

(c) Answer this question using the Central Limit Theorem.

Just for fun, I ran an experiment to determine this value, and after 106 iterations, I got a probability of 0.0270, which is fairly close to the CLT value! Note that the Chebychev value is fairly close as well.

Solution:

Page 7: Name: · Web viewExpectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF: f(x) = 1/9 if x is an

Problem Five (Normal Distribution). Suppose the scores on an exam are normally distributed with mean 82 and variance 16. Use the table at the end of the exam to answer these questions.

(a) What is the probability that a student got a B (between 83 and 87)?

Solution: We have X ~ N(82, 16) and we standardize to get Z = (X - 82) / 4, and similarly we standardize the range for a B to between (83 - 82)/4 = 0.25 and (87 - 82)/4 = 1.25. So we have

P( 0.25 < Z < 1.25) = P( Z < 1.25 ) - P( Z < .25 ) # Now use the chart!

= 0.894 - 0.599 = 0.295.

(b) If a fellow student tells you his score was “two standard deviations” above the mean among 100 students, what was his rank in the exam (i.e., his position in a sorted list of students, from best to worst)? Give your answer and explain your reasoning.

Solution: Using the chart, we see that 2 standard deviations represents a probability of .977, which means this student is 98th (or perhaps 99th).

(c) Suppose another student tells you he was in the “90% percentile,” meaning, 90% of the students got lower scores. What was his score? Again, explain your reasoning.

Solution: This corresponds to a z-score of 1.3, which corresponds to a score of 1.3*4 + 82 = 87.2 on the exam.

Page 8: Name: · Web viewExpectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF: f(x) = 1/9 if x is an

Problem Six (Normal Approximation to the Binomial).

(a) Explain the theory behind the “continuity correction” when using the normal distribution to approximate the binomial distribution.

Solution: To approximate B(N,p), we can use N( N*p, N*p*(1-p) ) as an approximation:

(b) Under what conditions does the normal distribution provide a reasonable approximation to the binomial?

Solution: When N is sufficiently large and p is not too close to either 0 or 1, then the normal can be used to simulate the binomial, especially when the continuity correction is used. (FYI: One “rule of thumb” commonly expressed is that when N*p ≥ 5 and N*(1-p) ≥ 5, then the normal provides a good approximation to the binomial.)

(c) A fair coin is tossed 100 times. Using the normal approximation to the binomial, with the “continuity correction,” find the probability P that heads occur at most 48 times. [Hint: convert to z-score and use the table at the end of the exam--use the closest available z-score to obtain the best approximation.]

Solution: We have X ~ B( 100, 0.5 ) and want to find P( X ≤ 48). The exact value is 0.3822. The normal approximation with continuity correction uses X ~ N(50, 25) where we seek P( X < 48.5). But converting to Z ~ N(0,1) we find

P( Z < (48.5 - 50) / 5 ) = P( Z < -0.3 ) = 0.382.

Page 9: Name: · Web viewExpectation and Variance of Discrete Random Variables). Suppose a discrete random variable X is distributed according to the following PMF: f(x) = 1/9 if x is an

Table of Values for Standardized Normal Distribution

z = value on x-axis Phi(0,1,z) is probability that P(X <= z) in N(0,1)