Assume that, in one day, a stock price can go up by 1 point with probability 0.4, or down by 1 point with probability 0.3; the price can also remain the same. After 40 days, what is the probability that the stock price increases by more than 6.5 points?
First , lest us start by defining the pmf:-
P(X =+1 ) = 0.4
P(X=0) = 0.3
P(X=-1) =0.3 , Where x is the increment
This problem will be very difficult to do by hand so I use R(simulation) to do the same.Here is the code.
s <- c(1,0,-1) # points of increment
p <- c(0.4,0.3,0.3) # their respective probabilities
d <- c() #an empty vector where we store the total increment
over 40 days
for (i in 1:1000) { # simulate 1000 times
z <- sample(s,40,replace = T,prob = p) #sample from the above
pmf for each day 40 times
d[i] <- sum(z) #each element save the total increase over 40
days
}
sum(d>6.5)/1000 # proportion of instances satisying the conndition
0.321 is the answer
Get Answers For Free
Most questions answered within 1 hours.