How to calculate the probability of rolling matching dice?

Hello!

I'm trying to design a new dice system for a table-top roleplaying game. I think that a multinomial distribution or some sort of simulation (probably 100,000 simulations of rolling 10-sided dice) might be the right way to go, but I need some help with the statistics and coding up a solution in python. 

In the game, the player will roll a number of ten-sided dice. Every dice that matches the value of at least one other dice will count as a "match". If a player rolls 8 dice with values {1, 2, 3, 3, 3, 4, 4, 5}, they will have 5 total "matches" because there are three 3s and two 4s. I've been able to intuit that if the player rolls only 2 dice, they would expect to have a 90% chance of no matches, and a 10% chance of 2 matches (one pair of matching dice).

At some point I expect more dice to mean a lower chance of getting "n" matches -- for example, if you rolled 12 dice it would be impossible to get less than 3 matches {1,2,3,4,5,6,7,8,9,10,1,1}.

I'd like to be able to generate probabilities of getting "n" matches with a specified number of same-sided dice (i.e. rolling a number of 8-sided dice, a number of 10-sided dice, or a number of 12-sided dice). I'd like to be able to specify the # of matches I want a probability for, the # of dice to be rolled, and the # of sides on the dice rolled (all dice rolled can have the same # of sides).

Thank you!

  • Mathe Mathe
    0

    We could solve this but I suggest increasing the bounty to $25

Answer

Answers can be viewed only if
  1. The questioner was satisfied and accepted the answer, or
  2. The answer was disputed, but the judge evaluated it as 100% correct.
View the answer
Amas Amas
171
  • Thank you! I'll give this a try soon.

The answer is accepted.
Join Matchmaticians Affiliate Marketing Program to earn up to 50% commission on every question your affiliated users ask or answer.