page 363
11.The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) is given by \(Y_n\) on the nth day of the year. Finn observes that the differences \(X_n = Y_{n+1} - Y_n\) appear to be independent random variables with a common distribution having mean \(\mu = 0\) and variance \(\sigma^2 = 1/4\). If \(Y_1 = 100\), estimate the probability that \(Y_{365}\) is
\((a) \geq 100.\)
\((b) \geq 110.\)
\((c) \geq 120.\)
solution:
\((a) \geq 100.\)
\(Y_{365} - Y_1 = X_1 + X_2+...+X_{364}\)
\(E[X]=0\)
\(\mu = 0\)
transform to standardized form \(P(Y_{365} - Y_1 \geq 0)=P(\frac{Y_{365} - Y_1}{\sqrt{364}} \geq \frac{0}{\sqrt{364}})\)
a <- 0/sqrt(364)
sigma <- sqrt(1/4)
p <- 1 - pnorm(q = a, mean = 0, sd = sigma, lower.tail = TRUE)
cat("the probability that stock price after day 365 is greater than 100 is",p)
## the probability that stock price after day 365 is greater than 100 is 0.5
\((b) \geq 110.\)
transform to standardized form \(P(Y_{365} - Y_1 \geq 10)=P(\frac{Y_{365} - Y_1}{\sqrt{364}} \geq \frac{10}{\sqrt{364}})\)
a <- 10/sqrt(364)
sigma <- sqrt(1/4)
p <- 1 - pnorm(q = a, mean = 0, sd = sigma, lower.tail = TRUE)
cat("the probability that stock price after day 365 is greater than 110 is",p)
## the probability that stock price after day 365 is greater than 110 is 0.1472537
a <- 20/sqrt(364)
sigma <- sqrt(1/4)
p <- 1 - pnorm(q = a, mean = 0, sd = sigma, lower.tail = TRUE)
cat("the probability that stock price after day 365 is greater than 120 is",p)
## the probability that stock price after day 365 is greater than 120 is 0.01801584
2.Calculate the expected value and variance of the binomial distribution using the moment generating function.
For binomial distribution:
\[\begin{equation} \begin{split} M_X(t) &= E(e^{tx})\\ &= \sum_{x=0}^{n} e^{tx}\binom{n}{k}p^x(1-p)^{n-x}\\ &= \sum_{x=0}^{n} \binom{n}{k} (e^tp)^x(1-p)^{n-x}\\ &=(e^tp+(1-p))^n \end{split} \end{equation}\]So expected value:
\[\begin{equation} \begin{split} M'(t) &= n[pe^t+(1-p)]^{n-1}pe^t \end{split} \end{equation}\] \[\begin{equation} \begin{split} E(X) &= M'(0)\\ &= np \end{split} \end{equation}\]Variance:
\[\begin{equation} M''(t)= np[e^t(n-1)[pe^t+(1-p)]^{n-2}pe^t+[pe^t+(1-p)]^{n-1}e^t] \end{equation}\] \[\begin{equation} \begin{split} E(X^2) &= M''(0)\\ &= np[1\cdot(n-1)\cdot 1^{n-2}p\cdot 1+[p\cdot 1+(1-p)]^{n-1}\cdot 1]\\ &= n(n-1)p^2+np \end{split} \end{equation}\] \[\begin{equation} \begin{split} Var(X) &= E(X^2)-E(x)^2\\ &= n(n-1)p^2+np-n^2p^2 \\ &= npq \end{split} \end{equation}\]3.Calculate the expected value and variance of the exponential distribution using the moment generating function.
\[\begin{equation} \begin{split} M(t) &=E(e^{tx})\\ &= \int_0^\infty \mathrm{e}^{-tx}\lambda {e}^{-\lambda x}\,\mathrm{d}x \\ &= \int_0^\infty \mathrm \lambda{e}^{-(\lambda-t)x}\,\mathrm{d}x \\ &= \frac {\lambda}{\lambda-t} & \quad \text{for } t< \lambda \end{split} \end{equation}\] For expected value: \[\begin{equation} M'(t)= -\lambda (\lambda-t)^-2(-1) = \lambda (\lambda-t)^-2 \end{equation}\] \[\begin{equation} E(X)= M'(0)=\lambda (\lambda)^-2 = \lambda^{-1} \end{equation}\] For variance: \[\begin{equation} M''(t)= -\lambda (-2)(\lambda-t)^-3(-1) =2 \lambda (\lambda-t)^-3 \end{equation}\] \[\begin{equation} E(X^2)= M''(0)=2\lambda (\lambda)^-3 = 2\lambda^{-2} \end{equation}\] \[\begin{equation} Var(X) = E(X^2)-E(x)^2 = 2\lambda^{-2} -\lambda^{-2}=\lambda^{-2} \end{equation}\]