%% Creates Binomial Tree with specific market parameters
%BinomialStock(p,alpha,sigma,s,T,N)
[Q,S]=BinomialStock(0.5,0.01,0.2,10,1/12,5);
%% Price of European derivative
%BinomialEuropean(Q,S,r,g)
g=@(x)max(x-10,0);
PE=BinomialEuropean(Q,S,0.01,g)
%% Price of American derivative
%BinomialAmerican(Q,S,r,g)
g=@(x)max(10-x,0);
[PA,C]=BinomialAmerican(Q,S,0.01,g)