1) (20 points) Many people believe that the daily change of price of a company's stock on the stock market
is a random variable with mean 0 and variance $\sigma^2$. That is, if $Y_n$ represents the price of the stock on
the $n$th day, then
$$Y_n = Y_{n-1} + X_n \quad n \ge 1$$
where $X_1, X_2,...$ are independent and identically distributed random variables with mean 0 and variance
$\sigma^2$. Suppose that the stock's price today is 100 and assume $\sigma^2 = 1$.
(a) Plot 20 different trajectories of the stock prices over the next 10 days. You may use MATLAB's
randn or Python's numpy.random.randn to generate normal random numbers.
(b) Using Monte Carlo, estimate the probability that the stock's price will exceed 105 after 10 days.
Report the results using 10, 100, and 500 samples.
Hint: Let $X = Y_{10} = Y_0 + \sum_{i=1}^{10} X_i$. Use the fact that $P(X \ge 105) = E[I_{X \ge 105}]$, where $I_{X \ge 105}$ is
an indicator random variable
$$I_{X \ge 105} = \begin{cases} 1 & X \ge 105 \\ 0 & \text{otherwise} \end{cases}$$
(c) Compute this probability analytically. You can use the fact that if $X_i$'s are independent normal
random variables with mean $\mu$ and variance $\sigma^2$, then $\sum_{i=1}^{n} X_i$ is also a normal random variable
with mean $n\mu$ and variance $n\sigma^2$.