Modeling European Options: A simulation
study

Aishwarya B U (1PE10CS006)
Mohammed Saaqib A (1PE10CS053)
Rajashree H R (1PE10CS074)
Vigasini B (1PE10CS111)
Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

1. Title:
Modeling European Options: A simulation study

2. Abstract:
Option contracts can be valued by using the Black-Scholes equation, a partial
differential equation with initial conditions. An exact solution for European
style options is known. The computation time and the error need to be
minimized simultaneously. In this paper, the authors have solved the BlackScholes equation by employing a reasonably accurate implicit method. Options
with known analytic solutions have been evaluated. Furthermore, an overall
second order accurate space and time discretization has been accomplished in
this paper.
2.1 Keywords: Computational finance, implicit methods, finite differences,
call/put options.

3. Background Study and Survey:
3.1 The Black-Scholes Equation:
3.1.1Assumptions:
The fundamental assumption made about the random movement of asset
prices for a more flexible hypothesis.
► We assume that present price is a full reflection of the past history
experienced. And does not contain any more information;
► We assume that we would obtain immediate response for updated
information about an asset.
3.1.2 Model:
Asset price modeling identifies modeling the arrival of new information
which affects the price of an asset. Absolute change in an asset is a relative
measurement of the change in price. This is a better indicator of its size
aspect than absolute measures.
Let’s consider that at time t , the asset price is S . Let us consider a small
subsequent time interval dt , during which S changes to S  dS . Now, there is
deterministic and anticipated return represented by dt , where  is known as
drift. The other factor affecting the asset price is the random change in the asset
Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

price in response to external effects. It is represented by a random sample drawn
from a normal distribution with mean zero denoted as dX ,
Putting the above two factors together we obtain a stochastic differential
equation,
dS
 dX  dt ,
S

(1)

which is the mathematical representation for generating asset prices[1,4].
The equation (1) gives interesting and important information concerning the
behavior of S in a probabilistic sense. At time t  t ' , suppose the price is S ' , and
then S ' will be distributed about S 0 with a probability density function. The
future asset price S ' is thus most likely to be close to S 0 and less likely to be far
away. Thus, the equation generates time series – each time the series is restarted
a different path results. Each path is called a realization of the random walk.
The Black-Scholes Partial Differential Equation, the derivation of which is
well-known, is given below
V 1 2 2  2V
V
  S
 rS
 rV  0
2
t 2
S
S

(2)

If S  E at expiry, then in financial sense, for call option, there will be profit
S  E , handing over an amount E , to obtain an asset worth, while, if S  E , then
there will be loss of E  S . Thus the value of the call option at expiry can be
written as
C S , T   max S  E,0
(3)
As the time tends to expiry date the value of call option approaches (6), it is
known as pay-off function for European Call Option. This is known as the final
condition of PDE (12).
Now, from (1), if S  0 then dS  0 which means pay-off is also zero. Thus, the
call option is worthless on S  0 even if there is long time to expiry. Hence, we
have
C 0, t   0
(4)
And if S   i.e. the asset price increases without bound it becomes ever more
likely that the option will be exercised and the magnitude of the exercise price
becomes less and less important. Thus as S   the value of the option becomes
that of the asset and so
C S , t  ~ S as S  
(5)

Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

Thus, the Black Scholes equation and boundary condition for a European Call
Option is given by equations (2)-(5).
For European Put Option, the final condition is the payoff
PS , T   max E  S ,0

(6)

And the initial condition P0, t  is determined by calculating the present value of
an amount E received at time T . For time-dependent interest rate, the boundary
condition at S  0 is
T

P0, t   Ee

 r T dT


t

(7)

And,
PS , T   0 as S  

(8)

Thus, the Black Scholes equation and boundary conditions for a European Put
Option are given by equations (2), (6)-(8).
The analytical solution to the BSDE is not the focal point of the paper but given
below, nonetheless as [2]
(9)
C S , t   SN d   Ee   N d 
 r T t

1

2

where
1


log S E    r   2 T  t 
2


d1 
 T t
1


log S E    r   2 T  t 
2


d2 
 T t









The corresponding calculation for a European Call Option follows similar lines.
3.2 Analytical Solution:
V 1 2 2  2V
V
  S
 rS
 rV  0
2
t 2
S
S

with initial condition

C S , T   max S  E,0
C 0, t   0

and boundary condition
C S , t  ~ S as S  
Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

For European Call Option, suppose
S  Ee x , t  T  

1 2
 , C  E x, 
2

(i)

V  & S  x

Then the Black-Scholes Partial Differential Equation results in
  2

 2  k  1
 k
 x
x

Where k  r

(ii)

1 2
 . So, the initial condition changes to
2

 x,0  max e x  1,0

Using the method of change of variable, we construct
  ex  ux,  ,

for some constants  and  , subsequent differentiation yields

u
 ex  
 ex   u x, 



u
 ex  
 ex   u x, 


2
2

 u
u
u
 ex   2  ex  
  2 ex   u  ex  
2
x
x
x
x
2
2

u
 u
  2 ex   u  2ex  
 ex   2
2
x
x
x
2
u 
u  u 
u 


x    2
 u  2
ex    u 
 2   k  1ex   u    kuex  
e
 
x x 
x 




Since, ex   0
u 

u
u  2 u
u 

  2 u  2
 2  k  1u    ku

x x
x 


Choose    2  k  1  k and 0  2  k  1 , so that the PDE assumes the
standard parabolic form

Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

    k  1  k u  u  
2

2

u  2  k  1

u  2 u

;  x  ,  0
x x 2

u
should vanish and so we have,
x
1
   k  12
4

The argument follows from the fact that u &
 

1
k  1 ,
2

Therefore,
 e



1
k 1 x  1 k 12 
2
4

ux, 

Where
u  2 u
;    x  ,  0,

 x 2

with
1
k 1x  
 1 k 1x
u x,0  u 0 x   max  e 2
 e2
,0 



(iii)

This is in-fact, the pay-off function for the BS Differential equation.
Let’s denote the Fourier transform of ux,  by
u  x,   

1
2 



 ux, e

ix 2

dx



and assume u 0 x  has a Fourier transform and u ,

u
vanish at  so that the
x

following results might be used
1
2




 f x e dx   i  F   ; n  1,2,3,........
n

i x

n

(iv)



Multiplying equation (ii), throughout by

1 ix
e and integrating w.r.t. x from
2

  to  and using equation (iv), we obtain

1
2



 u e

ix

dx  2 u  ,   2 u  ,   2 u x, t   0

(v)



Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

and equation (iii) leads to
u  ,0  F   



1
2

e

ix

u 0 x dx



The solution to the Initial Value Problem is
u ,   F  e  
2

To find ux,  , apply inverse Fourier Transform and thus we obtain;
u x,  



1
2

1



2

e

ix 2


 

 e

F  d

i  x  s 2

u 0 s d ds

(vi)



Next, evaluate the inner integral,




0

i  x  s  
d   e i  x  s   d   e i  x  s   d
e
2

2



2



0



 2 e   cos x  s d
2

0

The last integral can be evaluated explicitly. Let the integral I   be defined as


I     x  s  2 e   cos d ;
2

0

Note that the integrand is exponentially decaying and hence bounded above.
Differentiating under the integral sign,
2
2
dI  
1
 2 e   sin  d   sin  d e  
d
0
0

  I  
2





 

and


I 0  2 e   d   
2

0




Combining,
Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7



I     x  s  2 e   cos x  s d
2

0

  xs 

e


2

(vii)

4x

Using equation (vii)
u x,  



 u0 s e

1
4

 u x,  

 x  s 

2

4

ds





1
2 

 u s e

 x  s 

2

4

0

(viii)

ds



where u 0 x  is given by equation (iii). Again using the change of variable,
x'  s  x 

2

we have,
u  x,   





1



 u0 x' 2  x e

2  
ux,   I1  I 2

1
 x '2
2

dx'

where
I1 



1
2 

x

 I1  e

e





1
 k 1 x  x ' 2  1 x '2
2
2

dx'

2

1
k 1 x  1  K 12 
2
4

N d1 

where
d1 

x
2



1
k  1 2
2

and
N d1  

1
2

d1

e

1
 s2
2

ds



is the cumulative distribution function for the normal distribution. The
calculation of I 2 is identical to that of I 1 except that k  1 is replaced by k  1
throughout.
Now, substituting from equation (i) to recover
C S , t   SN d1   Ee  r T t  N d 2 

(ix)

where

Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

1 

log S E    r   2 T  t 
2 

d1 
 T t





1 

log S E    r   2 T  t 
2 

d2 
 T t





The corresponding calculation for a European Put Option follows similar lines.
Its transformed pay-off is
1
k 1 x 
 12 k 1z
u x,0  max  e
 e2
,0 



(x)

and can be computed as above. However, having evaluated the Call, a simpler
way is to use the put-call parity formula
C  P  S  Ee  r T t 

for the value P of a Put, given the value of the Call. This yields
PS , T   Ee  r T t  N  d 2   SN  d1 

4. Software Requirement Specification:
4.1 Definitions/Terminologies:
Writer: The person selling the asset.
Holder: The person buying the asset.
Expiry Date: At a prescribed time in the future, the holder/writer of the
option may purchase/sell a prescribed asset.
Underlying Asset: The holder/writer may purchase/sell a prescribed asset at
a prescribed time.
Exercise Amount/Strike Price: The holder/writer purchases a prescribed
asset at a prescribed time at a prescribed amount.
Arbitrage: In financial terms, there are never any opportunities to make an
instantaneous risk-free profit.

Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

Risk: Risk is commonly of two types – specific and non-specific, specific
risk is the component of risk associated with a single asset, whereas nonspecific risk is associated with factors affecting the whole market.
4.2 Notation table:
t - Time

- Value of the asset at t 0  t
S - Asset Price
E - Exercise Price
d * - Change in any quantity over a time interval
 - Measure of the average rate of growth of the asset price
 - Volatility, measures the standard deviation of the returns
dX - Random variable, drawn from a normal distribution
 - A random variable from a standardized normal distribution
F * - Function
r - Risk-free interest rate
V - Value of an option, a function of S and t
C - Call Option function
P - Put Option function

S

0

4.3 Hardware and Software Requirements
A simple computer with the following hardware and software features.
►Intel Pentium 4 or more.
►RAM speed of 512 MB or more.
►1.5 GHz or faster processor.
An interactive development environment (IDE) such as CodeBlocks for
building, compiling and executing the C language code.
4.3.1 User Interfaces: HTML 5.0 CGI platform
4.3.2 Operating System: Windows platform, Linux and Vista OS
4.3.3 Memory Constraints: Minimum memory requirements with RAM or
secondary memory of about 1GB.
4.3.4 Software System Attributes
Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

Reliability: This implementation is based on the Black-Scholes and Crank
Nicolson’s Equations; it is mathematically sound with no error included during
coding. This does not slow down the system or does not cause any harm to the
environment.
Availability: This software is built with a simple user interface and easily
available resources.
Portability: Since this product uses platform independent HTML and C codes, it
is portable.

5. Design:
5.1 Algorithm:
Finite Difference methods to solve the Black-Scholes PDE equation.
Input: Call/Put option (opt), Agreed Exercise money (E), Continuously
compounded Interest rate(r), Expiry date (T).
Output: 3D shaded surface plot
step1: start
step2: read opt to find the type of option (0-call,1-put)
read E
read r
read T
for i=1 to 5 do
begin
for j=1 to 5 do
begin
a[i][j]=rand();
end
end
for i=1 to 5 do
begin
for j=1 to 5 do
begin
sig[i][j]=a[i][j]
Assign integer 11 to Nx
Assign integer 29 to Nt
Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

Assign integer 10 to L
Call the CrankNicholsonMethod function and pass the
parameters- opt , E ,sig[i][j], r, T, Nx, Nt ,L
Assign the value returned to u2
Call the surf function by passin the parameter u2 to
plot 3d shaded surface plot
end
end
read xlabel, ylabel, zlabel
Step 3: Stop
Crank Nicholson Method
Pricing a European option using the Crank-Nicolson method on the BlackScholes PDE
Input:
Output:
Step1: start
Step 2: initialize function [U] =
CrankNicholsonMethod (type,k,sigma2,T,N,M,Xmax)
Assign T/N to fdeltat
Assign Xmax/M to deltaX
X and U are empty matrices
Assign temp to an array of all zeroes
for i = 1 to M+1 do
begin
use U to compute the pay off matrix
if type = 0
for j = 2 to N+1 do
begin
U[1,j]=0
U[M+1,j] = Xmax - K*exp(-r*((j-1)*deltat))
end
else
for j = 2 to N+1 do
begin
U[1,j] = K
U[M+1,j]= 0
end
end
compute the matrices and diagonalize
Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

for j = 1 to N do
begin
matrixB = U[:,j]
matrixC[1,1] = temp[1,1]*U[1,j+1]
matrixC[M-1,1] = temp[M-1,M+1]*U[M+1,j+1]
known = matrixA*matrixB - matrixC
Assign U_jplus1 with zeroes from [M-1,1]
U_jplus1 = inverse of matrixD*known
for k = 1 to M-1 do
begin
U[k+1,j+1]= U_jplus1[k,1]
end
end
Assign to y the return value of the function payoff that takes type, z, K as
the arguments
if type = 0
Assign to y maximum value between z-K and 0, which symbolizes
the call option
else
Assign to y maximum value between K-z and 0, which symbolizes
the put option
Step3: stop
5.2 Control Flow Diagram:

Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

5.2.1 Call Option:

5.2.2 Put Option:

6. Bibliography:
[1] Snehanshu Saha, Swati Routh, Bidisha Goswami; Modelling Vanilla Option
Prices: A Simulation Study by an Implicit Method—J. Advances in
Mathematics, Vol 6, #1, pp 834-848
[2] Black, Fischer; Scholes, Myron, "The Pricing of Options and Corporate
Liabilities”, Journal of Political Economy 81, No. 3 (May-June 1973), pp. 637654.
Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

[3] Merton, R. (1973). ‘Theory of Rational Option Pricing’, The Bell Journal of
Economics and Management Science 4, No. 1(Spring 1973), pp. 141-183.
[4] Hull, J.C. (2005), Options, Futures, and Other Derivative Securities,
Prentice Hall Int. Inc., London, 1989.
[5] Black, F., (1989), How We Came Up with the Option Formula, The Journal
of Portfolio Management, 15, 4-8.

Dept. of CSE, PES Institute of technology, Bangalore South Campus

Group-7

