
% simulates one week of stock prices and values an option on SP500 
t1=cputime;
ST=[];
	
for i=1:1000 ;
	
S=simulateBS(1432.25,.03,7/252,.195,20);
	
ST=[ST S(length(S))];
	
end;
disp('1000 simulations of whole path, S&P option value=')
	
   mean(exp(-.03*7/252)*max((ST-1425),0))  
   t1=[t1 cputime];
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  *********
   disp('100,000 simulations of terminal value, S&P option')
	r=.03 ; sigma=.195;  T=7/252 ;   S0=1432.25; 
ST=S0*exp(normrnd((r-.5*sigma^2)*T,sigma*sqrt(T),1,100000));
mean(exp(-.03*7/252)*max((ST-1425),0))
t1=[t1 cputime];
display(['times ' mat2str(diff(t1))])

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

