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 \(\sigma\)^2 = 1/4. If Y1 = 100, estimate the probability that Y365 is


####E(Y1) = E(Y365) = 100

set.seed(10-30-2018)
reps = 10000
vec = c()

for (i in 1:reps)
{
  vec = c(vec,  sum (rnorm(364,0,0.5)) + 100)
}

(a) P(Y365>=100)

P100 = sum (vec >= 100)/reps
P100
## [1] 0.5013

(b) P(Y365>=110)

P110 = sum (vec >= 110)/reps
P110
## [1] 0.1447

(c) P(Y365>=120)

P120 = sum (vec >= 120)/reps
P120
## [1] 0.016

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

As shown in example 10.2 (page 367) of the Grninstead/Snell Intro to Probabilty Book -

The moment generating function for a binonmial distribution is

g(t) = (pe\(^t\) + q)\(^n\)

we can get the first and second derivatives of the function and solve for t=0. This will give us the expected value (mean) and the variance respectively.

µ1 = g’(0) = n(pe\(^t\) + q)\(^{n-1}\)pe\(^t\vert_{(t=0)}\) = np
µ2 = g’’(0) = n(n-1)p^2 + np

Expected value is µ = µ1 = np,
Variance is \(\sigma\)^2 = µ2 - µ1^2 = np(1-p)

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

g(t) = E[e\(^{tx}\)]
= \(\int_{0}^{\infty}\) e^{t\(\lambda\)} \(\lambda\) e^{-\(\lambda\)x} dx
= \(\lambda\) \(\int_{0}^{\infty}\) e^{(t-\(\lambda\))x} dx
= \(\lambda\)/(t - \(\lambda\)) [e^(t-\(\lambda\))x] from 0 to \(\infty\)
= \(\lambda\)/(\(\lambda\) - t) for t < \(\lambda\)

µ1 = g’(0) = \(\lambda\)^-1 mean E[x]
µ2 = g’’(0) = \(\lambda\)^-2 variance