Solution (source code)

= Solution

Use discrete dates $j=0,\ldots,N$, a <bank account> $B_j=R^j$ with $R=1+r>0$, and a positive stock with each one-period gross return either $u$ or $d$, where $0<d<u$. On the natural tree assume both moves have positive physical probability. The <Cox--Ross--Rubinstein model> is arbitrage-free precisely when
$$
\boxed{d<R<u.}
$$
Otherwise a stock/bank position gives nonnegative profit in both states and positive profit in at least one. Under the condition, the unique <equivalent martingale measure> has independent upward moves with <conditional probability>
$$
\boxed{q=\frac{R-d}{u-d}\in(0,1).}
$$
Indeed $qu+(1-q)d=R$, making the discounted stock a <martingale>. Both branches have positive probability under this <measure>, ensuring equivalence. The uniqueness/completeness claim is for the stock-generated binomial tree; an enlarged filtration carrying additional untraded risk would change that claim.