Exercise 11 Part 1

  1. The price of one share of stock in the Pilsdorff Beer Company 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 = \frac{1}{4}\). If \(Y_1 = 100\), estimate the probability that \(Y_{365}\) is:
  1. \(\geq 100\).

  2. \(\geq 110\).

  3. \(\geq 120\).

Answers to Part 1:

  1. \(P(Y_{365} \geq 100) = P(S_{364} + 100 \geq 100) = P(S_{364} \geq 0)\).
# Define the mean, variance, and standard_deviation variables that will be used in all 3 calculations.
mean <- 0
variance <- 365 * 0.25
standard_deviation <- sqrt(variance)

answer_a <- pnorm(100 - 100, mean, standard_deviation, lower.tail = FALSE)
paste('The probability that Y365 ≥ 100 is', answer_a)
## [1] "The probability that Y365 ≥ 100 is 0.5"

Answer: 0.5

  1. \(P(Y_{365} \geq 110) = P(S_{364} + 100 \geq 110) = P(S_{364} \geq 10)\).
answer_b <- pnorm(110 - 100, mean, standard_deviation, lower.tail = FALSE)
paste('The probability that Y365 ≥ 110 is', answer_b)
## [1] "The probability that Y365 ≥ 110 is 0.147584879761555"

Answer: 0.147584879761555

  1. \(P(Y_{365} \geq 120) = P(S_{364} + 100 \geq 120) = P(S_{364} \geq 20)\).
answer_c <- pnorm(120 - 100, mean, standard_deviation, lower.tail = FALSE)
paste('The probability that Y365 ≥ 120 is', answer_c)
## [1] "The probability that Y365 ≥ 120 is 0.0181435485458444"

Answer: 0.0181435485458444

Exercise 11 Part 2

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

Answer to question 2:

Binomial function: \(b(x, n, p) = \frac{n!}{x!(n-x)!}p^xq^{n-x}\) with \(q=1-p\).

Moment Generating function: \[Mx(t)=\sum_{x=0}^{n} e^{xt} \frac{n!}{x!(n-x)!}p^xq^{n-x} = \sum_{x=0}^{n} (pe^t)^x \frac{n!}{x!(n-x)!}q^{n-x} = (q+pe^t)^n\]

Derivative function: \(\frac{dM(t)}{dt} = pe^t n(q+pe^t)^{n-1}\)

Variance:

Evaluate \(t = 0\):

\(E(x) = np(q+p)^{n-1} = np\)

\(E(x^2) = np(q + p)^{n−2}(q + np) = np(q + np) \therefore V = E(x^2) - (E(x))^2 = np(q + np) - (np)^2 = np(q+np) - n^2p^2 = npq\)

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

Answer to question 3:

Moment Generating function:

\[Mx(t) = \int_{-\infty}^\infty e^{tx}fx(x)dx = \int_0^\infty e^{tx}\lambda e^{-\lambda x}dx = \lambda \int_0^\infty e^{(t - \lambda)x}dx = \frac{\lambda}{t- \lambda}\]

Find the 1st and 2nd moments: \(E(x) = \frac{\lambda}{(t- \lambda)^2}|_{t=0} = \frac{1}{\lambda}\)

Variance: \(V = E(x^2) = \frac{2\lambda}{(t- \lambda)^3}|_{t=0} = \frac{2}{\lambda^2}\)