Trying to find a generic formula for the probability of N players out of P players picking the same value from a dice with D sides.

i.e. If we have 3 players with 3 sided dice, you have 3/27 probability of them getting the same number (1, 1, 1), (2, 2, 2), (3, 3, 3). You also have 18/27 probability of 2 of them getting the same number.

I was able to generalize for a 2 sided-dice (coin-flip).

Variables Summary:

  1. Dice faces: D
  2. Players: P
  3. Needed number of players with same side: N

$$ (D)*({P\choose N}/(D)^{P}) $$

When I tried to apply the above formula for more than 2 sides, it didn't give the correct value.

If I have 5 people who roll (1, 1, 2, 3, 3), this is considered as 1 sample with 2 matches.

Any pointers?

Edit: Fixed wrong variable


1 Answer 1


(I take it by X you mean N.) The problem is still essentially binomial; for each side of the die, you have the outcomes "yes, that side" and "no, one of the D-1 other sides." The standard binomial formula is

$$ Pr(N) = {P\choose N}q^N (1-q)^{(P-N)} $$

For your case, $q=1/D$, yielding

$$ {P\choose N}(\frac{1}{D})^N (1-\frac{1}{D})^{(P-N)} $$

Then multiply by D (as you did in your formula) to account for the D distinct sides:

$$ D{P\choose N}(\frac{1}{D})^N (1-\frac{1}{D})^{(P-N)} $$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.