Since \(X_n = Y_{n+1}-Y_n\)
\(Y_{365} - Y_{1} = (Y_{365} - Y_{364}) + (Y_{364} - Y_{363}) + ... + (Y_{3} - Y_{2}) + (Y_{2} - Y_{1})\)
From the above equation, we can replace \((Y_{n+1}-Y_n)\) with \(X_n\)
\(\Rightarrow Y_{365} - Y_{1} = X_{364} + X_{363} + ... + X_{2} + X_{1}\)
Since \(Y_1 = 100\), we can substitute this value in the above equation to get
\(Y_{365} - 100 = X_{364} + X_{363} + ... + X_{2} + X_{1}\)
\(Y_{365} = 100 + X_{364} + X_{363} + ... + X_{2} + X_{1}\)
We know \(X_{1}, X_{2}, X_{3} ... X_{364}\) have \(\mu = 0\) and \(X_{1}, X_{2}, X_{3} ... X_{364}\) have variance \(\frac{1}{4}\) for each item.
The variance of \(Y_{365} = 365\) X \(\frac{1}{4}\) = \(91.25\)
Variance = \(91.25\)
Standard Deviation = \(\sqrt{91.25}\) = \(9.5524\)
x <- (100 - 100)
y <- pnorm(x, mean = 0, sd = 9.5524, lower.tail = FALSE)
round(y, 4)
## [1] 0.5
x <- (110 - 100)
y <- pnorm(x, mean = 0, sd = 9.5524, lower.tail = FALSE)
round(y, 4)
## [1] 0.1476
x <- (120 - 100)
y <- pnorm(x, mean = 0, sd = 9.5524, lower.tail = FALSE)
round(y, 4)
## [1] 0.0181
The Binomial Distribution is:
\(b(x, n, p)\) = \(\frac{n!}{x!(n-x)!}p^xq^{n-x}\) where \(q\) = \((1 - p)\)
The Moment Generating Function for Binomial Distribution is:
\(M_x(t)\)= \(\displaystyle\sum_{x=0}^{n} e^{xt}\frac{n!}{x!(n-x)!}p^xq^{n-x}\)
\(f(t)\)= \(\displaystyle\sum_{x=0}^{n} (pe^t)^{x}\frac{n!}{x!(n-x)!}q^{n-x}\) = \((q + pe^t)^n\)
Differentiating the Moment Generating Function with respect to \(t\) we get:
\(\frac{d}{dt}(f(t))\) = \(\frac{d}{dt}(q + pe^t)^n\)
\(f^{'}(t)\) = \(npe^t(q + pe^t)^{n-1}\)
= \(npe^t(q + pe^t)^{n-1}\)
By evaluating this function for \(t\) = \(0\), we get
\(E(x)\) = \(np(q+p)^{n-1}\)
\(E(x)\) = \(np\)
Differentiating the Moment Generating Function again with respect to \(t\) we get:
\(\frac{d}{dt}(f^{'}(t))\) = \(\frac{d}{dt}(npe^t.(q + pe^t)^{n-1})\)
In order to differentiate this, we need to use the product rule:
\(\frac{duv}{dx}\) = \(u\frac{dv}{dx} + v\frac{du}{dx}\)
\(u\) = \(npe^t\)
\(v\) = \((q + pe^t)^{n-1}\)
\(f^{''}(t)\) = \((npe^t)\).\(\frac{d}{dt}((q + pe^t)^{n-1})\) + \(((q + pe^t)^{n-1})\).\(\frac{d}{dt}(npe^t)\)
\(f^{''}(t)\) = \(npe^t\).\(\{(n-1)(q+pe^t)^{n-2}pe^t\}\) + \((q + pe^t)^{n-1}\).\(\{npe^t\}\)
After simplifying we get this:
\(f^{''}(t)\) = \(npe^t\).\((q+pe^t)^{n-2}\{q + npe^t\}\)
By evaluating this function for \(t\) = \(0\), we get
\(E(x^2)\) = \(np(q+p)^{n-2}(q+np)\)
\(E(x^2)\) = \(np(q+np)\)
Variance = \(E(x^2) - (E(x))^2\)
Variance = \(np(q+np) - (np)^2\) = \(npq + n^2p^2 - n^2p^2\)
Variance = \(npq\)
\(E(x)\) = \(np\)
\(Variance(x)\) = \(npq\)
The exponential distribution is:
\[
f(x) = \left\{ \begin{array}{ll}
\lambda e^{-\lambda x} & \mbox{if $x \geq 0$}\\
0 & \mbox{otherwise}.\end{array} \right.
\]
The Moment Generating Function for Exponential Distribution is:
\(M_x(t)\) = \(\int_{0}^{\infty} (e^{xt}) \lambda e^{-\lambda x} dx\)
\(f(t)\) = \(\lambda \int_{0}^{\infty} e^{x(t-\lambda)} dx\) = \(\frac{\lambda}{t-\lambda}\) for \(|t| < \lambda\)
Differentiating the Moment Generating Function with respect to \(t\) we get:
\(\frac{d}{dt}(f(t))\) = \(\frac{\lambda}{(\lambda-t)^2}\)
\(f^{'}(t)\) = \(\frac{\lambda}{(\lambda-t)^2}\)
By evaluating this function for \(t\) = \(0\), we get
\(E(x)\) = \(\frac{\lambda}{(\lambda-0)^2}\) = \(\frac{1}{\lambda}\)
Differentiating the Moment Generating Function again with respect to \(t\) we get:
\(\frac{d}{dt}(f^{'}(t))\) = \(\frac{d}{dt}(\frac{1}{\lambda})\)
\(f^{''}(t)\) = \(\frac{2\lambda}{(\lambda-t)^3}\)
By evaluating this function for \(t\) = \(0\), we get
\(E(x^2)\) =\(\frac{2}{\lambda^2}\)
Variance = \(E(x^2) - (E(x))^2\)
Variance = \(\frac{2}{\lambda^2} - (\frac{1}{\lambda})^2\)
Variance = \(\frac{1}{\lambda^2}\)
\(E(x)\) = \(\frac{1}{\lambda}\)
\(Variance(x)\) = \(\frac{1}{\lambda^2}\)