Solution to Homework #9

Problem 1 The number of chocolate chips in a certain type of cookie has a Poisson distribution. Find the smallest mean of the distribution for which the probability that a cookie has at least 2 chocolate chips is at least 99%.

We have X~Pois(l), so E[X]=l, and we want P(X≥2)≥0.99. Find the smallest l for which this is true
Now
0.99=P(X≥2)=1-P(X≤1)=1-(P(X=0)+P(X=1))=1-e-l-le-l
or
(1+l)e-l=0.01
let h(x)=(1+x)e-x, then h(0)=1, limx→∞h(x)=0, h'(x)=-xe-x<0 if x>0, so h is strictly decreasing, and so there is a unique solution to the equation h(x)=0.01.
Unfortunately, the non-linear equation (1+l)e-l=0.01 can not be solved analytically
Two ideas
a) use "trial and error" in R, that is calculate (1+l)e-l for values of l until you get close to 0.01
b) use a numerical method, for example Newton's method: to solve the equation f(x)=0, pick a starting point x0 and calculate xn+1=xn-f(xn)/f'(xn). Obviously if this converges to some x we have x=x-f(x)/f'(x), or f(x)=0
this is done in hw9sol
Answer: =6.64

Problem 2 a) Say X~U[0,1], and a>0. Show that Y=X|X<a~U[0,a]

First, as stated the problem is wrong: if a>1 we have
FY(y) = P(X<x|X<a) = P(X<x), so X|X<a ~U[0,1], not U[0,a]

Now if we assume 0<a<1 we have

and so Y~U[0,a]
b) Say X is a continuous rv with density f. Find the density of Y=X|X<a

and so fY(y) = d/dy{FY(y)} = fX(y)/FX(a) if 0<y<a, 0 otherwise

Problem 3 Say X~N(m,s). Find a m and a s such that P(|X|<2)=1/2.
Let's try m=0, then
P(|X|<2) = P(|(X-m)/s|<2/s) = P(|Z|<2/s) = 2F(2/s)-1 = 1/2
where Z~N(0,1) and F=FZ
so
F(2/s) = (1/2+1)/2 = 3/4
2/s = qnorm(3/4)
s = 2/qnorm(3/4) = 2.965204
so (m,s)=(0,2.965204)

Problem 4 a) Say X is a rv with P(X=-1)=1/18, P(X=0)=16/18 and P(X=1)=1/18. Show that here for k=3 Chebyshev's Inequality is attained, that is P(|X-m|≥3s)=1/9
We have
m = E[X] = (-1)·1/18+0·16/18+1·1/18 = 0
E[X2] = (-1)2·1/18+02·16/18+12·1/18 = 2/18 = 1/9
so s2=1/9 and s=1/3
now
P(|X-m|≥3s) = P(|X|≥1) = P(X=-1 or X=1) = 2/18 = 1/9 = 1/32


b) Find a rv. X for which P(|X-m|≥2s)=1/4

Let X be such that P(X=-1)=P(X=1)=p, P(X=0)=1-2p for some p, then
m = E[X] = (-1)·p+0·(1-2p)+1·p = 0
E[X2] = (-1)2·p+02·(1-2p)+12·p = 2p
s2=2p and s=√(2p)
now
P(|X-m|≥2s) = P(|X|≥2√(2p))
= P(X=±1) (if 0<2√(2p)≤1)
= 2p = 1/4
so p=1/8
Check: 2√(2p) = 2√(1/4) = 1