1. The price of one share of stock in the Pilsdorff Beer Company (see Exer- cise 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
  1. ≥ 100.
1-pnorm((100-100)/(0.5*sqrt(365-1)))
## [1] 0.5
  1. ≥ 110.
1-pnorm((110-100)/(0.5*sqrt(365-1)))
## [1] 0.1472537
  1. ≥ 120.
1-pnorm((120-100)/(0.5*sqrt(365-1)))
## [1] 0.01801584
  1. Calculate the expected value and variance of the binomial distribution using the moment generating function.

Link to article describing how to calculate the expected value and variance using moment generating function

We start with the probability mass function for a binomial random variable

\[ f (x) = C(n , x)px(1 – p) ^{n-x} \] The probability mass function is used to generate the moment generating function

\[ M(t) = Σx = 0^{n} e^{tx}C(n,x)p^{x}(1 – p)^{n - x} \]

We can combine terms:

\[ M(t) = Σx = 0^{n}(pe^{t})xC(n,x)(1 – p)^{n - x} \]

\[ M(t) = [(1 – p) + pe^{t}]^{n} \]

To find the mean and variance we need to find the first and second movement. We take the first and second derivatives and evaluate at t = 0

\[ M’(t) = n(pe^{t})[(1 – p) + pe^{t}]^{n - 1} \] When we evaluate at t = 0 we get:

\[ M(0) = n(pe^{0})[(1 – p) + pe^{0}]^{n - 1} = np \] To find the variance we take the second derivative \[ M’’(t) = n(n - 1)(pe^{t})^{2}[(1 – p) + pe^{t}]^{n - 2} + n(pe^{t})[(1 – p) + pe^{t}]^{n - 1} \] \[ M’’(0) = n(n - 1)p^{2} +np \] \[ σ2 = M’’(0) – [M’(0)]^{2} = n(n - 1)p2 +np - (np)^{2} = np(1 - p) \]

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

Great resource with R code

For the exponential distribution, the probability density function(PDF) is: \[ λe^{−xλ} \] The movement generating function(MGF) is: \[ E(e^{tx}) \] \[ M(t)=∫_∞^{0}e^{tx}λe^{−xλ}dx \] We can simply this by pulling out lambda, because we are integrating in terms of x \[ λ∫_∞^{0}e^{−x(λ−t)} \] \[ −λ(e^{−x(λ−t)}/(λ−t)) \] \[ λ/(λ−t) \] Now to get the first movement: \[ M′(t)=λ/(λ−t)^2 \] We solve for t = 0 and get a result that looks familiar! \[ M′(0)=λ/λ^{2}=1/λ \] For the second movement we take the derivate again \[ M′′(t)=2λ/(λ−t)^3 \] Solve for t = 0 again \[ M′′(0)=2λ/λ^{}3=2/λ^2 \] We have one last step, we have to remove the influence of the first movement \[ E(X2)−E(X)^{2}=2λ^{2}−1/λ^{2}=1/λ^2 \]