Question:
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
Answer:
Using CLT, we can compute the probability by calcualting the z-score for a normal distribution using the sample mean and sample standard deviation
\[Z = \frac{\left(x - 100 \right) - n\bar{\mu} }{\sqrt{n}\bar{\sigma}}\]
\[Z = \frac{\left(x - 100 \right) - 365 * 0 }{\sqrt{365}\sqrt{0.25}}\]
(z <- (0 - 0) / (sqrt(365) * sqrt(0.25)))
## [1] 0
(round(pnorm(q = z, mean = 0, sd = 1, lower.tail = FALSE), 3))
## [1] 0.5
Question:
Answer:
(z <- (10 - 0) / (sqrt(365) * sqrt(0.25)))
## [1] 1.046848
(round(pnorm(q = z, mean = 0, sd = 1, lower.tail = FALSE), 3))
## [1] 0.148
Question:
Answer:
(z <- (20 - 0) / (sqrt(365) * sqrt(0.25)))
## [1] 2.093696
(round(pnorm(q = z, mean = 0, sd = 1, lower.tail = FALSE), 3))
## [1] 0.018
Question:
Calculate the expected value and variance of the binomial distribution using the moment generating function.
Answer:
\[g\left( t \right) = \sum_{j=0}^{n}{{e}^{tj} \begin{pmatrix} n \\ j \end{pmatrix} {p}^{j} {q}^{n-j} }\]
\[= \sum_{j=0}^{n}{\begin{pmatrix} n \\ j \end{pmatrix} {\left( p{e}^{t} \right)}^{j} {q}^{n-j} }\]
The binomial theorem states:
\[\sum_{x=0}^{n}{\begin{pmatrix} n \\ x \end{pmatrix} {y}^{x} {z}^{n-x} } = {\left( y+z \right)}^{n}\]
So, we have the following function:
\[g\left( t \right) = {\left( {pe}^{t} + q\right)}^{n}\]
now, we want to evaluate the derivative of the moment at \(t=0\)
\[{\mu}_{1} = g \prime \left( 0 \right) = n {pe}^{t}{\left( {pe}^{t} + q\right)}^{n-1} {|}_{t=0} = np\]
for the second derivative, we need to use the product rule:
\[{\mu}_{2} = g \prime \prime \left( 0 \right) = {npe}^{t}\left[ {pe}^{t} {\left(n-1 \right) \left( {pe}^{t} + q \right)}^{n-2} \right] + n {pe}^{t}{\left( {pe}^{t} + q\right)}^{n-1} {|}_{t=0}\] \[= {npe}^{t} {\left( {pe}^{t} + q \right)}^{n-2} \left[ {pe}^{t} \left( n-1 \right) + \left( {pe}^{t} + q \right) \right] \]
\[= {npe}^{t} {\left( {pe}^{t} + q \right)}^{n-2} \left[ {npe}^{t} + q \right] \]
\[= np {\left( p+q \right)}^{n-2}\left[ np+q\right]\]
since \(p + q = 1\), we can simplify the function:
\[= np \left[np+q\right]\]
So, the variance is \({\mu}_{2} - {{\mu}_{1}}^{2}\)
\[{\sigma}^{2} = {\left( np\right)}^{2} + npq = {\left( np\right)}^{2} = npq\]
Question:
Calculate the expected value and variance of the exponential distribution using the moment generating function
Answer:
\[g\left( t \right) = \int _{ 0 }^{ \infty }{ { e }^{ tx } \lambda{e}^{-\lambda x} dx }\]
\[= \lambda \int _{ 0 }^{ \infty }{ {e}^{\left(t-\lambda \right)x} dx }\]
Now, we evaluate the function at zero
\[= \lambda \left[ \frac{1}{t-\lambda} {e}^{\left(t-\lambda \right)x} \right]_{0}^{\infty} \]
\[= \frac{\lambda}{t-\lambda}, where \quad t \lt \lambda\]
t must be less than lambda so that the exponential function is zero at infinity. Now, let’s get the first derivative of the function and evaluate it at zero to get the mean:
\[{\mu}_{1} = g \prime \left( 0 \right) = \lambda \times \frac{1}{\left(t-\lambda\right)} \frac{d}{dt}= -1 \times\frac{\left(t-\lambda \right)\frac{d}{dt}}{{\left(t-\lambda\right)}^{2}}\]
\[= \lambda \times -1 \times\frac{1 - 0}{{\left(t-\lambda\right)}^{2}} = \frac{\lambda}{{\left(\lambda-t\right)}^{2}}|_{t=0}\]
\[= \frac{\lambda}{{\lambda}^{2}} = \frac{1}{\lambda}\]
To get the variance, first we take the second derivative and evaluate it at zero:
\[{\mu}_{1} = g \prime \prime \left( 0 \right) = \frac{\lambda}{{\left(t-\lambda\right)}^{2}} \frac{d}{dt}\]
\[= \lambda \times \frac{-2\times \left(t-\lambda \right)\frac{d}{dt}}{{\left(t-\lambda\right)}^{3}}\]
\[= \frac{-2\lambda}{{\left(t - \lambda \right)}^{3}}|_{t=0} = \frac{2}{{\lambda}^{2}}\]
So, the variance is \({\mu}_{2} - {{\mu}_{1}}^{2}\)
\[\frac{2}{{\lambda}^{2}} - \frac{1}{{\lambda}^{2}} = \frac{1}{{\lambda}^{2}}\]