Question 1

1) The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) is given by \(Yn\) on the \(n\)th 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

(a) \(\ge\) 100

# set variables
n <- 365
mu <- 0
y <- 100
mu_y <- mu + y
var <- 1/4 * (n)
sd <- sqrt(var)
x1 <- 100

# compute
1-pnorm(x1, mu_y, sd)
## [1] 0.5

(b) \(\ge\) 110

# set var
x2 <- 110

# compute
1-pnorm(x2, mu_y, sd)
## [1] 0.1475849

(c) \(\ge\) 120

# set var
x3 <- 120

# compute
1-pnorm(x3, mu_y, sd)
## [1] 0.01814355

Question 2

2) Calculate the expected value and variance of the binomial distribution using the moment generating function.

The binomial function is:

\[b(x, n, p)=\frac{n !}{x !(n-x) !} p^x q^{n-x}\]

Where \(q = p - 1\)

And the Moment Generating Function (MGF) is:

\[M x(t)=\sum_{x=0}^n e^{x t} \frac{n !}{x !(n-x) !} p^x q^{n-x}=\sum_{x=0}^n\left(p e^t\right)^x \frac{n !}{x !(n-x) !} q^{n-x}=\left(q+p e^t\right)^n\]

First let’s take the derivative with respect to \(t\):

\[\frac{d M(t)}{d t}=p e^t n\left(q+p e^t\right)^{n-1}\]

Then Expected Value \(E(X)\) at \(t=0\):

\[\begin{gathered} \frac{d M(t)}{d t}=p e^0 n\left(q+p e^0\right)^{n-1}=p n(q+p)^{n-1}=p n(1-p+p)^{n-1}=n p \\ E\left(x^2\right)=n p(q+p)^{n-2}(q+n p)=n p(q+n p) \end{gathered}\]

Where the variance is \(V(X)=E(X^2)-E(X)^2\):

\[V(X)=E\left(x^2\right)-(E(x))^2=n p(q+n p)-(n p)^2=n p(q+n p)-n^2 p^2=n p q\]

We find that \(E(X)=np\) and \(V(X)=npq\).

Question 3

3) Calculate the expected value and variance of the exponential distribution using the moment generating function.

The exponential distribution is:

\[f(x)=\lambda{e}^{-\lambda{x}}\]

The MGF would then be:

\[M x(t)=\int_{-\infty}^{\infty} e^{t x} f x(x) d x=\int_0^{\infty} e^{t x} \lambda e^{-\lambda x} d x=\lambda \int_0^{\infty} e^{(t-\lambda) x} d x=\frac{\lambda}{t-\lambda}\]

Expected value \(E(X)\) substitute \(t=0\):

\[E(X)=\frac{\lambda}{(t-\lambda)^2}=\frac{1}{\lambda}\]

Where the variance is \(V(X)=E(X^2)-E(X)^2\):

\[\begin{gathered} E\left(x^2\right)=\frac{2 \lambda}{(t-\lambda)^3}=\frac{2}{\lambda^2} \\ E(X)^2=\frac{2 \lambda}{(\lambda-0)^3}-\frac{1}{\lambda^2} \\ V(X)=\frac{2 \lambda}{\lambda^3}-\frac{1}{\lambda^2} \\ V(X)=\frac{2}{\lambda^2}-\frac{1}{\lambda^2} \\ V(X)=\frac{1}{\lambda^2} \end{gathered}\]

We find that \(E(X)=\frac{1}{\lambda}\) and \(V(X)=\frac{1}{\lambda^2}\)