The Black-Scholes model yields the price of options (whether put or call options). The theory behind Black-Scholes model is quite complex. We have to deal with stochastic calculus and Ito’s integral. The solution of the Black-Scholes differential equation on the other hand is not that hard. We can implement it in Python with a few lines of codes. In this article we will discuss how to end up with the option price with simulation.

We know that the underlying asset (stock in this case) follows a Wiener-process.

**dS(t) = μ S(t) dt + σ S(t) dW**

We can obtain the log S(t) because we know for certain that stock prices can not be negative. So let’s use Ito’s lemma with F(S) = log S(t):

**d log S(t) = (μ-½σ ^{2})dt + σdW**

What is a Wiener-process W(t)? It is a random walk with mean 0 and variance t, so we use N(0,t) normal distribution. It can be rewritten as √t N(0,1) which is the standard normal distribution. So the solution of this stochastic differential equation is something like the exponential function.

**S(T) = S(0) exp [(μ-½σ ^{2})T + σ √T N(0,1) ]**

OK this is the formula we have to use during simulation: we know this equation defines the behaviour of stock prices. In the **Monte-Carlo simulation**:

- ) we have to generate a large amount (~10 000) of stock price estimates according to the S(T) equation above
- ) we have to use payoff-functions: for a call-option it is
**max(S-E,0)**. Because options are just the right to buy or sell a given option: we can make a profit of S-E (E is the strike price) or we do not buy the option (call option is the right to buy, put option is the right to sell) - ) we have to calculate the expected value: which is the average basically
- ) we have to use discount factor because of the time value of money (we want to calculate the present value of a future cash flow)

**QUANTITATIVE FINANCE COURSE!**