Number of combinations of dice having different number of faces that add to $10$
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
A function $face_sum$ that takes a vector $f$ that represents the number of faces of each die, and a positive integer $s$ , and returns the probability that the sum of the top faces observed is $s$ .
For example, if $f=[3,4,5]$ and $s≤2$ or $s≥13$ , $face_sum$ returns $0$, and if $s=3$ or $s=12$ , it returns $frac13*frac14*frac15=frac160$
$face_sum([2,4,4,6], 10)$
I tried to solve this but I can't find the formula to calculate the number of combination of die faces that add to $10$, as the number of faces are different for each die.
Since max no of possible combination is $6*4*4*2=192$, all I need to find is the number of combination of die faces that add to $10$.
Thanks in advance.
combinatorics
add a comment |Â
up vote
3
down vote
favorite
A function $face_sum$ that takes a vector $f$ that represents the number of faces of each die, and a positive integer $s$ , and returns the probability that the sum of the top faces observed is $s$ .
For example, if $f=[3,4,5]$ and $s≤2$ or $s≥13$ , $face_sum$ returns $0$, and if $s=3$ or $s=12$ , it returns $frac13*frac14*frac15=frac160$
$face_sum([2,4,4,6], 10)$
I tried to solve this but I can't find the formula to calculate the number of combination of die faces that add to $10$, as the number of faces are different for each die.
Since max no of possible combination is $6*4*4*2=192$, all I need to find is the number of combination of die faces that add to $10$.
Thanks in advance.
combinatorics
The generating function for $f([3,4,5],n)$ is $$x^3fracx^3-1x-1fracx^4-1x-1fracx^5-1x-1= x^12+3x^11+6x^10+9x^9+11x^8+11x^7+9x^6+6x^5+3x^4+x^3$$. The generating function for $f([2,4,4,6],n)$ is $$scriptsize x^4fracx^2-1x-1fracx^4-1x-1fracx^4-1x-1fracx^6-1x-1 =x^16+4x^15+9x^14+16x^13+23x^12+28x^11+30x^10+28x^9+23x^8+16x^7+9x^6+4x^5+x^4$$.
– robjohn♦
Jul 18 at 19:20
don't dice 2 and 3 have the same number of faces?
– zhw.
Jul 18 at 19:48
yep they have the same number of faces.
– Udolf
Jul 19 at 3:33
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
A function $face_sum$ that takes a vector $f$ that represents the number of faces of each die, and a positive integer $s$ , and returns the probability that the sum of the top faces observed is $s$ .
For example, if $f=[3,4,5]$ and $s≤2$ or $s≥13$ , $face_sum$ returns $0$, and if $s=3$ or $s=12$ , it returns $frac13*frac14*frac15=frac160$
$face_sum([2,4,4,6], 10)$
I tried to solve this but I can't find the formula to calculate the number of combination of die faces that add to $10$, as the number of faces are different for each die.
Since max no of possible combination is $6*4*4*2=192$, all I need to find is the number of combination of die faces that add to $10$.
Thanks in advance.
combinatorics
A function $face_sum$ that takes a vector $f$ that represents the number of faces of each die, and a positive integer $s$ , and returns the probability that the sum of the top faces observed is $s$ .
For example, if $f=[3,4,5]$ and $s≤2$ or $s≥13$ , $face_sum$ returns $0$, and if $s=3$ or $s=12$ , it returns $frac13*frac14*frac15=frac160$
$face_sum([2,4,4,6], 10)$
I tried to solve this but I can't find the formula to calculate the number of combination of die faces that add to $10$, as the number of faces are different for each die.
Since max no of possible combination is $6*4*4*2=192$, all I need to find is the number of combination of die faces that add to $10$.
Thanks in advance.
combinatorics
edited Jul 18 at 20:02


GuySa
402313
402313
asked Jul 18 at 19:10
Udolf
355
355
The generating function for $f([3,4,5],n)$ is $$x^3fracx^3-1x-1fracx^4-1x-1fracx^5-1x-1= x^12+3x^11+6x^10+9x^9+11x^8+11x^7+9x^6+6x^5+3x^4+x^3$$. The generating function for $f([2,4,4,6],n)$ is $$scriptsize x^4fracx^2-1x-1fracx^4-1x-1fracx^4-1x-1fracx^6-1x-1 =x^16+4x^15+9x^14+16x^13+23x^12+28x^11+30x^10+28x^9+23x^8+16x^7+9x^6+4x^5+x^4$$.
– robjohn♦
Jul 18 at 19:20
don't dice 2 and 3 have the same number of faces?
– zhw.
Jul 18 at 19:48
yep they have the same number of faces.
– Udolf
Jul 19 at 3:33
add a comment |Â
The generating function for $f([3,4,5],n)$ is $$x^3fracx^3-1x-1fracx^4-1x-1fracx^5-1x-1= x^12+3x^11+6x^10+9x^9+11x^8+11x^7+9x^6+6x^5+3x^4+x^3$$. The generating function for $f([2,4,4,6],n)$ is $$scriptsize x^4fracx^2-1x-1fracx^4-1x-1fracx^4-1x-1fracx^6-1x-1 =x^16+4x^15+9x^14+16x^13+23x^12+28x^11+30x^10+28x^9+23x^8+16x^7+9x^6+4x^5+x^4$$.
– robjohn♦
Jul 18 at 19:20
don't dice 2 and 3 have the same number of faces?
– zhw.
Jul 18 at 19:48
yep they have the same number of faces.
– Udolf
Jul 19 at 3:33
The generating function for $f([3,4,5],n)$ is $$x^3fracx^3-1x-1fracx^4-1x-1fracx^5-1x-1= x^12+3x^11+6x^10+9x^9+11x^8+11x^7+9x^6+6x^5+3x^4+x^3$$. The generating function for $f([2,4,4,6],n)$ is $$scriptsize x^4fracx^2-1x-1fracx^4-1x-1fracx^4-1x-1fracx^6-1x-1 =x^16+4x^15+9x^14+16x^13+23x^12+28x^11+30x^10+28x^9+23x^8+16x^7+9x^6+4x^5+x^4$$.
– robjohn♦
Jul 18 at 19:20
The generating function for $f([3,4,5],n)$ is $$x^3fracx^3-1x-1fracx^4-1x-1fracx^5-1x-1= x^12+3x^11+6x^10+9x^9+11x^8+11x^7+9x^6+6x^5+3x^4+x^3$$. The generating function for $f([2,4,4,6],n)$ is $$scriptsize x^4fracx^2-1x-1fracx^4-1x-1fracx^4-1x-1fracx^6-1x-1 =x^16+4x^15+9x^14+16x^13+23x^12+28x^11+30x^10+28x^9+23x^8+16x^7+9x^6+4x^5+x^4$$.
– robjohn♦
Jul 18 at 19:20
don't dice 2 and 3 have the same number of faces?
– zhw.
Jul 18 at 19:48
don't dice 2 and 3 have the same number of faces?
– zhw.
Jul 18 at 19:48
yep they have the same number of faces.
– Udolf
Jul 19 at 3:33
yep they have the same number of faces.
– Udolf
Jul 19 at 3:33
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
The formula is a bit messy. Suppose there are $n$ dice, and the list is $f=[f_1,f_2,dots,f_n]$. You want to count the number of integer solutions to the constrained equation
$$
beginalign
x_1+x_2+dots+x_n &= s\ 1le x_i&le f_ihspace2cm text for i=1,2,dots,n
endalign
$$
To solve this, first, count the number of solutions without the constraint $x_ile f_i$. This can be shown to be $binoms-1n-1$ (imagine a line of $s$ dots, and you place dividers in $n-1$ of the $s-1$ spaces between the dots). Now, use inclusion exclusion to subtract out the "bad" solutions where some $x_i > f_i$. The result is this:
$$
boxedBbb P(n text dice with f_1,dots,f_n text faces sum to s) = frac1f_1timesdotstimes f_nsum_Ssubseteq 1,2,dots,n(-1)^binoms-1-sum_iin Sf_in-1.
$$
There are $2^n$ summands, one for each subset of $1,2,dots,n$ (i.e. subset of the available dice).
For example, when $f=[2,4,4,6]$ and $s=10$, you get
$$
1over 2cdot 4cdot 4cdot 6left[
beginarraylbinom10-14-1\
-binom10-2-14-1-binom10-4-14-1
-binom10-4-14-1-binom10-6-14-1\
+binom10-2-4-14-1+binom10-2-4-14-1
endarrayright].
$$
Terms with $sum_iin Sf_i>s-n$ have been omitted, since in these cases the binomial coefficient is zero.
Thank you for this detailed answer.
– Udolf
Jul 19 at 3:30
add a comment |Â
up vote
0
down vote
Do you know how to find the number of solutions for an equation like the following?
$$
x_1 + x_2 + ... + x_n = k
$$
given $forall i in [n]: x_i in S_i$ for some set $S_i$.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
The formula is a bit messy. Suppose there are $n$ dice, and the list is $f=[f_1,f_2,dots,f_n]$. You want to count the number of integer solutions to the constrained equation
$$
beginalign
x_1+x_2+dots+x_n &= s\ 1le x_i&le f_ihspace2cm text for i=1,2,dots,n
endalign
$$
To solve this, first, count the number of solutions without the constraint $x_ile f_i$. This can be shown to be $binoms-1n-1$ (imagine a line of $s$ dots, and you place dividers in $n-1$ of the $s-1$ spaces between the dots). Now, use inclusion exclusion to subtract out the "bad" solutions where some $x_i > f_i$. The result is this:
$$
boxedBbb P(n text dice with f_1,dots,f_n text faces sum to s) = frac1f_1timesdotstimes f_nsum_Ssubseteq 1,2,dots,n(-1)^binoms-1-sum_iin Sf_in-1.
$$
There are $2^n$ summands, one for each subset of $1,2,dots,n$ (i.e. subset of the available dice).
For example, when $f=[2,4,4,6]$ and $s=10$, you get
$$
1over 2cdot 4cdot 4cdot 6left[
beginarraylbinom10-14-1\
-binom10-2-14-1-binom10-4-14-1
-binom10-4-14-1-binom10-6-14-1\
+binom10-2-4-14-1+binom10-2-4-14-1
endarrayright].
$$
Terms with $sum_iin Sf_i>s-n$ have been omitted, since in these cases the binomial coefficient is zero.
Thank you for this detailed answer.
– Udolf
Jul 19 at 3:30
add a comment |Â
up vote
1
down vote
accepted
The formula is a bit messy. Suppose there are $n$ dice, and the list is $f=[f_1,f_2,dots,f_n]$. You want to count the number of integer solutions to the constrained equation
$$
beginalign
x_1+x_2+dots+x_n &= s\ 1le x_i&le f_ihspace2cm text for i=1,2,dots,n
endalign
$$
To solve this, first, count the number of solutions without the constraint $x_ile f_i$. This can be shown to be $binoms-1n-1$ (imagine a line of $s$ dots, and you place dividers in $n-1$ of the $s-1$ spaces between the dots). Now, use inclusion exclusion to subtract out the "bad" solutions where some $x_i > f_i$. The result is this:
$$
boxedBbb P(n text dice with f_1,dots,f_n text faces sum to s) = frac1f_1timesdotstimes f_nsum_Ssubseteq 1,2,dots,n(-1)^binoms-1-sum_iin Sf_in-1.
$$
There are $2^n$ summands, one for each subset of $1,2,dots,n$ (i.e. subset of the available dice).
For example, when $f=[2,4,4,6]$ and $s=10$, you get
$$
1over 2cdot 4cdot 4cdot 6left[
beginarraylbinom10-14-1\
-binom10-2-14-1-binom10-4-14-1
-binom10-4-14-1-binom10-6-14-1\
+binom10-2-4-14-1+binom10-2-4-14-1
endarrayright].
$$
Terms with $sum_iin Sf_i>s-n$ have been omitted, since in these cases the binomial coefficient is zero.
Thank you for this detailed answer.
– Udolf
Jul 19 at 3:30
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
The formula is a bit messy. Suppose there are $n$ dice, and the list is $f=[f_1,f_2,dots,f_n]$. You want to count the number of integer solutions to the constrained equation
$$
beginalign
x_1+x_2+dots+x_n &= s\ 1le x_i&le f_ihspace2cm text for i=1,2,dots,n
endalign
$$
To solve this, first, count the number of solutions without the constraint $x_ile f_i$. This can be shown to be $binoms-1n-1$ (imagine a line of $s$ dots, and you place dividers in $n-1$ of the $s-1$ spaces between the dots). Now, use inclusion exclusion to subtract out the "bad" solutions where some $x_i > f_i$. The result is this:
$$
boxedBbb P(n text dice with f_1,dots,f_n text faces sum to s) = frac1f_1timesdotstimes f_nsum_Ssubseteq 1,2,dots,n(-1)^binoms-1-sum_iin Sf_in-1.
$$
There are $2^n$ summands, one for each subset of $1,2,dots,n$ (i.e. subset of the available dice).
For example, when $f=[2,4,4,6]$ and $s=10$, you get
$$
1over 2cdot 4cdot 4cdot 6left[
beginarraylbinom10-14-1\
-binom10-2-14-1-binom10-4-14-1
-binom10-4-14-1-binom10-6-14-1\
+binom10-2-4-14-1+binom10-2-4-14-1
endarrayright].
$$
Terms with $sum_iin Sf_i>s-n$ have been omitted, since in these cases the binomial coefficient is zero.
The formula is a bit messy. Suppose there are $n$ dice, and the list is $f=[f_1,f_2,dots,f_n]$. You want to count the number of integer solutions to the constrained equation
$$
beginalign
x_1+x_2+dots+x_n &= s\ 1le x_i&le f_ihspace2cm text for i=1,2,dots,n
endalign
$$
To solve this, first, count the number of solutions without the constraint $x_ile f_i$. This can be shown to be $binoms-1n-1$ (imagine a line of $s$ dots, and you place dividers in $n-1$ of the $s-1$ spaces between the dots). Now, use inclusion exclusion to subtract out the "bad" solutions where some $x_i > f_i$. The result is this:
$$
boxedBbb P(n text dice with f_1,dots,f_n text faces sum to s) = frac1f_1timesdotstimes f_nsum_Ssubseteq 1,2,dots,n(-1)^binoms-1-sum_iin Sf_in-1.
$$
There are $2^n$ summands, one for each subset of $1,2,dots,n$ (i.e. subset of the available dice).
For example, when $f=[2,4,4,6]$ and $s=10$, you get
$$
1over 2cdot 4cdot 4cdot 6left[
beginarraylbinom10-14-1\
-binom10-2-14-1-binom10-4-14-1
-binom10-4-14-1-binom10-6-14-1\
+binom10-2-4-14-1+binom10-2-4-14-1
endarrayright].
$$
Terms with $sum_iin Sf_i>s-n$ have been omitted, since in these cases the binomial coefficient is zero.
edited Jul 24 at 18:08
answered Jul 18 at 19:40


Mike Earnest
15.4k11644
15.4k11644
Thank you for this detailed answer.
– Udolf
Jul 19 at 3:30
add a comment |Â
Thank you for this detailed answer.
– Udolf
Jul 19 at 3:30
Thank you for this detailed answer.
– Udolf
Jul 19 at 3:30
Thank you for this detailed answer.
– Udolf
Jul 19 at 3:30
add a comment |Â
up vote
0
down vote
Do you know how to find the number of solutions for an equation like the following?
$$
x_1 + x_2 + ... + x_n = k
$$
given $forall i in [n]: x_i in S_i$ for some set $S_i$.
add a comment |Â
up vote
0
down vote
Do you know how to find the number of solutions for an equation like the following?
$$
x_1 + x_2 + ... + x_n = k
$$
given $forall i in [n]: x_i in S_i$ for some set $S_i$.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Do you know how to find the number of solutions for an equation like the following?
$$
x_1 + x_2 + ... + x_n = k
$$
given $forall i in [n]: x_i in S_i$ for some set $S_i$.
Do you know how to find the number of solutions for an equation like the following?
$$
x_1 + x_2 + ... + x_n = k
$$
given $forall i in [n]: x_i in S_i$ for some set $S_i$.
answered Jul 18 at 19:25


GuySa
402313
402313
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2855897%2fnumber-of-combinations-of-dice-having-different-number-of-faces-that-add-to-10%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
The generating function for $f([3,4,5],n)$ is $$x^3fracx^3-1x-1fracx^4-1x-1fracx^5-1x-1= x^12+3x^11+6x^10+9x^9+11x^8+11x^7+9x^6+6x^5+3x^4+x^3$$. The generating function for $f([2,4,4,6],n)$ is $$scriptsize x^4fracx^2-1x-1fracx^4-1x-1fracx^4-1x-1fracx^6-1x-1 =x^16+4x^15+9x^14+16x^13+23x^12+28x^11+30x^10+28x^9+23x^8+16x^7+9x^6+4x^5+x^4$$.
– robjohn♦
Jul 18 at 19:20
don't dice 2 and 3 have the same number of faces?
– zhw.
Jul 18 at 19:48
yep they have the same number of faces.
– Udolf
Jul 19 at 3:33