Exercise 11

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 = \frac{1}{4}\). If \(Y_1\) = 100, estimate the probability that \(Y_{365}\) is

Number of trials (n) = \(365 - 1 = 364\)

V(X) = \(n \times \sigma ^2 = \frac{364}{4} = 91\)

A

\(\geq 100\)

\(P(Y_{365} \geq 100) =\)

\(\mu = 0\)

\(\bar x = Y_{365} - Y_1\)

\(z = \frac{\bar x - \mu}{\sqrt{Var(x)}} = \frac{0 - 0}{9.54} = 0\)

p <- pnorm(0, lower.tail = F)
print(paste0("Probabilty is ", round(p*100,2), "%"))
## [1] "Probabilty is 50%"

B

\(\geq 110\)

\(P(Y_{365} \geq 110) =\)

\(\mu = 0\)

\(\bar x = Y_{365} - Y_1\)

\(z = \frac{\bar x - \mu}{\sqrt{Var(x)}} = \frac{10 - 0}{9.54} = 1.048\)

p <- pnorm(10/sqrt(91), lower.tail = F)
print(paste0("Probabilty is ", round(p*100,2), "%"))
## [1] "Probabilty is 14.73%"

C

\(\geq 120\)

\(P(Y_{365} \geq 110) =\)

\(\mu = 0\)

\(\bar x = Y_{365} - Y_1\)

\(z = \frac{\bar x - \mu}{\sqrt{Var(x)}} = \frac{20 - 0}{9.54} = 2.10\)

p <- pnorm(20/sqrt(91), lower.tail = F)
print(paste0("Probabilty is ", round(p*100,2), "%"))
## [1] "Probabilty is 1.8%"

Problem 2

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

MGF for \(x \rightarrow\) \(M(t) = E(e^{tx}) = \sum^\infty_{x=0} e^{tx}f(x)\)

Binomial Distribution function:

\[f(x) = \left( \begin{array}{c} n \\ x \end{array} \right) p^x(1-p)^{n-x}\]

Binomial Expansion Theorem (Thereom 3.7 page 103):

\[(a + b)^n = \sum^n_{x=0} \left( \begin{array}{c} n \\ x \end{array} \right) a^xb^{n-x} \]

Substitute \(f(x)\) into the MGF:

\[M(t) = \sum^\infty_{x=0} e^{tx}\left( \begin{array}{c} n \\ x \end{array} \right) p^x(1-p)^{n-x}\]

Simplify

I had to look up the rules of exponents to figure out that \(e^{tx}p^x\) = \((pe^t)^x\).

\[ M(t) = \sum^\infty_{x=0} \left( \begin{array}{c} n \\ x \end{array} \right) (pe^t)^x(1-p)^{n-x} \] Substitute the Binomial Expansion function

\[(a + b)^n = \sum^n_{x=0} \left( \begin{array}{c} n \\ x \end{array} \right) a^xb^{n-x} \]

\(a^x = (pe^t)^x\)

\(a = pe^t\)

\(b^{n-x} = (1-p)^{n-x}\)

\(b = (1-p)\)

Therefore, The MGF is:

\((a + b)^n = [(pe^t) + (1-p)]^n\)

Find the E(x) by solving the first derivative of the MGF at \(t=0\) in respect to \(t\)

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

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

= \(n[1]^{n-1}p\)

= \(np\)

Find the second derivative

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

Factor out the constants

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

= \(np(n-1)[1-p+pe^t]^{n-2}pe^te^t\)

t = 0

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

= \(M'(t) + np^2(n-1) = np + np^2(n-1)\)

Find the Variance = \(E(X^2) - [E(X)]^2 = M''(0) - (M'(0))^2\)

\(np + np^2(n-1) - (np)^2 = np + n^2p^2 - np^2 - n^2p^2\)

= \(np - np^2\)

= \(np(1-p)\)

Problem 3

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

MGF for \(x \rightarrow\) \(M(t) = E(e^{tx}) = \sum^\infty_{x=0} e^{tx}f(x)\)

Exponential density function:

\(f(x) = (1-e^{-\lambda x})\)

Substitute \(f(x)\) into the MGF:

\(\sum^\infty_{x=0} e^{tx}(\lambda e^{-\lambda x})\)

Since exponential function is continuous, we need to integrate.

\(\int^\infty_0 e^{tx}\lambda e^{-\lambda x}\)

Simplify

\(\int^\infty_0 \lambda e^{(\lambda-t)x}\)

Integrate

\(a = (t - \lambda)\)

\(\lambda \int^\infty_0 \frac{1}{a} e^{(a)x} = \frac{\lambda}{t - \lambda} e^{(t - \lambda)x}\)

If x \(\rightarrow \infty\), then \(e^{(t-\lambda)x}\) goes to infinity. But if \(t\) is less than \(\lambda\), then \({(t-\lambda)x}\) which \(e^{(t-\lambda)x}\) goes towards zero. So this only works when \(t \leq \lambda\).

\(\frac{\lambda}{t - \lambda} \large[ e^{(t - \lambda)x} \large]^\infty_0\)

= \(\frac{\lambda}{t - \lambda} \large[0 - 1 \large] = \frac{\lambda}{\lambda - t}\)

MGF

\(\frac{\lambda}{\lambda - t}\)

Find the E(x) by solving the first derivative of the MGF at \(t=0\) in respect to \(t\)

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

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

Find the second derivative.

\(M'(0) = \frac{1}{\lambda}\)

\(M''(0) = 0?\)

I’m not sure if I’m on the right track here. There is no \(t\) to differentiate.

Find the Variance = \(E(X^2) - [E(X)]^2 = M''(0) - (M'(0))^2\)

\(M''(0) - (m'(0))^2 = 0 - \frac{1}{\lambda ^2} = - \frac{1}{\lambda ^2}\)