#11 page 363

This exercise is drawn from Grinstead and Snell’s Introduction to Probability The CHANCE Project1 Version dated 4 July 2006

The PROBLEM:

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 (a) ≥ 100. (b) ≥ 110. (c) ≥ 120.

ANSWER:

To estimate the probabilities, we can utilize the Central Limit Theorem (CLT) to approximate the distribution of Y365Y365​ based on the given information about the differences Xn=Yn+1−YnXn​=Yn+1​−Yn​. Since the differences XnXn​ are independent random variables with mean μ=0μ=0 and variance σ2=1/4σ2=1/4, the sum of these differences, S365=X1+X2+…+X364S365​=X1​+X2​+…+X364​, approximately follows a normal distribution with mean nμ=0nμ=0 and variance nσ2=364×(1/4)=91nσ2=364×(1/4)=91.

Now, Y365=Y1+S365=100+S365Y365​=Y1​+S365​=100+S365​, so we can find the probabilities for Y365Y365​ based on the standard normal distribution.

Let’s calculate these probalbilities in R:

# Parameters
n <- 364
mu <- 0
sigma_squared <- 1/4

# Calculate the mean and standard deviation for Y_365
mean_Y_365 <- 100 + n * mu
sd_Y_365 <- sqrt(n * sigma_squared)

# Estimate the probabilities using the cumulative distribution function (CDF) of the normal distribution
prob_Y_365_ge_100 <- 1 - pnorm(100, mean = mean_Y_365, sd = sd_Y_365)
prob_Y_365_ge_110 <- 1 - pnorm(110, mean = mean_Y_365, sd = sd_Y_365)
prob_Y_365_ge_120 <- 1 - pnorm(120, mean = mean_Y_365, sd = sd_Y_365)

# Print the results
print(prob_Y_365_ge_100 )
## [1] 0.5
print(prob_Y_365_ge_110 )
## [1] 0.1472537
print(prob_Y_365_ge_120)
## [1] 0.01801584

Exercise 2:

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

The moment generating function (MGF) of a random variable XX with probability density function f(x)f(x) is defined as:

MX(t)=E[etX]MX​(t)=E[etX]

where EE denotes the expectation operator.

For the exponential distribution with rate parameter λλ, the probability density function f(x)f(x) is given by:

f(x)=λe−λx, for x≥0f(x)=λe−λx, for x≥0

The MGF of the exponential distribution can be calculated as:

MX(t)=E[etX]=∫0∞etxλe−λx dxMX​(t)=E[etX]=∫0∞​etxλe−λxdx

=∫0∞λe(t−λ)x dx=∫0∞​λe(t−λ)xdx

=λλ−t, for t<λ=λ−tλ​, for t<λ

Using the MGF, we can find the moments of the exponential distribution. The rrth moment of the distribution is given by:

E[Xr]=MX(r)(0)E[Xr]=MX(r)​(0)

where MX(r)(t)MX(r)​(t) denotes the rrth derivative of the MGF with respect to tt, evaluated at t=0t=0.

To find the expected value and variance of the exponential distribution, we need to calculate the first and second moments, respectively.

  1. Expected Value (E[X]E[X]): E[X]=MX′(0)=ddt(λλ−t)∣t=0E[X]=MX′​(0)=dtd​(λ−tλ​)∣∣​t=0​

  2. Variance (Var[X]Var[X]): Var[X]=E[X2]−(E[X])2=MX′′(0)−(MX′(0))2=d2dt2(λλ−t)∣t=0−(ddt(λλ−t)∣t=0)2Var[X]=E[X2]−(E[X])2=MX′′​(0)−(MX′​(0))2=dt2d2​(λ−tλ​)∣∣​t=0​−(dtd​(λ−tλ​)∣∣​t=0​)2

Let’s calculate these in R, assuming that λ is the rate parameter of the exponential distribution.

# Define the rate parameter lambda
lambda <- 2

# Calculate the expected value using the first derivative of the MGF
expected_value <- 1 / lambda

# Calculate the variance using the second derivative of the MGF
variance <- 1 / lambda^2

# Print the results
cat("Expected Value:", expected_value, "\n")
## Expected Value: 0.5
cat("Variance:", variance, "\n")
## Variance: 0.25

Exercise 3

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

ANSWER: To calculate the expected value and variance of the exponential distribution using the moment generating function (MGF), we need to differentiate the MGF with respect to tt and then evaluate it at t=0t=0 to find the moments.

For the exponential distribution with rate parameter λλ, the MGF is given by:

MX(t)=λλ−t,t<λMX​(t)=λ−tλ​,t<λ

  1. Expected Value (E[X]E[X]): E[X]=MX′(0)E[X]=MX′​(0)

  2. Variance (Var[X]Var[X]): Var[X]=MX′′(0)−(MX′(0))2Var[X]=MX′′​(0)−(MX′​(0))2

Let’s calculate them in R:

# Define the rate parameter lambda
lambda <- 2

# Calculate the expected value using the first derivative of the MGF
expected_value <- 1 / lambda

# Calculate the variance using the second derivative of the MGF
variance <- 1 / lambda^2

# Print the results
cat("Expected Value:", expected_value, "\n")
## Expected Value: 0.5
cat("Variance:", variance, "\n")
## Variance: 0.25