Margulis–Russo formula (source code)

= Margulis–Russo formula
{c}
{wiki}

For an increasing <Boolean function> $f:\{0,1\}^n\to\{0,1\}$ and <independent> <Bernoulli distribution> input bits of <probability> $p$, define $I_i^{(p)}(f)$ as the <probability> that coordinate $i$ is <pivotal for an increasing event>. Then, for $0<p<1$,
$$
\frac{d}{dp}\mathbb E_p f=\sum_{i=1}^n I_i^{(p)}(f).
$$
To prove it, first give each coordinate its own parameter $p_i$. Conditioning on all other coordinates makes the expectation affine in $p_i$, with <partial derivative> equal to the expected difference between the values with bit $i$ fixed to one and zero. Monotonicity makes that difference the pivotal indicator. The <chain rule> along $p_1=\cdots=p_n=p$ yields the formula.<Analysis of Boolean Functions by Ryan O'Donnell>[Section 8.4, equations (8.8)–(8.9), printed pp. 224–225]{ref}

For example, an AND of $n$ input bits has expectation $p^n$ and each pivotal <probability> is $p^{n-1}$. In the sign-coordinate <p-biased product measure>, $p$ instead denotes the mass at minus one: identify the increasing bit as $(1-x_i)/2$. Keeping an increasing <function> of the ordered signs themselves reverses the <derivative>'s sign. Biased squared-derivative definitions of <total influence> also require their stated normalization.