Solution (source code)

= Solution
{c}

A <replicating strategy> holds $\Delta$ shares and a current cash amount $b$ in the <bank account>. Matching the two next values gives
$$
\Delta S^u_{t+1}+Rb=V^u_{t+1},\qquad
\Delta S^d_{t+1}+Rb=V^d_{t+1}.
$$
Solving this <linear system>,
$$
\Delta=\frac{V^u_{t+1}-V^d_{t+1}}{S^u_{t+1}-S^d_{t+1}},\qquad
b=\frac{S^u_{t+1}V^d_{t+1}-S^d_{t+1}V^u_{t+1}}{R(S^u_{t+1}-S^d_{t+1})}.
$$
By <no-arbitrage>, the claim costs $V_t=\Delta S_t+b$. Collecting the coefficients of its two future values yields
$$
\boxed{V_t=R^{-1}\bigl[qV^u_{t+1}+(1-q)V^d_{t+1}\bigr],\qquad
q=\frac{RS_t-S^d_{t+1}}{S^u_{t+1}-S^d_{t+1}}.}
$$
The physical <probability> $p$ does not appear: replication fixes the price of this <contingent claim> from traded prices.