Find the expected value when you roll n dice and the number of pair on the dice adds up to 7? You roll $n$ fair dice. Let X be the number of pairs of dice that sum to $7$.
Write $X$ as a sum of indicator variables and find $E[X]$
This is how I approached the problem
Let $S$ be all the strings length n on [6].
Let $X(S)$ be the number of ways to add up the numbers on the n dice that adds up to 7. Then we can write $X$ as $X = X_{1}+X_{2}+.....+X_{n}$
To find the expected value we can use: $$ \sum_{s\in S} X(S)P(S)$$
Let $X(S) = k$ (k is the numbers that show up on the $n$ dice and adds up to 7. Eg: n = 4 and numbers that show up on the dice are $4631$. $4$ and $3$ make $7$ and $6$ and $1$ make $7$, so k = 2.)
Now I have no idea how to find the P(S). I feel like the denominator of the P(S) will be $6^{n}$, but I don't know how to find the numerator.
Thank you.
 A: There are $N=\binom{n}{2}$ (unordered)  pairs of dice. Label these $P_1$ up to $P_N$.
For every pair $P_i$, define random variable $Y_i$ by $Y_i=1$ if the pair $P_i$ has sum $7$, and by $Y_i=0$ otherwise. 
Then $X=Y_1+\cdots+Y_N$, and by the linearity of expectation we have $$E(X)=E(Y_1)+\cdots+E(Y_N).$$
Finally, we calculate $\Pr(Y_i=1)$. If we toss two dice, the probability they have sum $7$ is $\frac{1}{6}$. So $E(X)=\frac{1}{6}\binom{n}{2}$.
A: You wish to find the expected count of pairs of dice whose results add up to seven.
Eg: If the results are 1,2,3,4,3,6,2,5,4 then there are $7$ ways to select pairs which add up to seven, because there is one 1 and one 6, two 2 and one 5, two 3 and two 4.  
Let $N_k$ be the count of dice whose number is $k$, and express $X$ in terms of $N_1, N_2, N_3, N_4, N_5, N_6$.  
Now find the expectation.


 $$\begin{align}\mathsf E(X) ~=~& \mathsf E(N_1N_6+N_2N_5+N_3N_4)\\[1ex] ~=~ & 3~\mathsf E(N_iN_j; i\neq j) & \textsf{Linearity of Expectation}\\[1ex] ~=~& 3~\mathsf E(N_i \mathsf E(N_j\mid N_i); i\neq j) & \textsf{Iteration of Expectation} \\[1ex] ~=~& 3~\mathsf E(N_i\cdot \tfrac 1 5(n-N_i)) & N_j\mid N_i ~\sim~\mathcal{Bin}(n-N_i, 1/5) \\[1ex] ~=~& \tfrac 3 5(n\mathsf E(N_i)-\mathsf E(N_i^2)) \\[1ex] ~=~& \tfrac 3 5(n\mathsf E(N_i)-\mathsf {Var}(N_i)-\mathsf E(N_i)^2) \\[1ex] ~=~& \tfrac 3 5(\tfrac {n^2}6-\tfrac {5n}{36} -\tfrac{n^2}{36}) & N_i\sim\mathcal{Bin}(n, 1/6) \\[1ex] ~=~& \tfrac{n(n-1)}{12}\end{align}$$

For which André Nicolas obtained by a much more elegant approach. 
