We have a d*d grid, each square of the grid has a probability $p_{i,j}$ of being white, otherwise the square is black. Let X the discrete random variable which gives the number of white squares. What is the expected value of white square ?
$E[X]= \sum_{i=0}^{d^2} i*P(Z=i)$
I think we have :
$P(Z=0)= \prod_{i,j} (1-p_{i,j})$
$P(Z=1)= \sum_{i,j} p_{i,j}*\prod_{n,m} (1-p_{n,m})$ with $n \neq i$ and $m \neq j$
But it seems very difficult to express $P(Z=i)$ for $i>1$. Do you have an idea ? Is it a common law ? Thanks you.
Define the indicator random variable $U_{ij}$ by $U_{ij}=1$ if square $(i,j)$ is white and by $U_{ij}=0$ otherwise. Then $$X=\sum_{i=1}^d\sum_{j=1}^d U_{ij}.$$ By the linearity of expectation we have $$E(X)=\sum_{i=1}^d\sum_{j=1}^d E(U_{ij}).$$ Finally, $E(U_{ij})=p_{i,j}$.