1. The daily log returns on a stock are independent and normally distributed with mean 0.001 and standard deviation 0.015. Suppose you buy $1000 worth of this stock.
niter = 1e5
proba = rep(0,niter)
probb = rep(0,niter)
for (i in 1:niter)
  {
    r = rnorm(5,.001,.015)
    logPrice = log(1000) + cumsum(r)
    proba[i] = as.numeric(logPrice[1]<log(990))
    probb[i] = as.numeric(logPrice[5]<log(990))
    
  }
  1. What is the probability that after one trading day your investment is worth less than $990? (Note: The R function pnorm will compute a normal CDF, so, for example, pnorm(0.3,mean=0.1,sd=0.2) is the normal CDF with mean 0.1 and standard deviation 0.2 evaluated at 0.3.)
mean(proba)
## [1] 0.23088

Also the same problem(a) can be solved as P(x< 990). Given, the daily log returns as normal iid. so, log(Pf/P0) as x log(990/1000) = -0.01005034 P(x<-0.01005034) = cdf(-.01005034) = pnorm(-0.01005034,.001,.015)

pnorm(log(990/1000),.001,.015)
## [1] 0.2306557
  1. What is the probability that after 5 trading days your investment is worth less than $990?
mean(probb)
## [1] 0.3273