Introduction to Probability

Page 363, Question 11
  1. 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
#given
n <- 365 #stock price for 365 days
y1 <- 100 #day 1 stock price
var <- n * 0.25 #variance for all stock prices
sd <- sqrt(var) #standard deviation for all stock prices
mean <- 0 #mean for all stock prices
  1. \(\ge 100\)
pnorm(100 - y1, mean, sd, lower.tail = FALSE)
## [1] 0.5
  1. \(\ge 110\)
pnorm(110 - y1, mean, sd, lower.tail = FALSE)
## [1] 0.1475849
  1. \(\ge 120\)
pnorm(120 - y1, mean, sd, lower.tail = FALSE)
## [1] 0.01814355
  1. Calculate the expected value and variance of the binomial distribution using the moment generating function.
    The Binomial Distribution, \[\begin{pmatrix}n\\x\end{pmatrix}p^xq^{n-x}\] Moment Generating Function for Binomial Distribution, \[M(t)=\sum_{x=0}^{n}e^{tx}\begin{pmatrix}n\\x\end{pmatrix}p^xq^{n-x}\] \[M(t)=\sum_{x=0}^{n}\begin{pmatrix}n\\x\end{pmatrix}(pe^t)^xq^{n-x} \] \[M(t)=(pe^t+q)^n\] Expected Value, \[M'(t)=n(pe^t+q)^{n-1}pe^t \] \[E(X)=M'(0)=np \] Variance, \[M''(t)=n[1-p+pe^t]^{n-1}(pe^t)+(pe^t)n(n-1)[1-p+pe^t]^{n-2}(pe^t)\] \[E(X^2)=M''(0)=n(n-1)p^2+np \] \[Var(X)=E(X^2)-E(X)^2 \] \[Var(X)=n(n-1)p^2+np-(np)^2 \] \[Var(X)=(n^2p^2-np^2)+np-(np)^2 \] \[Var(X)=np-np^2 \] \[Var(X)=np(1-p) \]

  2. Calculate the expected value and variance of the exponential distribution using the moment generating function.
    The Exponential Distribution, \[\lambda e^{-x\lambda} \] Moment Generating Function for Exponential Distribution, \[M(t)=\int_0^{\infty}e^{tx}\lambda e^{-x\lambda}dx \] \[M(t)=\lambda \int_0^{\infty}e^{-x(\lambda-t)} \] \[M(t)= - \lambda \frac{e^{-x(\lambda-t)}}{\lambda-t} \] \[M(t)=\frac{\lambda}{\lambda-t}\] Expected Value, \[M'(t)= \frac{\lambda}{(\lambda-t)^2}\] \[E(X)=M'(0)=\frac{\lambda}{\lambda^2}=\frac{1}{\lambda} \] Variance, \[M''(t)=\frac{2\lambda}{(\lambda-t)^3} \] \[E(X^2)=M''(0)=\frac{2\lambda}{\lambda^3}=\frac{2}{\lambda^2} \] \[Var(X)=E(X^2)-E(X)^2 \] \[Var(X)=\frac{2}{\lambda^2}-\frac{1}{\lambda^2} \] \[Var(X)=\frac{1}{\lambda^2} \]