Problem 1

The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) is given by \(Y_n\) on the \(n\)th 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\)

mean <- 0  
var <- 1/4
sd <- sqrt(var)
n <- 364  
x <- 0/sqrt(n)
pnorm(x, mean, sd, lower.tail = FALSE)
## [1] 0.5

(b) \(\geq 110\)

x <- 10/sqrt(n)
pnorm(x, mean, sd, lower.tail = FALSE)
## [1] 0.1472537

(c) \(\geq 120\)

x <- 20/sqrt(n)
pnorm(x, mean, sd, lower.tail = FALSE)
## [1] 0.01801584

Problem 2

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

The binomial PMF is defined as \({n \choose x}p^xq^{n-x}\) so the moment generating function is:

\[ \begin{align} M(t) &= \sum_{x=0}^{n} e^{tx} {n \choose x}p^xq^{n-x} \\ &= \sum_{x=0}^{n} {n \choose x}(pe^t)^xq^{n-x} \\ & = (pe^t + q)^n \end{align} \]

To calculate the expected value using the moment generating function we take the first derivative of the MGF and then substitute 0 for t.

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

To calculate the variance using the moment generating function we take the second derivative of the MGF and then substitute 0 for t to find the second moment. Then we take the second moment minus the first moment squared to find the variance.

\[ M''(t) = n[1−p+pe^t]^{n−1}(pe^t)+(pe^t)n(n−1)[1−p+pe^t]^{n−2}(pe^t) \\ E(X^2) = M''(0) = n(n-1)p^2 + np \\ \begin{align} \\ Var(X) &= E(X^2) - E(X)^2 \\ &= n(n-1)p^2 + np - (np)^2 \\ &= (n^2p^2-1np^2) + np - (np)^2 \\ &= (np)^2-np^2 + np - (np)^2 \\ &= np - np^2 \\ &= np(1-p) \end{align} \]

source for second derivative

Problem 3

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

The exponential PDF is defined as \(\lambda e^{−x \lambda}\) so the moment generating function is:

\[ \begin{align} M(t) &= \int_0^{\infty} e^{tx} \lambda e^{−x \lambda} dx \\ &= \lambda \int_0^{\infty} e^{-x(\lambda -t)} \\ &= -\lambda \frac{e^{-x(\lambda -t)}}{\lambda - t} \bigg\rvert _0^\infty \\ & = \frac{\lambda}{\lambda - t} \end{align} \]

To calculate the expected value using the moment generating function we take the first derivative of the MGF and then substitute 0 for t.

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

To calculate the variance using the moment generating function we take the second derivative of the MGF and then substitute 0 for t to find the second moment. Then we take the second moment minus the first moment squared to find the variance.

\[ M''(t) = \frac{2\lambda}{(\lambda - t)^3} \\ E(X^2) = M''(0) = \frac{2\lambda}{\lambda^3} = \frac{2}{\lambda^2} \\ \begin{align} \\ Var(X) &= E(X^2) - E(X)^2 \\ &= \frac{2}{\lambda^2} - \frac{1}{\lambda^2} \\ &= \frac{1}{\lambda^2} \end{align} \]