We have a set(A) of N elements. Let's assume elements are e1,e2,e3..etc. Value of each element can be 0 or 1. Another set of N elements(set B) are given, p1,p2,p3..etc. Where p (i) =probability of e (i) to be 1. If we pick a random permutation P of N elements from set(A). What is the expected sum of elements in P ?
Example : if set(A) contains 5 elements e1,e2,e3,e4,e5 and we picked a 5 element sequence 1,0,0,1,1. In this case sum = 3.
Expected_Value of sum ?
For $i=1$ to $N$, define random variable $X_i$ by $X_i=1$ if the $i$-th element of the permuted sequence has value $1$, and by $X_i=0$ otherwise. Then $Y=X_1+\cdots+X_N$ is the number of $1$'s, and $E(Y)=E(X_1)+\cdots+E(X_N)=NE(X_1)$.
By symmetry $E(X_1)=\frac{1}{N}(p_1+\cdots +p_N)$, so $E(Y)=p_1+\cdots+p_N$.