#C11.txt, Feb. 26, 2015, starting Finance Help:=proc(): print(`Arbi(S0,K,r,Sd,Su,T,P,x1,x2)`): end: #Arbi(S0,K,r,Sd,Su,T,P,x1,x2): Inputs #S0: the current price of the stock #K the strike price, the buyer has the OPTION #to by the stock at time T, paying K dollars, Sdarbitrage), #nd false otherwise. It also returns, in the former case, the amount of #profit in each case (Sd and Su respecticely, where the option was not and was excercised respectively) Arbi:=proc(S0,K,r,Sd,Su,T,P,x1,x2) local CV,FVd,FVu,Gd,Gu: CV:=x1+x2*S0: if CV>P then print(`Shame on you, you should not exceed your budget`): RETURN(FAIL): fi: FVd:=x1*exp(r*T)+x2*Sd: FVu:=x1*exp(r*T)+x2*Su: #if the price of the stock is Sd, then the option is not excercised Gd:=FVd: #if the price of the stock is Su, then the option execrcised Gu:=FVu+K-Su: if (Gd>0 and Gu>=0) or (Gd>=0 and Gu>0) then true,[Gd,Gu]: else false: fi: end: #Eco(S0,K,r,Sd,Su,T,P): Inputs #S0: the current price of the stock #K the strike price, the buyer has the OPTION #to by the stock at time T, paying K dollars, Sd