HW9_605

jbrnbrg

October 24, 2017


1

(11 page 363 ) The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) 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. \(\ge 100\).
  2. \(\ge 110\).
  3. \(\ge 120\).

Ans:

1a) \(P(X_{365}\ge 100)\):

I’ll use a normal distribution \(\texttt{pnorm}(X, n \sigma^2)\) to model this probability desnity per the central limit theorem.

my_mu <- 100  # the initial price
my_var <- 1/4
my_n <- 364  

# pnorm lower.tail=T :=> P[X<=x] otherwise P[X >x]
# to get P[X>=x], I use 1-pnorm
1 - pnorm(100, my_mu, my_n*(my_var), lower.tail=T)
## [1] 0.5

1b) \(P(X_{365}\ge 110)\):

1 - pnorm(110, my_mu, my_n*(my_var))
## [1] 0.4562483

1c) \(P(X_{365}\ge 120)\):

1 - pnorm(120, my_mu, my_n*(my_var))
## [1] 0.4130212

2

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

Ans:

The binomial pmf is given by:
\[\binom{n}{k}p^k(1-p)^{n-k}\]

To get the moment generating function I apply the following:

\(M_X(t)=\sum_{X}e^{tX}p(x)\) where \(p(x)\) is a discrete function like the binomial to get:

\(M_X(t)=\sum_{x=0}^ne^{tx}\binom{n}{x}p^x(1-p)^{n-x}\) and letting \(q=1-p\) and expanding to get:
\(M_X(t)=\sum_{x=0}^ne^{tx}\frac{n!}{x!(n-x)!}p^xq^{n-x}\)
\(M_X(t)=\sum_{x=0}^n (pe^t)^x \frac{n!}{x!(n-x)!}q^{n-x}\). This has the form \(M_X(t)=(q+pe^t)^n\).

Setting the first differential to zero and solving for \(t\) will yeild the mean of \(X\) and doing the same for the second differential will yeild the variance:

\(\frac{d}{dt}M_X(t)=\frac{d}{dt}(q+pe^t)^n=npe^t(pe^t+q)^{n-1}\) then \(E[X]=\frac{d}{dt}M_X(0)=np(q+p)^{n-1}=np\)

\(\frac{d^2}{dt^2}M_X(0)=npe^0(q+pe^0)^{n-2}(q+npe^0)=E[X^2]=np(q+np) \implies Var[X]=np(1-p)\)

\(\therefore \underline{E[X]=np}\), \(\underline{Var[X]=np(1-p)}\)


3

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

Ans:

Using the form:

\(M_X(t)=\int_{-\infty}^{\infty}e^{tx}g(x)dx\) where \(g(x)\) is a continuous function like the exponential distribution to get:

\(M_X(t)=\int_{0}^{\infty}\lambda e^{tx}e^{-\lambda x}dx=\lambda \int_{0}^{\infty}e^{(t-\lambda)x}dx\) which leads to:

\(M_X(t) = \frac{\lambda}{\lambda - t}\).

Again, setting the first differential to zero and solving for \(t\) will yeild the mean of \(X\) and doing the same for the second differential will yeild the variance:

\(\frac{d}{dt}M_X(t)=\frac{\lambda}{(\lambda - t)^2}\). Then to \(E[X]=\frac{d}{dt}M_X(0)=\frac{1}{\lambda}\). Continuing to the second derivative:

\(E[X^2]=Var[X]=\frac{d^2}{dt^2}M_X(0)=\frac{2\lambda}{(\lambda - 0)^3}=\frac{2}{\lambda^2}\).

\(\therefore \underline{E[X]=\frac{1}{\lambda}}\), \(\underline{Var[X]=\frac{2}{ \lambda^2}}\)