Probablity 9, 10, pg. 363

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

Given Xn = Yn+1 - Yn, rewrite the formula: Yn+1 = Xn + Yn, Y365 = X354 + Y364; Y365 = X354 + X363 + X362 + … X1 + Y1 Y1 = 100

# add set for random numbers
set.seed(124)
over100 <- 0
over110 <- 0
over120 <- 0

#for 200 times testing
#mean = 0
#sd = sqrt(0.25)
for(n in 1:200 ) {
  
  s354 <- rnorm(354,0,sqrt(0.25))

  #check if Y365 = X354 + X363 + X362 + ... X1 + Y1  >= 100?
  if( (sum(s354) + 100) >= 100 )
  {
    #for Y365 >= 100, count 1
    over100 <- over100 + 1  
  }
  
  #check if Y365 = X354 + X363 + X362 + ... X1 + Y1  >= 110?
  if( (sum(s354) + 100) >= 110 )
  {
    #for Y365 >= 110, count 1
    over110 <- over110 + 1  
  }
  
  #check if Y365 = X354 + X363 + X362 + ... X1 + Y1  >= 120?
  if( (sum(s354) + 100) >= 120 )
  {
    #for Y365 >= 120, count 1
    over120 <- over120 + 1  
  }
  

}

paste("a) P(Y365 >= 100) ", over100/200.0)
## [1] "a) P(Y365 >= 100)  0.485"
paste("b) P(Y365 >= 110) ", over110/200.0)
## [1] "b) P(Y365 >= 110)  0.14"
paste("c) P(Y365 >= 120) ", over120/200.0)
## [1] "c) P(Y365 >= 120)  0.01"