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 μ = 0 and variance \(\sigma^2\) = 1/4. If \(Y_1\) = 100, estimate the probability that \(Y_{365}\) is

(a) \(\ge100\). \[ \frac {100-100}{\sqrt{.25*(365-1)}} \]

Mean, Standard Deviation and n are the same for all three parts.

#mean is given as 0, variance is given as 1/4
mu <- 0
var <- 0.25
#standard deviation is the sqrt of variance
sd <- sqrt (var)
n <- 365-1
part_a <- (100-100)/sqrt(n)
#use pnorm function to solve
pnorm (part_a, mu, sd, lower.tail= FALSE)
## [1] 0.5

(b) \(\ge110\).

\[ \frac {110-100}{\sqrt{.25*(365-1)}} \]

part_b <- (110-100)/sqrt(n)
#use pnorm function to solve
pnorm (part_b, mu, sd, lower.tail= FALSE)
## [1] 0.1472537

(c) \(\ge120\). \[ \frac {120-100}{\sqrt{.25*(365-1)}} \]

part_c <- (120-100)/sqrt(n)
#use pnorm function to solve
pnorm (part_c, mu, sd, lower.tail= FALSE)
## [1] 0.01801584

Moment Generating Function: Binomial

Calculate the expected value and variance of the binomial distribution using the moment generating function.

In order to calculate the expected value, we substitute zero into the first derivative of the moment generating function.

In order to caclulate the variance, we substitute zero into the second derivative of the moment generating function and then subtract the expected value squared.

\[ \binom{n}{k}=\frac{n!} {(n-k)!k!} \]

\[ Probability|Mass|Function = \binom{n}{k} *p^k * (1-p)^{n-k} \]

Moment Generating Function

\[M(t) =\sum_{x = 0}^{n} e^{tx} \binom{n}{x} p^x (1-p)^{n-x}\]

\[M(t) =\sum_{x = 0}^{n} \binom{n}{x} (pe^t)^x (q)^{n-x}\] \[ = (pe^t + q)^n \]

Expected Value

\[ M'(t) = n(pe^t+q)^{n-1}pe^t \] We now substitute zero into the above first derivative

\[ E(X) = M'(0) = n(pe^0+q)^{n-1}pe^0 \] \[ E(X) = np \]

Variance

\[ M''(0) = n(n-1)p^2+np \] We now subtract the square of the expected value that we calculated above

\[ V(X) = M''(0) - (E(X))^2\] \[ V(X) = n(n-1)p^2+np - (np)^2\]

\[ V(X) = np^2(n-1)+np - (np)^2\] \[ V(X) = n^2p^2-np^2+np - n^2p^2\] \[ V(X) = np-np^2 \] \[ V(X) = np(1-p) \]

Moment Generating Function: Exponential

Calculate the expected value and variance of the exponential distribution using the moment generating function.

Since PDF is \(\lambda e^{−λx}\) :

Moment Generating Function

\[\left[M(t) = \int_{0}^{\infty} e^{tx}\lambda e^{−λx} dx\right]\] \[\left[= \lambda \int_{0}^{\infty} e^{(t-\lambda)x} dx\right]\] \[=\left. \lambda \frac{e^{(t-\lambda)x}}{t-\lambda} \right|_{0}^{\infty}\] \[ = \frac {\lambda}{(\lambda-t)} \]

Expected Value

\[ M'(t) = \frac {\lambda}{(\lambda-t)^2} \]

We now substitute zero into the above first derivative

\[ E(X) = M'(0) = \frac {\lambda}{(\lambda-0)^2} \]

\[ E(X) = \frac{\lambda}{\lambda^2} = \frac{1}{\lambda} \]

Variance

\[ M''(t) = \frac {2\lambda}{(\lambda-t)^3} \] \[ M''(0) = \frac {2\lambda}{(\lambda-0)^3} \] \[ M''(0) = \frac {2}{\lambda^2} \] We now subtract the square of the expected value that we calculated above

\[ V(X) = M''(0) - (E(X))^2\]

\[ V(X) = \frac {2}{\lambda^2} - (\frac{1}{\lambda})^2\] \[ V(X) = \frac{1}{\lambda^2}\]