Total influence (source code)

= Total influence
{title2=$\mathbf I(f)$}

The total influence is
$$
\mathbf I(f)=\sum_i\operatorname{Inf}_i(f)
=\sum_{S\subseteq[n]}|S|\widehat f(S)^2.
$$
This <Fourier-Walsh transform> identity uses $\{-1,1\}$-valued $f$ and the flip-probability convention for <influence of a variable>. For $\{0,1\}$-valued $f$, the right-hand side is multiplied by four. Indeed <Parseval's identity> applied to the <discrete derivative of a Boolean function> gives $\|D_i f\|_2^2=\sum_{S\ni i}\widehat f(S)^2$; sum over coordinates and apply the chosen normalization.