Is there a way to calculate the number of identical rolls in polyhedral dice rolls?
A specific example: I roll $3$ times a $12$-sided dice.
What are the odds of rolling some number twice with 3 dice? E.g. $(4,4,7)$ , $(4,2,4)$...
AND: What are the odds of rolling some number $3$ times with $3$ dice? E.g. $(4,4,4)$, $(11,11,11)$...
For rolling three $n$-sided dice and getting exactly one pair of dice which match (counting results like (4,2,4) but not counting results like (6,6,6)) we count how many possible triples of numbers have this property via multiplication principle.
There are $n$ choices for the number used for the pair. Given that selection, there are $n-1$ remaining choices to use for the singleton. Regardless of these choices, there are $3$ positions available for the singleton to be placed in in our triple. Applying multiplication principle, there are then $3n(n-1)=3n^2-3n$.
In the case of a $d6$ that would be $6\cdot 5\cdot 3 = 90$ possibilities.
If we were to include also the results where all three dice show the same result, that would be an additional $n$ possibilities, bringing the new total to $3n(n-1)+n=3n^2-2n$, in the case of a $d6$ a total of $90+6=96$ possibilities.
To find the probability, we divide by the total number of triples, which would be $n^3$, seen also by multiplication principle. In the example of a $d6$ that would be $6^3=216$.
The correct probability for the six-sided dice example would then be $\frac{90}{216}$ if we are concerned with exactly one pair, and would be $\frac{96}{216}$ if we are concerned with at least one pear.
The term "odds" is related in concept to probability, but technically different.
While the probability for exactly one pair in the six-sided dice example is $\frac{90}{216}$ the odds will instead be $90~::~126$, in reference to how there are $90$ favorable outcomes versus $126$ unfavorable outcomes.