Solution (source code)

= Solution

A site $v$ is <pivotal for an increasing event> $E_N$ in a configuration $\omega$ when changing only the state of $v$ changes whether $E_N$ occurs. Away from the boundary, pivotality for a left-to-right crossing has the geometric four-arm description: from neighbors of $v$ there are two disjoint open arms reaching the left and right sides and two disjoint closed arms reaching the top and bottom sides, in alternating cyclic order. The boundary version truncates the corresponding arms at the sides already adjacent to $v$.

The <Margulis–Russo formula> gives
$$
\frac d{dp}\mathbb P_p(E_N)
=\sum_{v\in W_N}\mathbb P_p(v\text{ is pivotal})
=\mathbb E_p[N_{\mathrm{piv}}(E_N)].
$$