1-pnorm((100-100)/(0.5*sqrt(365-1)))
## [1] 0.5
1-pnorm((110-100)/(0.5*sqrt(365-1)))
## [1] 0.1472537
1-pnorm((120-100)/(0.5*sqrt(365-1)))
## [1] 0.01801584
Moment Generating Function:
\[ \ g(t) = \sum_{j=0}^{n} e^{jt}p(x) \\ = \sum_{j=0}^{n} e^{jt} \binom{n}{j}p^j(q)^{n-j} \\ = \binom{n}{j} (pe^t)^j q^{n-j} \\ = (pe^t + q)^n \ \] If \(a = pe^t\), according to the binomial theorem:
\(\sum_{j=0}^{n} \binom{n}{j} (a)^j q^{n-j} = (a+q)^n\)
momenting generating function: \((pe^t + q)^n\)
\(\sigma^2 = E(X^2) - E(X)^2\)
\(E(X) = g'(0) = n(pe^t +q)^{n-1}pe^t\big|_{t=0} = np\) Set t = 0, we get p+q in the base and q = 1-p so p+1-p = 1; \(E(X)^2 = (np)^2\) \(E(X^2) = g''(0) = np \bigg[ e^t \big( p(n-1)(pe^t + q)^{n-2} + (pe^t + q)^{n-1} \big) \bigg]\bigg|_{t=0} =\) \(np^2(n-1)+np\)
The variance is \(V(X)=\sigma^2 = np^2(n-1)+np - (np)^2 = np(1-p)\)
So \(E(X^2)=np^2(n-1)+np\); \(V(x)= np(1-p)\)
For exponential distribution, \(f(x)=\lambda e^{-\lambda x}\).
Moment generating function: \(M_X(t)=\frac{\lambda}{\lambda-t}, t<\lambda\).
Using WolframAlpha, we get \(M'_X(t) = \frac{\lambda}{(\lambda-t)^2}\) and \(M''_X(t) = \frac{2\lambda}{(\lambda-t)^3}\). Expected value: \[ \begin{split} E(X)=M'_X(0) &= \frac{\lambda}{(\lambda-0)^2} \\ &= \frac{\lambda}{\lambda^2}\\ &= \frac{1}{\lambda} \end{split} \] Variance: \[ \begin{split} V(X) = E(X^2)-E(X)^2 &= M''_X(0)-M'_X(0)^2 \\ &=\frac{2\lambda}{(\lambda-0)^3} - \frac{1}{\lambda^2}\\ &=\frac{2\lambda}{\lambda^3} - \frac{1}{\lambda^2}\\ &=\frac{2}{\lambda^2} - \frac{1}{\lambda^2}\\ &=\frac{1}{\lambda^2} \end{split} \]