1. 11 page 363

    11 The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) is given by Yn on the nth day of the year. Finn observes that the differences Xn = Yn+1 ??? Yn appear to be independent random variables with a common distribution having mean ยต = 0 and variance ?? 2 = 1/4. If Y1 = 100, estimate the probability that Y365 is (a) ??? 100. (b) ??? 110. (c) ??? 120.
u <- 0
E <- 100
sd <- sqrt((365/4))
a <- 100
p_a = pnorm( a - 100, mean = u, sd = sd, lower.tail = FALSE)
print(p_a)
## [1] 0.5

So the anwser of (a) is 50% of chance.

b <- 110
p_b = pnorm( b - 100, mean = u, sd = sd, lower.tail = FALSE)
print(p_b)
## [1] 0.1475849

So the answer of (b) is 14.8% of chance.

c <- 120
p_c = pnorm( c - 100, mean = u, sd = sd, lower.tail = FALSE)
print(p_c)
## [1] 0.01814355

So the answer of (c) is 1.8% of chance.

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

Binomial Distribution: \(p(x) = \binom{n}{j}p^j(q)^{n-j}\)

Moment Generating Function:

\[ \ g(t) = \sum_{j=0}^{n} e^{jt}p(x) \\ = \sum_{j=0}^{n} e^{jt} \binom{n}{j}p^j(q)^{n-j} \\ = \binom{n}{j} (pe^t)^j q^{n-j} \\ = (pe^t + q)^n \ \] If \(a = pe^t\), according to the binomial theorem:

\(\sum_{j=0}^{n} \binom{n}{j} (a)^j q^{n-j} = (a+q)^n\)

momenting generating function: \((pe^t + q)^n\)

\(\sigma^2 = E(X^2) - E(X)^2\)

\(E(X) = g'(0) = n(pe^t +q)^{n-1}pe^t\big|_{t=0} = np\)

Set t = 0, we get p+q in the base and q = 1-p so p+1-p = 1;

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

\(E(X^2) = g''(0) = np \bigg[ e^t \big( p(n-1)(pe^t + q)^{n-2} + (pe^t + q)^{n-1} \big) \bigg]\bigg|_{t=0} =\) \(np^2(n-1)+np\)

The variance is \(V(X)=\sigma^2 = np^2(n-1)+np - (np)^2 = np(1-p)\)

So \(E(X^2)=np^2(n-1)+np\); \(V(x)= np(1-p)\)

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

For exponential distribution, \(f(x)=\lambda e^{-\lambda x}\).

Moment generating function: \(M_X(t)=\frac{\lambda}{\lambda-t}, t<\lambda\).

Using WolframAlpha, we get \(M'_X(t) = \frac{\lambda}{(\lambda-t)^2}\) and \(M''_X(t) = \frac{2\lambda}{(\lambda-t)^3}\).

Expected value:

\[ \begin{split} E(X)=M'_X(0) &= \frac{\lambda}{(\lambda-0)^2} \\ &= \frac{\lambda}{\lambda^2}\\ &= \frac{1}{\lambda} \end{split} \] Variance:

\[ \begin{split} V(X) = E(X^2)-E(X)^2 &= M''_X(0)-M'_X(0)^2 \\ &=\frac{2\lambda}{(\lambda-0)^3} - \frac{1}{\lambda^2}\\ &=\frac{2\lambda}{\lambda^3} - \frac{1}{\lambda^2}\\ &=\frac{2}{\lambda^2} - \frac{1}{\lambda^2}\\ &=\frac{1}{\lambda^2} \end{split} \]