# Probability greatest roll of z dice exceeding greatest roll of h dice?

Let's assume there are two players in a dice game; zombie and hero.

The Zombie rolls z fair 6-sided dice.

The Hero rolles h fair 6-sided dice.

If the heroes greatest dice roll is larger than the zombie's greatest dice roll, the hero wins. Otherwise, the zombie wins.

How can I calculate the probability of the hero winning as a function of z and h (without just enumerating the answers).

Example 1: z = 1, h = 2

Zombie rolls (4), hero rolls (1,5). Hero has a higher dice roll and wins.

Example 2: z = 2, h = 2

Zombie rolls (4,4), hero rolls (1,4). Hero does not have a higher dice roll and loses.

-

Let $Z$ denote the greatest dice roll of Zombie and $H$ the greatest dice roll of Hero. Assume Zombie's rolls and Hero's rolls are independent
Then $\mathrm P(Z\leqslant n)=(n/6)^z$ for every $1\leqslant n\leqslant 6$ hence $\mathrm P(Z= n)=(n/6)^z-((n-1)/6)^z$. Likewise, $\mathrm P(H\leqslant n)=(n/6)^h$ hence $\mathrm P(H\gt n)=1-(n/6)^h$ for every $1\leqslant n\leqslant 6$. This yields $$\mathrm P(H\gt Z)=\sum_{n=1}^6\mathrm P(Z=n)\mathrm P(H\gt n)=\sum_{n=1}^6((n/6)^z-((n-1)/6)^z(1-(n/6)^h),$$ that is, $$\mathrm P(H\gt Z)=1-\frac1{6^{z+h}}\sum_{n=1}^6(n^z-(n-1)^z)n^h.$$
 The RHS of your final equation should begin with $1$, not $6^{−h}$. – Byron Schmuland Jan 25 '12 at 16:16 @Byron: Indeed it should. Thanks. – Did Jan 25 '12 at 16:38