The price of one share of stock in the Pilsdorff Beer Company (see Exer- cise 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
\[\begin{align*} X_n &= Y_{n+1} - Y_n & \quad &\text{Daily price changes} \\ E[X_n] &= \mu = 0 & \quad &\text{Expected value of } X_n\text{} \\ Var[X_n] &= \sigma^2 = \frac{1}{4} & \quad &\text{Variance of } X_n\text{} \\ Y_1 &= 100 & \quad &\text{Initial stock price} \\ \end{align*}\]
Step 1 Price of one share on the 365th day
\[ Y_{365} = Y_1 + \sum_{n=1}^{364} X_n \]
Step 2 Calculate Mean and Variance of the Sum of 364 intervals
The mean of the sum of \(X_n\) will be:
\[ \mu_{\text{sum}} = \sum_{n=1}^{364} \mu = 364 \times 0 = 0 \]
The variance of the sum of \(X_n\) will be:
\[ \sigma_{\text{sum}}^2 = \sum_{n=1}^{364} \sigma^2 = 364 \times \frac{1}{4} = 91 \]
The standard deviation of the sum is \(\sigma_{\text{sum}} = \sqrt{91}\).
Step 3 Use Z Scores to calculate probabilities for CLT/Normal Distribution
\[ Z = \frac{100 - (100 + \mu_{\text{sum}})}{\sigma_{\text{sum}}} = \frac{0}{\sqrt{91}} = 0 \]
The probability \(P(Y_{365} \geq 100)\) is \(0.5\). A Z-score of 0 corresponds to probability of 50%.
\[ Z = \frac{110 - 100}{\sqrt{91}} \]
The Z-score is 1.048 which corresponds to a probability 0.147 or 14.7%.
\[ Z = \frac{120 - 100}{\sqrt{91}} \]
The Z-score is 2.097 which corresponds to a probability of 0.018 or1.8%.
# Given parameters
mu_sum = 0 # The mean of the sum of daily changes
sigma_sum = sqrt(91) # The standard deviation of the sum of daily changes, sqrt(variance)
Y1 = 100 # The initial stock price
# (a) Calculate the probability that Y365 is at least 100
Z_100 = (100 - Y1) / sigma_sum # Calculate Z-score for Y365 = 100
P_Y365_100 = 1 - pnorm(Z_100) # Calculate the probability using pnorm for the standard normal distribution
# (b) Calculate the probability that Y365 is at least 110
Z_110 = (110 - Y1) / sigma_sum # Calculate Z-score for Y365 = 110
P_Y365_110 = 1 - pnorm(Z_110) # Calculate the probability
# (c) Calculate the probability that Y365 is at least 120
Z_120 = (120 - Y1) / sigma_sum # Calculate Z-score for Y365 = 120
P_Y365_120 = 1 - pnorm(Z_120) # Calculate the probability
# Print the probabilities
print(paste("Probability that Y365 is at least 100:", P_Y365_100))
## [1] "Probability that Y365 is at least 100: 0.5"
## [1] "Probability that Y365 is at least 110: 0.147253696840055"
## [1] "Probability that Y365 is at least 120: 0.0180158431091167"
Calculate the expected value and variance of the binomial distribution using the moment generating function.
The MGF of a binomial distribution, \(M_X(t)\), for a random variable \(X\) indicating the number of successes in \(n\) trials, each with success probability \(p\), is given by:
\[ M_X(t) = (q + pe^t)^n \]
where \(q = 1 - p\) represents the failure probability, and \(t\) is the MGF’s parameter.
Calculate the first derivative for the Expect Value
The expected value \(E[X]\) of a binomial distribution can be obtained by taking the first derivative of the MGF with respect to \(t\) and evaluating it at \(t=0\).
Given the MGF of a binomial distribution \(M_X(t)\) for \(n\) trials each with success probability \(p\) is:
\[ M_X(t) = (1-p + pe^t)^n \\ = (1 - 0.5 + 0.5e^t)^{365} \\ = (0.5 + 0.5e^t)^{365} \]
The first derivative of \(M_X(t)\) with respect to \(t\), evaluated at \(t=0\), provides the expected value.
\[ \frac{d}{dt}M_X(t) = 365 \cdot (0.5 + 0.5e^t)^{364} \cdot (0.5e^t) \]
Evaluating this derivative at \(t=0\) gives:
\[ E[X] = \left. 365 \cdot (0.5 + 0.5e^t)^{364} \cdot (0.5e^t) \right|_{t=0} \\ = 365 \cdot (0.5 + 0.5 \cdot 1)^{364} \cdot 0.5 \cdot 1 \]
Since \(e^0 = 1\), the expression simplifies to:
\[ E[X] = 365 \cdot 0.5 = 182.5 \]
Th expected value \(E[X]\) is 182.5 (days).
#Verify by calculating expected value for binomial distributions
# Define parameters
n <- 365 # Number of trials
p <- 0.5 # Probability of success
# Calculate the expected value based on the binomial distribution's properties
expected_value <- n * p
# Print the expected value
print(expected_value)
## [1] 182.5
Calculate the second derivative of the MGF for the Variance
The variance \(Var(X)\) can be obtained by taking the second derivative of \(M_X(t)\) with respect to \(t\) and then evaluating at \(t=0\), followed by subtracting the square of \(E[X]\).
The second derivative of \(M_X(t)\) with respect to \(t\) is:
\[ \frac{d^2}{dt^2}M_X(t) = 365 \cdot (364) \cdot (0.5 + 0.5e^t)^{363} \cdot (0.5e^t)^2 + 365 \cdot (0.5 + 0.5e^t)^{364} \cdot (0.5e^t) \]
Evaluating this second derivative at \(t=0\) gives us:
\[ E[X^2] = \left. 365 \cdot 364 \cdot (0.5 + 0.5 \cdot 1)^{363} \cdot (0.5 \cdot 1)^2 + 365 \cdot (0.5 + 0.5 \cdot 1)^{364} \cdot 0.5 \cdot 1 \right|_{t=0} \]
Substituting the value of \(E[X] = 182.5\) into the equation:
\[ Var(X) = \left. 365 \cdot 364 \cdot (0.5 + 0.5 \cdot 1)^{363} \cdot (0.5 \cdot 1)^2 + 365 \cdot (0.5 + 0.5 \cdot 1)^{364} \cdot (0.5 \cdot 1) \right|_{t=0} - 182.5^2 \]
Simplifying the expressions:
\[ Var(X) = 365 \cdot 0.5 \cdot (1 - 0.5) = 91.25 \]
The variance \(Var(X)\) is 91.25 (days).
# Parameters
n <- 365 # Number of trials
p <- 0.5 # Probability of success
# Calculate the variance
variance <- n * p * (1 - p)
# Print the variance
print(paste("Variance:", variance))
## [1] "Variance: 91.25"
Calculate the expected value of the exponential distribution using the moment generating function, with variance \(\sigma^2 = 1/4\).
Given the relationship between the variance of the exponential distribution and its rate parameter \(\lambda\), with \(\sigma^2 = 1/\lambda^2\), and given \(\sigma^2 = 1/4\), we find \(\lambda = 2\).
The MGF of an exponential distribution, \(M_X(t)\), for a random variable \(X\) with rate parameter \(\lambda = 2\), is given by:
\[ M_X(t) = \frac{\lambda}{\lambda - t} = \frac{2}{2 - t} \]
for \(t < 2\).
Calculate the First Derivative for the Expected Value
The expected value \(E[X]\) of an exponential distribution can be obtained by taking the first derivative of the MGF with respect to \(t\) and evaluating it at \(t=0\).
Given the MGF of an exponential distribution \(M_X(t)\) with rate \(\lambda = 2\) is:
\[ M_X(t) = \frac{2}{2 - t} \]
The first derivative of \(M_X(t)\) with respect to \(t\), is:
\[ \frac{d}{dt}M_X(t) = \frac{2}{(2 - t)^2} \]
Evaluating this derivative at \(t=0\) gives:
\[ E[X] = \left. \frac{2}{(2 - t)^2} \right|_{t=0} \\ = \frac{2}{2^2} \\ = \frac{1}{2} \]
The expected value \(E[X]\) of the exponential distribution is 0.5.
# Check expected value for exponential distribution
# Lambda
lambda <- 2
# Calculate the expected value for an exponential distribution
expected_value <- 1 / lambda
# Print the expected value
print(expected_value)
## [1] 0.5
Calculate the Second Derivative of the MGF for the Variance
The variance \(Var(X)\) of an exponential distribution can be obtained by taking the second derivative of \(M_X(t)\) with respect to \(t\) and then evaluating it at \(t=0\), followed by subtracting the square of \(E[X]\).
Given the MGF of an exponential distribution \(M_X(t)\) with rate \(\lambda = 2\) is:
\[ M_X(t) = \frac{2}{2 - t} \]
The second derivative of \(M_X(t)\) with respect to \(t\) is:
\[ \frac{d^2}{dt^2}M_X(t) = \frac{2 \cdot 2}{(2 - t)^3} \]
Evaluating this second derivative at \(t=0\) gives:
\[ E[X^2] = \left. \frac{2 \cdot 2}{(2 - t)^3} \right|_{t=0} \\ = \frac{4}{2^3} = \frac{1}{2} \]
Since the expected value \(E[X]\) from the MGF is \(1/2\) for \(\lambda = 2\), to find the variance \(Var(X)\) we use:
\[ Var(X) = E[X^2] - (E[X])^2 \]
Substituting the values:
\[ Var(X) = \frac{1}{2} - \left(\frac{1}{2}\right)^2 \\ = \frac{1}{2} - \frac{1}{4} = \frac{1}{4} \]
The variance \(Var(X)\) of the exponential distribution is 0.25
# Lambda
lambda <- 2
# Calculate the variance for an exponential distribution
variance <- 1 / (lambda^2)
# Print the variance
print(variance)
## [1] 0.25