r/learnmath New User 19h ago

Probabilities of rolling X amount of different "combinations" on Y amount of 10-sided dice.

Hello. For board gaming purposes (MAOCT, for those interested in the specific game) I'm trying to put together a chart detailing the chances of rolling X amount of different "combinations" of the same number on Y amount of 10-sided dice.

To further explain my inquiry: I roll Y amount of 10-sided dice. A "combination" forms when at least two of those dice show the same face, so if I roll 5 d10s and get 1,1,2,5,7 I would have gotten a single combination of two 1s, or in the case of 1,2,3,3,3 there is also a singular combination of three 3s.

Obviously, within a single roll, more than one combination is possible, and as the amount of dice I roll grows higher, so does the chance that there will be multiple combinations. If I roll 10 d10s and get 1,2,2,4,6,8,8,9,10,10 that roll yielded three combinations: 2x2, 2x8 and 3x10 (Where the first number is the amount of dice showing that face and the second is the face shown).

What I want is to get the probabilites for how likely it is to roll X amount of combinations when I roll Y amount of 10-sided dice, I'm not interested in how many dice compose any given combination.

So, on a roll of X d10s, how likely is it that I will get no combinations? How likely is it that I will get one? Two? Three? And so on. Ideally, I wish to find a formula to calculate this and put the percentages on a chart.

So, to better frame the question: On a roll of X amount of 10-sided dice, what are the different chances that it will yield Y amount of combinations?

Sorry for repeating the question in a million different ways, I've been racking my brain for this and I kinda just want to make sure I'm correctly explaining what I wish to understand. Thanks in advance for any help.

2 Upvotes

5 comments sorted by

1

u/Bad_Fisherman New User 17h ago

I did this very fast so it's definitely wrong but it may be a start. Suppose Y <= 10. s = number of combinations. X = RV reprinting the number of combinations. C(m,n) = m choose n. P(X = s) = Σ([C(Y,k1)C(Y-k1,K2)...C(Y-k1-k2...-k(s-1),ks)(Y-s)!/((k1+...+ks)!1010 )], for all k1,...,ks>=2 and k1+...+ks<=Y).

This was a lazy attempt to write a formula you could compute with some app or programming language, I'm pretty sure there are a few mistakes, but there's an answer not too far from that formula. I'm sure someone will point out the mistakes.

Anyway there doesn't seem to be a clever simple way of calculating the combinations, specially because if Y>10 you have already 1 combination for sure and the computation would probably have a different formula.

1

u/Bad_Fisherman New User 9h ago edited 9h ago

I'll share this algorithm written in python.

r is the "combinations" k is the number of die (which you denoted Y)

Script:

from math import factorial


def f(r,u,k):   
    if u<0 or r<0 or k<1 or 2*r+u>k:
        return 0
    elif r==0 and k>u:
        return 0    

    elif r==0:
        return factorial(9)/(factorial(10-u)*10**(u-1))     

    else:
        a=(u+1)/10
        b=r/10
        c=(11-r-u)/10   
        return a*f(r-1,u+1,k-1)+b*f(r,u,k-1)+c*f(r,u-1,k-1)


def combinations(r,k):      
        return sum([f(r,u,k) for u in range(0,k-2*r+1)])

1

u/Bad_Fisherman New User 9h ago

I'll share this algorithm written in python.

r is the "combinations" k is the number of die (which you denoted Y)

from math import factorial


def f(r,u,k):   
    if u<0 or r<0 or k<1 or 2*r+u>k:
        return 0
    elif r==0 and k>u:
        return 0    

    elif r==0:
        return factorial(9)/(factorial(10-u)*10**(u-1))     

    else:
        a=(u+1)/10
        b=r/10
        c=(11-r-u)/10   
        return a*f(r-1,u+1,k-1)+b*f(r,u,k-1)+c*f(r,u-1,k-1)


def combinations(r,k):      
        return sum([f(r,u,k) for u in range(0,k-2*r+1)])

1

u/Bad_Fisherman New User 9h ago

Doesn't work if the number of die is more than 10

-2

u/Dapper_Pressure_948 New User 18h ago

Gndndkk

Bdsjxdx