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

a.) \(\geq 100\)

By the Central Limit Theorem, \(lim_{x\rightarrow\infty} P(a<\frac{S_n-n\mu}{\sqrt{n\sigma^2}}<b)=\frac{1}{2\pi}\int_a^be^{-\frac{x^2}{2}}dx\) Setting \(b\) to \(\infty\) (or taking the limit as \(b\) approaches \(\infty\)), we can find the probability. Since the cumulative distribution function for a normal distribution is \(\frac{1}{2\pi}\int_{-\infty}^{a}e^{-\frac{x^2}{2}}dx\), this is equal to 1-the cumulative distribution. Plugging this into R:

1-pnorm(0)
## [1] 0.5

b.) \(\geq 110\)

1-pnorm(10/sqrt(91))
## [1] 0.1472537

c.) \(\geq 120\)

1-pnorm(20/sqrt(91))
## [1] 0.01801584

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

The moment generating function is defined by \[ \sum_{j=1}^\infty e^{tj}p(x_j) \]

For the binomial distribution, this works out to:

\[ \sum_{j=0}^n{n\choose j}(pe^t)^jq^{n-j} \]

This works out to the binomial distribution of \((a+b)^n\) where \(a=pe^t\) and \(b=q\). So \(g(t)=(pe^t+q)^n\).

The first moment is defined as the first derivative of g. So \[ \frac{d}{dt}g(t)=n(pe^t+q)^{n-1}(pe^t) \]

The second moment is

\[ \frac{d^2}{dt^2}g(t)=(n)(n-1)(pe^t+q)^{n-2}(pe^t)^2+n(pe^t+q)^{n-1}(pe^t) \]

Evaluation both at \(t=0\), we have for \(\mu_1=n(p+q)^{n-1}(p)\)

Since \(p=1-q\), this is \(\mu_1=n(1)^{n-1}p=np\)

For \(m_2=(n)(n-1)(p+q)^{n-2}(p)^2+n(p+q)^{n-1}(p)=(n)(n-1)(1)^{n-2}p^2+n(1)^{n-1}p=(n)(n-1)p^2+np\)

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

\[ p(x)=\lambda e^{-\lambda x} \]

The moment generating function for a continuous function is

\[ g(t)=\int^\infty_{-\infty}e^{tx}\lambda e^{-\lambda x}dx\\ =\lambda\int_0^\infty e^{x(t-\lambda)}dx\\ =\lambda(\frac{e^{x(t-\lambda)}}{t-\lambda})\bigg|_0^\infty \]

For this to not be infinite, \(t<\lambda\). This makes \(\lim_{x\rightarrow\infty}e^{x(t-\lambda)}=0\). So we can go back to the above equation and write: \[ \lambda(\frac{0}{t-\lambda}-\frac{1}{t-\lambda})=-\frac{\lambda}{t-\lambda}=\frac{\lambda}{\lambda-t} \]

So for \(\mu_1=\frac{d}{dt}g(0)=\frac{\lambda}{(\lambda)^2}=\frac{1}{\lambda}\)

For \(\mu_2=\frac{d^2}{dt^2}g(0)=\frac{2\lambda}{(\lambda-t)^3}=\frac{2}{\lambda^2}\)

The mean is \(\mu_1\) and \(\sigma^2=\frac{2}{\lambda^2}-\frac{\lambda^2}{(\lambda)^4}=\frac{2}{\lambda^2}-\frac{1}{\lambda^2}=\frac{1}{\lambda}^2\)