# 金融编程代写 | Pstat 160B Programming Assignment 3

Instructions:

• You can use either R or Python. I strongly suggest you to use notebooks (either R Markdown or Jupyter).

• The code must be annotated. Show your results and make your conclusion. • Submit these files on Gauchospace:

– pdf file, which should contain annotated code, results, graphics (if any) , conclusion.
– source file (.ipynb, .Rmd, .py or .R) in case we need to rerun your code. Therefore

clearly state the seed you’re using for your simulations.
The problems below are due Sunday February 24th at 11:59pm.

1. (Dobrow, Problem 8.41) The price of a stock is modeled as a geometric Brownian motion with drift μ = −0.85 and variance σ2 = 2.4. If the current price is \$50, find the probability that the price is under \$40 in 2 years. Simulate the stock price, and compare with the exact value.
2. (Sarantsev, Problem 21.24) Find an empirical fair price of a barrier option which pays \$1 if the price of a stock at some time until maturity T = 2.5 exceeds K = 2, if the initial price is S0 = 1.4, and the volatility is σ = 0.4. Use step size 0.01 and 1000 simulations. E-mail: [email protected]  微信:itcsdx 