# Pricing of European put option with binomial model

This is an exercise from Mark Joshi's book (exercise 3.6):

A stock is worth 100. Each month its value increases or decreases by precisely 10. The riskless bond is worth $$e^{rt}$$ at time t years with r equal to 5% Price a four-month European put option struck at 110.

At the end of the book, Joshi provides the solution 13.06. Unfortunately that's not what I find: I get 15.22. Since Joshi does not show his computation, I am wondering where the difference comes from. I use the following Python script for the computation:

import math

def get_risk_neutral_prob(S, S1, S2, r, delta_t):
Sp = max(S1, S2)
Sm = min(S1,S2)
if Sm == Sp:
return 1/2
return (math.exp(-r*delta_t) * S - Sm)/(Sp-Sm)

def payoff(S):
return max(110-S, 0)
r = 0.05
delta_t = 1/12

def get_price(S, N):
if N == 0:
return payoff(S)
S1 = S+10
S2 = S-10
p = get_risk_neutral_prob(S, S1, S2, r, delta_t)
return math.exp(-r*delta_t) * (p * get_price(S1, N-1) + (1-p) * get_price(S2,N-1))

print(get_price(100,4))


As you can see, my computation is straightforward. I first compute the risk-neutral probability, and then the discounted expected value of the payoff, recursively.

For one month, I did it by hand and my result, 10.372, agrees with what the script tells me.

• You have a bug in your script - the function get_risk_neutral_prob should return (math.exp(r*delta_t) * S - Sm)/(Sp-Sm) instead. You have an extra minus sign. – Chris Taylor Sep 2 '19 at 16:38
• Indeed, thank you very much! – user11823918 Sep 3 '19 at 5:58

## 2 Answers

Answer was provided by Chris Taylor: the formula for the risk-neutral probability was off by a minus sign, it should be $$p = \frac{e^{r \Delta t} S - S_m}{S_p - S_m}$$

I cannot comment (low reputation) so I add an answer. In Python, you should write:

delta_t = 1.0/12