Question 1

The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) is given by Yn on the nth day of the year. Finn observes that the differences Xn = Yn+1 − Yn appear to be independent random variables with a common distribution having mean µ = 0 and variance \(σ^2 = 1/4\). If Y1 = 100, estimate the probability that Y365 is

We can use the pnorm function to calculate these:
pnorm(q, mean, sd, lower.tail)
q = our range = Y-Y1 = y - 100 = (Y being the changing greater than value)
mean = µ = 0
sd = \(\sqrt(Y365*σ^2)\) = \(\sqrt(365*\frac{1}{4})\)
lower.tail = FALSE

  1. ≥ 100.
sd <- sqrt(365*.25) #will use this for sd for a, b, & c
q <- 100-100
Ya <- pnorm(q, 0, sd, lower.tail = FALSE)
cat("If Y1 = 100, the probability that Y365 is ≥ 100: ", Ya, " or ", Ya*100, "%")
## If Y1 = 100, the probability that Y365 is ≥ 100:  0.5  or  50 %
  1. ≥ 110.
q <- 110-100
Yb <- pnorm(q, 0, sd, lower.tail = FALSE)
cat("If Y1 = 100, the probability that Y365 is ≥ 110: ", Yb, " or ", Yb*100, "%")
## If Y1 = 100, the probability that Y365 is ≥ 110:  0.1475849  or  14.75849 %
  1. ≥ 120.
q <- 120-100
Yc <- pnorm(q, 0, sd, lower.tail = FALSE)
cat("If Y1 = 100, the probability that Y365 is ≥ 120: ", Yc, " or ", Yc*100, "%")
## If Y1 = 100, the probability that Y365 is ≥ 120:  0.01814355  or  1.814355 %

Question 2

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

Moment generating function: \(Mz(t)=∑e^(tx)\)
Binomial distribution function: P(x)= \({n}\choose{x}\)\(p^xq^(n-x)\)
So,
M(t) = ∑e^(tx) * \({n}\choose{x}\)\(p^xq^(n-x)\)
\(M(t) = (pe^t + q)^n\)
First instance for the expected value:
\(M`(t) = n(pe^t+q)^(n−1)pe^t\)
We plug in 0 to get the excepted value:
\(M`(0) = n(pe^0+q)^(n−1)pe^0\)
\(M`(0) = n(p+q)^(n−1)p\) (\(e^0=1\) & q is 1-p)
\(M`(0) = n(p+1-p)^(n−1)p\)
\(M`(0) = n(1)^(n−1)p\)
\(M`(0) = np\)
For variance:
\(σ2 = μ``−μ`^2 = M``(0) - M`(0)^2\)
\(M``(0) = n(n-1)(pe^t+q)(pe^t)^2 + n(pe^t+q)^(n−1)pe^t\)
\(σ2 = n(n-1)(pe^0+q)(pe^0)^2 + n(pe^0+q)^(n−1)pe^0 - (np)^2\) (since we already know M`(0))
\(σ2 = n(n-1)(p+q)(p)^2 + n(p+q)^(n−1)p - (np)^2\) (q is 1-p)
\(σ2 = n(n-1)(p+1-p)(p)^2 + n(p+1-p)^(n−1)p - (np)^2\)
\(σ2 = n(n-1)(1)(p)^2 + n(1)^(n−1)p - (np)^2\)
\(σ2 = n(n-1)(p)^2 + np - (np)^2\)
\(σ2 = n(n-1)(p)^2 + np - (np)^2\)
\(σ2 = np((np−p)+1−np)\)
So the expected value is np & variance is \(np((np−p)+1−np)\)

Question 3

Calculate the expected value and variance of the exponential distribution using the moment generating function.
Moment generating function: \(Mz(t)=∑e^(tx)\)
Exponential distribution function: \(P(x)= λe^(−λx)\)
So,
\(M(t) = ∑e^(tx) * λe^(−λx)\)
\(M(t) = λ∑e^((t−λ)x)\)
\(M(t) = \frac{λ}{t−λ}\)
First instance for the expected value:
\(M`(t) = -\frac{λ}{(t−λ)^2}\)
We plug in 0 to get the excepted value:
\(M`(0) = -\frac{λ}{(0−λ)^2}\)
\(M`(0) = -\frac{λ}{(−λ)^2}\)
\(M`(0) = -\frac{λ}{−λ^2}\)
\(M`(0) = -(λ^(-1))\)
\(M`(0) = \frac{1}{λ}\) or \(λ^(-1)\)
For variance:
\(σ2 = μ``−μ`^2 = M``(0) - M`(0)^2\)
\(M``(0) = \frac{2λ}{(t−λ)^3}\)
\(σ2 = \frac{2λ}{(0−λ)^3} - (λ^(-1))^2\)
\(σ2 = \frac{2λ}{(−λ)^3} - λ^(-1*2)\)
\(σ2 = \frac{2λ}{λ^3} - λ^(-2)\)
\(σ2 = \frac{2}{λ^2} - \frac{1}{λ^2}\)
\(σ2 = \frac{1}{λ^2}\) or or \(λ^(-2)\)
So the expected value is \(\frac{1}{λ}\) & variance is \(\frac{1}{λ^2}\)