Calculating expectation value of multiplication of two dependent random variables which obey binomial distribution We have a infinite population of x values obeying some distribution which is known to us. Now we am drawing 10 random samples from that population one at a time and we are creating histogram plot. Now we define two random variables as $f_{i}$ and $f_{j}$ where they represent counts (number of x data points) which falls on i-th and j-th bin respectively when we are creating histogram plot for 10 x values. Now my question is, what will be the value of E($f_{i}f_{j}$)? Probabilities for a x value to belong to i-th and j-th bin are $w_{i}$ and $w_{j}$ respectively.

 A: I think there is a much more elegant way to solve your problem without going through all the calculations. 
Given a sample size of $n$ you could model the mutual counts in each of the bins of the histogram as a multinomial random variable. Let $f_i$ and $f_j$ be the number of observations falling in bin $i$ and $j$ respectively and let $w_i$ and $w_j$ their associated probabilities.
It is then well known from the multinomial distribution that:
\begin{align*}
-nw_iw_j & = cov(f_i,f_j) = \mathbb{E}(f_if_j) -\mathbb{E}(f_i)\mathbb{E}(f_j) = \mathbb{E}(f_if_j) -nw_i n w_j\\
\Rightarrow \qquad & \mathbb{E}(f_if_j)= -nw_iw_j + n^2w_iw_j = nw_iw_j(n-1).
\end{align*}
For your given example this gives $\mathbb{E}(f_if_j) =0.0001235676$, which "coincides" (but is not identical - rounding errors?!) with your calculations/simulation. 
(Note however that in your handwritten notes there is likely a mistake: the situation is symmetric for $i$ and $j$ and it doesn't make a lot of sense why one probability should be squared in the end result while the other isn't)
A: Here, $(f_i+f_j)\leqslant n$.
$E(f_if_j)=\sum_{f_j=0}^{n}f_j \ C_{f_j}^{n} \ w_j^{f_j} \ (1-w_j)^{n-f_j}\sum_{f_i=0}^{n-f_j} \ f_i \ C_{f_i}^{n-f_j} \ w_i^{f_i} (1-w_i)^{n-f_j-f_i} \ (1-w_i)^{f_i}$
Last term $(1-w_i)^{f_i}$ is for nullifying double consideration through the term $(1-w_j)^{n-f_j}$.
I use my data to check the above formula. Since deriving analytic simple form of above formula is hard, I used a program to calculate theoretical value for $n=10$ and then using experimental data I compare results.
Theoretically calculated $E(
f_if_j)$ value is,= $0.00012327$
Experimentally calculated $E(f_if_j)$ value is,= $0.00012933$
$w_i=0.001470181900521$ and $w_j=0.000933879660224$
And in determining experimental value number of times the probability experiment is repeated is, $1082439$
