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 = \frac{1}{4}\). If \(Y_1 = 100\), estimate the probability that \(Y_{365}\) is
SOLUTION:
We know that:
A regular year has 365 days.
\(\mu = 0\)
\(\sigma^2 = \frac{1}{4}\)
\(\sigma = \sqrt{\frac{1}{4}} = \frac{1}{2}\)
\(Y_n = Y_1 + \sum_{i=1}^{365-1} x_i\)
\(E(X) = \frac{\sum_{i=1}^{365-1} x_i}{365-1} = 0\)
Let \(z = \frac{\sum_{i=1}^{365-1} X_i - n E(x)}{\delta \sqrt{n-1}} = \frac{Y_n-Y_1-n\mu}{\delta \sqrt{365-1}}\)
v <- (365-1) * (1/4)
x <- pnorm((100-100), mean = 0, sd = sqrt(v), lower.tail = FALSE)
x
#> [1] 0.5v <- (365-1) * (1/4)
x <- pnorm((110-100), mean = 0, sd = sqrt(v), lower.tail = FALSE)
x
#> [1] 0.1472537v <- (365-1) * (1/4)
x <-pnorm((120-100), mean = 0, sd = sqrt(v), lower.tail = FALSE)
x
#> [1] 0.01801584Calculate the expected value and variance of the binomial distribution using the moment generating function.
SOLUTION:
The moment generating function \(g(t)\) can be defined as:
\[\begin{align} g(t) & = \sum_{j=0}^{n} e^{tj} \binom{n}{j} p^j q^{n-j}\\ & = \sum_{j=0}^{n} \binom{n}{j} (pe^t) q^{n-j}\\ & = (pe^t + q)^ n \end{align}\]
Assuming \(t = 0\) the expected value \(\mu_1\) can be calculated as:
\[\begin{align} \mu_1 & = g'(0)\\ & = n(pe^t + q)^{n-1} pe^t\\ & = np \end{align}\]
The variance \(\mu_2\) can be calculated as:
\[\begin{align} \mu_2 & = g''(0)\\ & = n(n - 1)p^2 + np\\ & = np \delta^2\\ & = \mu_2 - \mu_1^2\\ & = np(1-p) \end{align}\]
Calculate the expected value and variance of the exponential distribution using the moment generating function.
SOLUTION:
The moment generating function \(g(t)\) can be defined as:
\[\begin{align} g(t) & = \int_{0}^{\infty} e^{tx} \lambda e^{-\lambda e} \,dx\\ & = \frac{\lambda e^{(t-\lambda)x}}{t-\lambda} |{0}^{\infty}\\ & = \frac{\lambda e^{(t-\lambda)\infty}}{t-\lambda} - \frac{\lambda e^{(t-\lambda)0}}{t-\lambda}\\ & = \frac{\lambda}{\lambda-t} \end{align}\]
The expected value \(\mu_1\) can be calculated as:
\[\begin{align} E(X) & = M'_x(0)\\ & = \frac{\lambda}{(\lambda-t)^2}\\ & = \frac{1}{\lambda} \end{align}\]
The variance \(E(X^2)\) can be calculated as:
\[\begin{align} E(X^2) & = (M_x)^{2}(0)\\ & = \frac{2 \lambda}{(\lambda - t)^3}\\ & = \frac{2}{\lambda^2} \delta^2\\ & = E(X^2) - E(X)\\ & = \frac{2}{\lambda^2} - \frac{1}{\lambda^2}\\ & = \frac{1}{\lambda^2} \end{align}\]