Question 9.3.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

  1. \(\ge 100\)
y = 365
n <- y-1
mu <- 0
var <- 1/4
sdev <- sqrt(var)

x <- (100-100)/sqrt(n)

pnorm(x, mean = 0, sd = sdev, lower.tail = FALSE)
## [1] 0.5
  1. \(\ge 110\)
x <- (110-100)/sqrt(n)

pnorm(x, mean = 0, sd = sdev, lower.tail = FALSE)
## [1] 0.1472537
  1. \(\ge 120\)
x <- (120-100)/sqrt(n)

pnorm(x, mean = 0, sd = sdev, lower.tail = FALSE)
## [1] 0.01801584

Question 2.

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

Binomial Theorem:

\[\sum_{x=0}^{n} y^{x}z^{n-x} = (y + z)^n\] Moment generating function:

\[{M}_{X}({t}) = {E}(e^{tx})\]

\[{M}_{X}({t}) = \sum_{x=0}^{n} e^{tx}\binom{n}{x}p^{x}(1-p)^{n-x}\] \[{M}_{X}({t}) = \sum_{x=0}^{n} \binom{n}{x}(e^{t}p)^{x}(1-p)^{n-x}\] \[{M}_{X}({t}) = (e^{t}p +(1-p))^{n}\] Expected value (first):

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

\[{M}'{(t)} = {npe^t}[e^{t}p +(1-p)]^{(n-1)}\] Setting t = 0:

\[{E}{(X)} = {npe^0}[e^{0}p +(1-p)]^{n-1}\] \[{E}{(X)} = {np}(p +1-p)^{n-1}\] \[{E}{(X)} = {np}\] Expected value (second):

\[{E}{X^2} = M"(0)\] \[{M}"{(t)} = {np}[e^{t}(n-1) [e^{t}p +(1-p)]^{n-1}pe^t + [e^{t}p +(1-p)]^{n-1}e^t]\] Setting t = 0:

\[{E}{X^2} = {np}[e^{0}(n-1) [e^{0}p +(1-p)]^{n-1}pe^0 + [e^{0}p +(1-p)]^{n-1}e^0]\] \[{E}{X^2} = {np}[(n-1) (p + 1 - p)^{n-1}p + (p + 1 - p)^{n-1}]\] \[{E}{X^2} = {np}[(n-1)p + 1]\] \[{E}{X^2} = np^2(n-1) + np\] Variance:

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

Question 3.

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

Exponential Distribution: \[f(x) = \lambda e^{-\lambda x}\] Moment generating function: \[{M}_{X}({t}) = \int_{0}^{\infty}e^{tx} \lambda e^{-\lambda x}dx\] \[{M}_{X}({t}) = \int_{0}^{\infty}\lambda e^{(t-\lambda)x}dx\] \[{M}_{X}({t}) = \frac{\lambda}{t-\lambda}\] Expected value (first): \[{E}{(X)} = M'(0)\]

\[M'(t) = \frac{\lambda}{(t-\lambda)^2} \] Setting to 0: \[{E}{(X)} = \frac{\lambda}{(0-\lambda)^2} = \frac{\lambda}{(-\lambda)^2} = \frac{\lambda}{\lambda^2} = \frac{1}{\lambda}\] Expected value (second): \[{E}{X^2} = M"(0)\]

\[M"(t) = \frac{2\lambda}{(t-\lambda)^3} \] Setting to 0:

\[{E}{X^2} = \frac{2\lambda}{(0-\lambda)^3}= \frac{2\lambda}{(\lambda)^3}= \frac{2}{\lambda^2}\] Variance:

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

References: https://www.youtube.com/watch?v=XEm3lzquu5c https://www.youtube.com/watch?v=Qkz6ZTZrphg https://proofwiki.org/wiki/Expectation_of_Binomial_Distribution https://proofwiki.org/wiki/Variance_of_Binomial_Distribution