Originally Posted by

**SlipEternal** Define $\displaystyle E(b,w)$ as the expected number of matching pairs of dice when there are $\displaystyle b$ black dice and $\displaystyle w$ white dice. Define $\displaystyle P(b)$ as the probability that a randomly chosen white die matches at least one of the $\displaystyle b$ black dice. Then $\displaystyle E(b,w) = P(b)(1+E(b-1,w-1)) + (1-P(b))E(b,w-1)$ gives a recurrence relationship for the expected value.

$\displaystyle P(b) = 1-\left(\dfrac{5}{6}\right)^b$ since this is the probability that among the $\displaystyle b$ black dice, none of them rolled the same as the one white die.

Hence, $\displaystyle E(b,w) = \left(1-\left(\dfrac{5}{6}\right)^b\right)(1+E(b-1,w-1)) + \left(\dfrac{5}{6}\right)^bE(b,w-1)$ and $\displaystyle E(n,0) = E(0,n) = 0$

Next, I would recommend looking into generating functions (or calculate for small $\displaystyle (b,w)$ using a statistics engine like R).