Page 363 #11
The price of one share of stock in the Pilsdorff Beer Company (see Exer- cise 8.2.12) is given by Yn on the nth day of the year. Finn observes that the differences Xn = Yn+1 − Yn appear to be independent random variables with a common distribution having mean μ = 0 and variance σ2 = 1/4. If Y1 = 100, estimate the probability that Y365 is
\(\geq 100\)
\(\geq 110\)
\(\geq 120\)
We have \(X_n= Y_{n+1} - Y_n\), \(\mu=0,\sigma ^2=\frac{1}{4}\)
We need to calculate: \(\frac{S_n-n\mu}{\sqrt{n}*\sigma}\)
Where, \(S_n=Y_{365}-Y_n, \sigma=\frac{1}{2}, n=100\)
So we get \(\frac{100-100-364*0}{\sqrt{364}*\frac{1}{2}}= 0\)
Then we just need to plug 0 into the standard normal distribution table:
Plugging in we get the Probability \(\geq 100 = .5\)
print(pnorm(0,0,sqrt(365)*1/2,lower.tail=FALSE))
## [1] 0.5
We can use the same formula to solve this part we just need to substitute \(Y_{n+1}=110\)
We get: \(\frac{110-100-365*0}{\sqrt{365}*\frac{1}{2}}= \frac{10}{\sqrt{365}*\frac{1}{2}}=-\frac{10}{\sqrt{91}}=-1.048285\)
Then plugging into the standard normal distribution we get
The probability \(\geq 110 = .01469\)
print(sqrt(91))
## [1] 9.539392
y_110 = (10)/(sqrt(91))
print(y_110)
## [1] 1.048285
print(pnorm(10,0,sqrt(365)*1/2,lower.tail=FALSE))
## [1] 0.1475849
Then for this part we have: \(Y_{n+1} = 120\)
We get: \(\frac{120-100-365*0}{\sqrt{365}*\frac{1}{2}}= \frac{20}{\sqrt{365}*\frac{1}{2}}=-\frac{20}{\sqrt{91}}=-2.09657\)
Using the standard normal table we get:
The probability \(\geq 120 = 0.0183\)
print(-(20)/(sqrt(91)))
## [1] -2.09657
print(pnorm(20,0,sqrt(365)*1/2,lower.tail=FALSE))
## [1] 0.01814355
Calculate the expected value and variance of the binomial distribution using the moment generating function.
The binomial distribution moment generating function is given by \(M_x(t)=(1-p+pe^t)^n\)
To find the expected value we need to find \(E[X]=M'_x(0)\)
So first we need to find \(M'_x(0)=n(p-1+e^tp)^{n-1}|_{t=0}=n(p-1+p)^{n-1}=np\)
Therefore, \(E[X] = np\)
The variance is equal to \(Var[X]=M''_x(0)-(M'_x(0))^2\)
\(M_x(t)=(1-p+pe^t)^n\)
Then to find \(M'_x(t)\) we can use the chain rule \(u=1-p+pe^t,\frac{du}{dt}=pe^t\)
\(M'_x(t)= n(1-p+pe^t)^{n-1}*\frac{du}{dt}\)
\(M'_x(t)=npe^t(1-p-pe^t)^{n-1}\)
Then to find \(M''_x(t)\) we need to use the product rule
\(M''_x(t)=np \frac{d}{dt}[(1-p+pe^t)^{n-1}] + npe^t\frac{d}{dt}[(1-p+pe^t)^{n-1}]\)
\(M''_x(t)=np(n-1)*(1-p+pe^t)^{n-2}*pe^t+npe^t(n-1)*(1-p+pe^t)^{n-2}*pe^t\)
\(M''_x(t)= np(n-1)pe^t(1-p+pe^t)^{n-2}+n^2p^2e^{2t}(1-p+pe^t)^{n-2}\)
Then we just need to evaluate it at 0
\(M''_x(0)=np\)
\(Var[X] = np - (np)^2=np(1-p)\)
Calculate the expected value and variance of the exponential distribution using the moment generating function.
The pdf of the exponential distribution is given by \(f(x)=\lambda e^{-\lambda x}\)
Then the Moment generating function is :
\(M_x(t)=E[e^{tX}]=\int_{0}^{\infty} e^{tX}*\lambda e^{-\lambda x} dx\)
\(M_x(t) = \lambda \int_{0}^{\infty} e^{-(\lambda -t)x} dx\)
\(M_x(t) = \lambda \frac{-1}{\lambda - t} e^{-(\lambda - t)x} |^{\infty}_0 \frac{\lambda}{\lambda - t}\)
\(M_x(t)=\frac{\lambda}{\lambda - t}\)
Now that we have the moment generating function we can find the expected value and variance
\(E[X]=M'_x(0)\)
\(M'_x(t)=\frac{d}{dt}(\frac{\lambda}{\lambda - t})=\frac{\lambda}{(\lambda-t)^2}\)
\(M'_x(0)=\frac{\lambda}{\lambda^2}=\frac{1}{\lambda}\)
\(E[X]=\frac{1}{\lambda}\)
Then the variance is equal to
\(Var[X]=M''_x(0)-(M'_x(0))^2\)
So we need to find \(M''_x(t)\)
\(M''_x(t)=\frac{\lambda}{(\lambda-t)^2} \frac{d}{dt}=\frac{2\lambda}{(\lambda-t)^3}\)
\(M''_x(0)=\frac{2}{\lambda^2}\)
\(Var[X] = \frac{2}{\lambda^2}-(\frac{1}{\lambda})^2\)
\(Var[X]=\frac{1}{\lambda^2}\)