min-max容斥

max(S)=TSmin(T)(1)T1\max(S)=\sum_{T\subseteq S}\min(T)\cdot (-1)^{|T|-1}

E(max(S))=TSE(min(T))(1)T1E(\max(S))=\sum_{T\subseteq S}E(\min(T))\cdot (-1)^{|T|-1}

一般来说E(min(T))=1iTpiE(min(T))=\frac{1}{\sum_{i\in T}p_i}