Where the Tree Settles
A volatility-driven binomial tree prices a call at a number that swings around the closed form and approaches it as the steps grow; the Black-Scholes closed form is that number in one call.
The question
The earlier tree books used a two-step tree with an up factor of 1.2, a down factor of 0.9 and 5% simple interest per step; it priced a call at 10.20. That is another model with other inputs. This book keeps one example: spot 100, strike 105, a continuously compounded rate of 5% (the "risk-free rate" is the name of a model input), no dividend, volatility 20% and one year. All four are made-up inputs.
A tree whose factors come from the volatility and the step length gives a price. What happens to that price when the steps get shorter and there are more of them?
Work it by hand
Take a tree of two steps of half a year each. The engine's Cox-Ross-Rubinstein tree has an up factor e to the power of volatility times the square root of the step, here 1.1519, and a down factor equal to 1 divided by that, 0.8681.
The engine's probability of an up move is 0.5 plus 0.5 times (rate minus half the volatility squared) times the square root of the step, divided by the volatility: 0.5530 (a textbook version, (e to the power of rate times step, minus the down factor) divided by (up minus down), gives 0.5539 and another price).
Only the top node is above the strike: 100 times 1.1519 twice is 132.69, a payoff of 27.69. It is reached with probability 0.5530 times 0.5530. Discounting for a year at 5% gives 27.68964 times 0.305846 times 0.951229 = 8.0557. Two steps give 8.06.
Run it
The program prices the call on trees of 4, 8, 12 and so on up to 256 steps, 64 trees in all, and on the closed form. Line 2 builds the call and line 3 prices it with pricing.analytic(), the closed form. The loop of lines 5 to 10 builds the tree engine with pricing.binomial_tree("crr", n) for each step count and prices the call on it.
The picture draws the tree prices against the number of steps, with the closed form as a flat line. Line 14 returns the closed-form price as text.

let m = model.black_scholes(spot, rate, 0.0, vol);
let call = instrument.european_call(strike, float(years));
let exact = pricing.price(call, m, pricing.analytic()).price();
let steps = float_list(); let tree = float_list(); let flat = float_list();
for (k in range(0, 64)) {
let n = 4 * (k + 1);
let engine = pricing.binomial_tree("crr", n);
let p = pricing.price(call, m, engine).price();
steps.add(float(n)); tree.add(lmf.round(p, 4)); flat.add(lmf.round(exact, 4));
}
lmcode_return_put("steps", steps);
lmcode_return_put("tree", tree);
lmcode_return_put("closed", flat);
let answer = lmf.money(exact);
{
"answer": "8.02",
"steps": [
4,
8,
12,
16,
20,
24,
28,
32,
36,
40,
44,
48,
52,
56,
60,
64,
68,
72,
76,
80,
84,
88,
92,
96,
100,
104,
108,
112,
116,
120,
124,
128,
132,
136,
140,
144,
148,
152,
156,
160,
164,
168,
172,
176,
180,
184,
188,
192,
196,
200,
204,
208,
212,
216,
220,
224,
228,
232,
236,
240,
244,
248,
252,
256
],
"tree": [
8.1918,
8.1871,
8.1552,
8.1272,
8.1043,
8.0854,
8.0695,
8.056,
8.0443,
8.0341,
8.025,
8.0169,
8.0096,
8.003,
7.997,
7.9915,
7.9891,
7.997,
8.0037,
8.0092,
8.0138,
8.0176,
8.0208,
8.0235,
8.0257,
8.0275,
8.029,
8.0302,
8.0311,
8.0318,
8.0323,
8.0327,
8.0329,
8.033,
8.033,
8.0329,
8.0327,
8.0324,
8.0321,
8.0317,
8.0312,
8.0307,
8.0302,
8.0296,
8.029,
8.0284,
8.0278,
8.0271,
8.0264,
8.0257,
8.025,
8.0243,
8.0236,
8.0228,
8.0221,
8.0213,
8.0206,
8.0198,
8.0191,
8.0183,
8.0176,
8.0168,
8.016,
8.0153
],
"closed": [
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214,
8.0214
]
}The tree price does not climb to the closed form: it swings around it. It is 8.1918 with 4 steps, falls to 7.9891 at 68 steps, peaks at 8.033 at 136 steps and is 8.0153 at 256 steps, against 8.0214 for the closed form.
You can change the four inputs and the years, a whole number of 1 or more. A volatility of 0 stops line 1 with "model.black_scholes: volatility must be positive" and a spot of 0 with "model.black_scholes: spot must be positive". A strike of 0 stops line 2 with "option strike must be positive", and so do 0 years with "option maturity must be positive".
A rate that is large against the volatility (0.3 with a volatility of 0.05) or a volatility that is very small or very large (0.001 or 5 with a rate of 0.05) makes the up probability of a tree leave the range 0 to 1 and stops line 8 with "negative probability".
Your turn
The program below is meant to return the Black-Scholes price of the call, in whole cents, for spot, strike, rate, vol and years. Decide whether it does, and find the candidates that do. Check runs each candidate on the data shown and on four others. Each answer is rounded to cents, because binary floats rarely give a price exactly.

let m = model.black_scholes(spot, rate, 0.0, vol);
let call = instrument.european_call(strike, float(years));
let price = pricing.price(call, m, pricing.binomial_tree("crr", 2)).price();
let answer = int(math_round(lmf.round(price, 2) * 100.0));
{
"answer": 767
}Return the Black-Scholes price of the European call, in whole cents: one constant volatility and one constant rate, continuously compounded, no dividend, exercise at expiry. The price is rounded to cents.
Read the result carefully
The tree and the formula are one model at two step sizes: one constant volatility and one constant rate for the whole year, no dividends, exercise at the end only, and trading without costs. That they agree says nothing about agreeing with a market, where volatility is not constant and cannot be read off.
The number of steps changes the tree's price in the cents, as the picture shows. The four inputs of this lesson are made up. The page describes a model and is not investment advice.
Recap
- A tree driven by volatility prices the call near a number that it approaches as the steps grow.
- The closed form is that number, and
pricing.analytic()gives it in one call. - Prices are compared in whole cents, because binary floats rarely give a price exactly.
- The model has one volatility and one rate for the whole year.