Problem 27.4

Define basic functions, including the cumulative normal distribution function, the formulae for (Subscript[d, 1]) and (Subscript[d, 2]), and the Black-Scholes formula for European call and put options.

St=.;delta=.;T=.;t=.;sigma=.;r=.; K=.;

CNorm[d_]:=CDF[NormalDistribution[0,1],d];

d1=(Log[St/K]+(r-delta+0.5*sigma^2)*(T-t))/(sigma*Sqrt[T-t]);

d2 = d1-sigma*Sqrt[T-t];

BSCall = St*Exp[-delta*(T-t)]*CNorm[d1]-K*Exp[-r*(T-t)]*CNorm[d2];

BSPut = K*Exp[-r*(T-t)]*CNorm[-d2]-St*Exp[-delta*(T-t)]*CNorm[-d1];

t=0.;
K=35.;
St=40;
T=1.;
r=.1;
delta=.02;
sigma=.3;

Print["The value of (Subscript[d, 1]) is "<>ToString[d1]<>".\nThe value of (Subscript[d, 2]) is "<>ToString[d2]<>".\n\nThe value of N((Subscript[d, 1])) is "<>ToString[CNorm[d1]]<>".\nThe value of N((Subscript[d, 2])) is "<>ToString[CNorm[d2]]<>".\n\nThe value of the call  is $"<>ToString[BSCall]<>" and the value of the put is $"<>ToString[BSPut]<>"." ]