Question 1

The price of one share of stock in the Pilsdorff Beer Company 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. \(\geq\) 100

  2. \(\geq\) 110

  3. \(\geq\) 120

(a)

\(Y_1\) = 100, so . . .

P( \(Y_{365} \geq 100\) ) = P( \(\frac {Y_{365}} {\sqrt{365 * 1 / 4}}\) \(\geq\) \(\frac {100 - 100} {\sqrt{365 * 1 / 4}}\) )

P ( \(\frac {Y_{365}} {\sqrt{365 * 1 / 4}}\) \(\geq\) 0)

P (Z \(\geq\) 0) = 0.5

pnorm(100, 100, 0.5)
## [1] 0.5

(b)

\(Y_1\) = 100, so . . .

P( \(Y_{365} \geq 110\) ) = P( \(\frac {Y_{365}} {\sqrt{365 * 1 / 4}}\) \(\geq\) \(\frac {110 - 100} {\sqrt{365 * 1 / 4}}\) )

P ( \(\frac {Y_{365}} {\sqrt{365 * 1 / 4}}\) \(\geq\) \(\frac {10}{\sqrt{91}}\) )

P (Z \(\geq\) \(\frac {10}{\sqrt{91}}\)) = 0.147

1 - pnorm(10 / sqrt(91))
## [1] 0.1472537

(c)

\(Y_1\) = 100, so . . .

P( \(Y_{365} \geq 120\) ) = P( \(\frac {Y_{365}} {\sqrt{365 * 1 / 4}}\) \(\geq\) \(\frac {120 - 100} {\sqrt{365 * 1 / 4}}\) )

P ( \(\frac {Y_{365}} {\sqrt{365 * 1 / 4}}\) \(\geq\) \(\frac {20}{\sqrt{91}}\) )

P (Z \(\geq\) \(\frac {20}{\sqrt{91}}\)) = 0.018

1 - pnorm(20 / sqrt(91))
## [1] 0.01801584

Question 2

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

Binomial distribution equation: \({n} \choose {k}\) \(p^k\) \((1 - p)^{n - k}\)

\(M_x(t)\) = E[ \(e^{tx}\) ] = \(\sum_{x}e^{tx}P_x(x)\)

= \(\sum_{x = 0}^{n} {e^t} {n \choose x} * p^x * (1 - p)^{n - x}\)

= \(\sum_{x = 0}^{n} {n \choose x} * (pe^t)^x * (1 - p)^{n - x}\)

= \(\sum_{x = 0}^{n} {n \choose x} * (pe^t)^x * (1 - p)^{n} * (1 - p)^{-x}\)

= \((1 - p)^n\) \(\sum_{x = 0}^{n} {n \choose x} * (pe^t)^x * (1 - p)^{-x}\)

= \((1 - p)^n\) \(\sum_{x = 0}^{n} {n \choose x} * (\frac{pe^t}{1-p})^x\)

= \((1 - p)^n (1 + \frac{pe^t}{1-p} )^n\)

= \((1 - p + pe^t)^{n}\)

Expected value: E(X) = first derivative of binomial distribution

library(Deriv)
## Warning: package 'Deriv' was built under R version 4.3.3
first <- Deriv(function(x, p, n) (1 - p + p * exp(x))^n, "x")

first
## function (x, p, n) 
## {
##     .e1 <- exp(x)
##     n * p * (1 + p * (.e1 - 1))^(n - 1) * .e1
## }

E(X) = \(M'_x(x)\) = \(n * p * e^x * (1 + p * (e^x - 1))^{n - 1}\)

E(X) = \(M'_x(x)\) = \(n * p * e^x * (1 + pe^x - p)^{n - 1}\)

\(M'_x(0)\) = \(n * p * e^0 * (1 + pe^0 - p)^{n -1}\)

= \(n * p * (1 + p - p)^{n - 1}\)

= \(n * p * (1)^{n - 1}\)

= \(n * p\)

E(X) = np

Variance: Var(X) = \(E(X^2) - E(X)^2\)

First, we need to find \(E(X^2)\) and \(E(X)^2\).

second <- Deriv(first, "x")

second
## function (x, p, n) 
## {
##     .e1 <- exp(x)
##     .e2 <- 1 + p * (.e1 - 1)
##     .e3 <- n - 1
##     n * p * (.e2^.e3 + p * .e2^(n - 2) * .e1 * .e3) * .e1
## }

\(E(X^2)\) = \(M''_x(x)\)

= \(n * p * ( (1 + p * (e^x - 1) )^{n - 1} + p * (1 + p * (e^x - 1))^{n - 2} * e^x * (n - 1)) * e^x\)

= \(n * p * e^x * ( (1 + pe^x - p)^{n - 1} + p * (1 + pe^x - p)^{n - 2} * e^x * (n - 1))\)

\(M''_x(0)\) = \(n * p * e^0 * ((1 + pe^0 - p)^{n - 1} + p * (1 + pe^0 - p)^{n - 2} * e^0 * (n - 1))\)

= \(n * p * ((1 + p - p)^{n - 1} + p * (1 + p - p)^{n - 2} * (n - 1))\)

= \(n * p * (1 + p * (n - 1))\)

= \(n * p * (1 + n * p - p)\)

= \(np + (np)^2 - npp\)

= \(np * (1 + np - p)\)

\(E(X)^2\) = \((np)^2\)

Variance: Var(X) = \(E(X^2) - E(X)^2\)

Var(X) = \(np * (1 + np - p) - (np)^2\)

= \(np + (np)^2 - np^2 - (np)^2\)

= \(np - np^2\)

= \(np * (1 - p)\)

Var(X) = np * (1 - p)

Question 3

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

Exponential distribution equation: \(\lambda e^{-\lambda x}\)

\(M_x(t)\) = E[ \(e^{tx}\) ] = \(\int_{0}^{\infty} {e^{tx}}P_x(x)\)

= \(\int_{0}^{\infty}{e^t} \lambda e^{-\lambda x} dx\)

= \(\frac {\lambda} {t - \lambda} [e^{(t - \lambda) x}]_0 ^\infty\)

= \(\frac {\lambda} {t - \lambda} [e^{(t - \lambda) x}]_0 ^\infty\)

= \(\frac {\lambda} {t - \lambda} [^\lim_{x \to \infty} \ \ e^{(t - \lambda) x} - e^{(t - \lambda)0}]\)

= \(\frac {\lambda} {t - \lambda} [0 - 1]\) = \(\frac {\lambda} {t - \lambda}\) for \(\ t \lt \lambda\)$

E(X) = \(\int_{-\infty}^{\infty} x * f_x(x)dx\)

E(X) = \(M'_x(0)\)

\(M_x(t)\) = \(\lambda(\lambda - t)^{-1}\)

\(M_x'(t)\) = \(-1 \lambda ( \lambda - t ) ^{-2} (-1)\)

= \(\frac {\lambda} {(\lambda - t)^2}\)

E(X) = \(M_x'(0)\) = \(\frac {\lambda} {(\lambda - 0)^2}\) = \(\frac {\lambda} {\lambda^2}\) = \(\frac {1} {\lambda}\)

E(X) = \(\frac {1} {\lambda}\)

Variance: Var(X) = \(E(X^2) - E(X)^2\)

First, we need to find \(E(X^2)\) and \(E(X)^2\).

\(E(X^2)\) = \(M''_x(t)\) = \(- \lambda ( \lambda - t)^3 (-2)\)

= \(\frac {2 \lambda}{(\lambda - t)^3}\)

\(M_x''(0)\) = \(\frac {2 \lambda}{(\lambda - 0)^3}\) = \(\frac {2 \lambda}{(\lambda)^3}\) = \(\frac {2}{(\lambda)^2}\)

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

Var(X) = \(E(X^2) - E(X)^2\) = \(\frac {2}{(\lambda)^2}\) - \((\frac {1} {\lambda})^2\) = \((\frac {1} {\lambda^2})\)

Var(X) = \(\frac {1} {\lambda^2}\)