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 \(µ\) = 0 and variance \(σ^2\) = 1/4. If \(Y_1\) = 100, estimate the probability that \(Y_{365}\) is
mean <- 0
variance <- 365*(1/4)
sd <- sqrt(variance)
p <-pnorm(100-100,mean,sd,lower.tail = FALSE)
p
## [1] 0.5
mean <- 0
variance <- 365*(1/4)
sd <- sqrt(variance)
p <-pnorm(110-100,mean,sd,lower.tail = FALSE)
p
## [1] 0.1475849
mean <- 0
variance <- 365*(1/4)
sd <- sqrt(variance)
p <-pnorm(120-100,mean,sd,lower.tail = FALSE)
p
## [1] 0.01814355
generating function.
For binomial distribution: \(P(X=k) = {n \choose k} p^k q^{n-k}\), where \(q=1-p\).
The moment generating function is \(M_X(t)=(q+pe^t)^n\).
The first moment is \(M'_X(t) = n(q+pe^t)^{n-1}pe^t\)
\[ \begin{split} E(X)=M'_X(0) &= n(q+pe^0)^{n-1}pe^0\\ &= n(q+p)^{n-1}p\\ &= np(1-p+p)^{n-1}\\ &= np1^{n-1}\\ &=np \end{split} \]
Answer: \(E(X)=np\)
The second moment is \(M''_X(t) = n(n-1)(q+pe^t)^{n-2}p^2 e^{2t}+n(q+pe^t)^{n-1}pe^t\).
Evaluate the second moment at \(t=0\):
\[ \begin{split} E(X^2)=M''_X(0) &= n(n-1)(q+pe^0)^{n-2}p^2 e^0+n(q+pe^0)^{n-1}pe^0\\ &= n(n-1)(1-p+p)^{n-2}p^2+n(1-p+p)^{n-1}p\\ &= n(n-1)p^2+np \end{split} \]
The variance is \(V(X)=E(X^2)-E(X)^2\):
\[ \begin{split} V(X) &= n(n-1)p^2+np-n^2p^2 \\ &= np((n-1)p+1-np) \\ &= np(np-p+1-np) \\ &= np(1-p) \\ &= npq \end{split} \]
Answer: \(V(X)=npq\)
generating function.
For exponential distribution: \(f(x)=\lambda e^{-\lambda x}\)
The moment generating function is \(M_X(t)=\frac{\lambda}{\lambda-t}\), where \(t<\lambda\)
\[ \begin{split} E(X)=M'_X(0) &= \frac{\lambda}{(\lambda-0)^2} \\ &= \frac{\lambda}{\lambda^2}\\ &= \frac{1}{\lambda} \end{split} \]
Answer: \(E(X)=1/\lambda\)
\[ \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} \]
Answer: \(V(X)=1/\lambda^2\)