• Support PF! Buy your school textbooks, materials and every day products Here!

How many ways can you roll an 18 from 5 dice?

  • Thread starter srfriggen
  • Start date
  • #1
288
3

Homework Statement


How many ways can you roll an 18 from 5 dice? Assume the dice are different colors.

Homework Equations



Factorials

The Attempt at a Solution



I listed combinations of dice that would add to 18 as follows

66411
65511
55521
44442
33336
66312
65412
55431
44433
66222
65313
55224
44451



Since the dice are different colors, then 6, 6, 4, 1, 1 is distinct from 1, 1, 4, 6, 6. The number of orderings of each sum is 5!

So I have, as a solution: 13 x 5! = 1,560

If all the dice were identical then I'd have 460.

I am confused because this site https://wizardofodds.com/gambling/dice/2/ shows that my answer is double what they have.

I think my answer is correct, since my dice are not identical, but am perplexed as to how they got 780 and I get 460 for combinations.
 

Answers and Replies

  • #2
34,382
10,470
The number of orderings of each sum is 5!
You have fewer orderings if you have repeated dice. As extreme example, something like "3 3 3 3 3" has just one ordering (it doesn't have a sum of 18 but that is not the point here).

You are looking for partitions of 18. There can be tricks to calculate them without casework, at least for distinguishable dice, but I'm not sure how to include the maximum of 6 here for the dice without checking a few cases separately.
 
  • #3
288
3
You have fewer orderings if you have repeated dice. As extreme example, something like "3 3 3 3 3" has just one ordering (it doesn't have a sum of 18 but that is not the point here).

You are looking for partitions of 18. There can be tricks to calculate them without casework, at least for distinguishable dice, but I'm not sure how to include the maximum of 6 here for the dice without checking a few cases separately.
Thank you for your reply. So would 66411 have ordering of 5! / 2!2! = 120/4 = 30? If so when I did those calculations I only got 460.

It seems odd to me that my answer is exactly 2 times the answer from that site.
 
  • #4
vela
Staff Emeritus
Science Advisor
Homework Helper
Education Advisor
14,632
1,268
It seems you missed some combinations. I think the following aren't already covered in your list.

64431
65322
64422
64332
55332
54432
33345

I brute-forced it and found there are 20 combinations that sum to 18.
 
Last edited:
  • #5
Stephen Tashi
Science Advisor
7,176
1,315
Since the dice are different colors, then 6, 6, 4, 1, 1 is distinct from 1, 1, 4, 6, 6.
If you are considering permutations of 5 things, you have to make them all distinct. So you are thinking of "6,6,4,1,1" as if it were ##6_a, 6_b, 4, 1_a, 1_b##. A different one of the 5! permutations is ##6_b,6_a, 4,1_b,1_a##.

However, if we consider the notation "6,6,4,1,1" to mean "The red die is 6, The orange die is 6, the yellow die is 4,..." etc. then interchanging ##6_a## with ##6_b## doesn't create a new situation.


Likewise if we imagine your table of combinations as having a heading over it giving the die color for each column, the interchanging the 5 entries in this heading does not always create a new situation. For example if the column headings were "die red, die orange, die yellow, die green, die blue" and the table entry is 6,6,4,1,1 then changing the column headings to "die orange, die red, die yellow , die green, die blue" does not change 6,6,4,1,1 to a new situation.

A scholarly paper about the problem: https://digitalscholarship.unlv.edu/cgi/viewcontent.cgi?article=1025&context=grrj
 
  • #6
34,382
10,470
Options and multiplity:

66411 - 30
66321 - 60
66222 - 10
65511 - 30
65421 - 120
65331 - 60
65322 - 60
64431 - 60
64422 - 30
64332 - 60
63333 - 5
55521 - 20
55431 - 60
55422 - 30
55332 - 30
54441 - 20
54432 - 60
54333 - 20
44442 - 5
44433 - 10

Sum: 780

This is 6.5 times 5!, it seems to be an accident that it is divisible by (5!/2). As a different example, for a sum of 7 we could get 5 options from "31111" and 10 options from "22111", for a total of 15.
 
  • #7
Dick
Science Advisor
Homework Helper
26,258
618
There is a simple way to solve problems like this, especially if you have a good calculator. The answer is the coefficient of ##x^{18}## in the expansion of ##(x+x^2+x^3+x^4+x^5+x^6)^5##. If you think about it for a little bit, you can probably figure out why.
 
  • Like
Likes mattt, FactChecker, StoneTemplePython and 2 others
  • #8
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
13,435
5,955
There is a simple way to solve problems like this, especially if you have a good calculator. The answer is the coefficient of ##x^{18}## in the expansion of ##(x+x^2+x^3+x^4+x^5+x^6)^5##. If you think about it for a little bit, you can probably figure out why.
A variation on this, if you don't have a good enough calculator is to use a tree approach.

Imagine throwing the dice in order one at a time. We can build up a tree of the numbers of ways of getting each number as we throw more dice. Symmetry helps and we can truncate the tree if the numbers are too high or low. E.g. after three dice we must have between 6 and 16 inclusive, if we want 18 after five dice.

The first two dice can be anything. This gives the pattern:

Total (number of ways) - after two dice.
2(1)
3(2)
4(3)
5(4)
6(5)
7(6)
8(5)
9(4)
10(3)
11(2)
12(1)

To get the number of ways of getting the totals after three dice note that to get 6 we can have ##2+4, \ 3+3, \ 4+2, \ 5+1##, where the first number is the total after two dice and the second number is the third throw. The number of ways of getting 6 after three dice, therefore, is the sum of the ways of getting 2-5 for two dice. This gives 10 ways to get 6 with three dice.

Following this method we get:

Total (number of ways) - three dice
6(10)
7(15)
8(21)
9(25)
10(27)
11(27)
12(25)
13(21)
14(15)
15(10)
16(6)

Then the totals for four dice are:

Total (number of ways) - after four dice
12(125)
13(140)
14(146)
15(140)
16(125)
17(104)

And, if you add those up you get ##780## as the number of ways of getting 18 with five dice.
 
Last edited:
  • #9
288
3
Options and multiplity:

66411 - 30
66321 - 60
66222 - 10
65511 - 30
65421 - 120
65331 - 60
65322 - 60
64431 - 60
64422 - 30
64332 - 60
63333 - 5
55521 - 20
55431 - 60
55422 - 30
55332 - 30
54441 - 20
54432 - 60
54333 - 20
44442 - 5
44433 - 10

Sum: 780

This is 6.5 times 5!, it seems to be an accident that it is divisible by (5!/2). As a different example, for a sum of 7 we could get 5 options from "31111" and 10 options from "22111", for a total of 15.
Thank you for the reply. I missed some of the combinations. I have the correct answer now and it makes sense.
 
  • Like
Likes SammyS
  • #10
tnich
Homework Helper
1,048
336
There is a simple way to solve problems like this, especially if you have a good calculator. The answer is the coefficient of ##x^{18}## in the expansion of ##(x+x^2+x^3+x^4+x^5+x^6)^5##. If you think about it for a little bit, you can probably figure out why.
Actually, you don't need a fancy calculator to expand this polynomial. If you write
$$(\sum_{k = 1}^n {x^k})^n = (\frac {x-x^{k+1}} {1-x})^n$$
you can use a binomial expansion on the numerator. The denominator is related to the multichoose function.
 
  • #11
tnich
Homework Helper
1,048
336
Actually, you don't need a fancy calculator to expand this polynomial. If you write
$$(\sum_{k = 1}^n {x^k})^n = (\frac {x-x^{k+1}} {1-x})^n$$
you can use a binomial expansion on the numerator. The denominator is related to the multichoose function.
By this method I get for ##n=5## the coefficient of ##x^{18}## is
$$\left( \begin{matrix} 5 \\ 0 \end{matrix} \right)
\left( \left(\begin{matrix} 5 \\ 13 \end{matrix} \right)\right)-
\left( \begin{matrix} 5 \\ 1 \end{matrix} \right)
\left( \left(\begin{matrix} 5 \\ 7 \end{matrix} \right)\right)+
\left( \begin{matrix} 5 \\ 2 \end{matrix} \right)
\left( \left(\begin{matrix} 5 \\ 1 \end{matrix} \right)\right) = 780$$
where
$$\left( \left(\begin{matrix} n \\ k \end{matrix} \right)\right) \equiv \left(\begin{matrix} n+k-1 \\ k \end{matrix} \right)$$
(This equation makes more sense if you think of it as finding the number of combinations of integers ##0 \leq n_k \leq 5## such that ##\sum_{k=1}^5 {n_k} = 13##, which is equivalent to the OP.)
I think that works intuitively. It is all of the combinations of 5 non-negative integers that sum to 13, less combinations where one integer is at least 6, plus combinations where two integers are at least 6. (There are no combinations in which three or more integers are at least 6.) The third term is needed to avoid double counting.
 
Last edited:
  • Like
Likes PeroK
  • #12
tnich
Homework Helper
1,048
336
Actually, you don't need a fancy calculator to expand this polynomial. If you write
$$(\sum_{k = 1}^n {x^k})^n = (\frac {x-x^{k+1}} {1-x})^n$$
you can use a binomial expansion on the numerator. The denominator is related to the multichoose function.
I see I messed this up. It should be
$$(\sum_{k = 1}^m {x^k})^n = (\frac {x-x^{m+1}} {1-x})^n$$
 
  • Like
Likes FactChecker
  • #13
haruspex
Science Advisor
Homework Helper
Insights Author
Gold Member
33,529
5,450
You are looking for partitions of 18.
Isn't that for the case of indistinguishable dice? Or did you mean composition?
 
  • #14
34,382
10,470
Ah right, compositions have an order.
Anyway, you still get casework from the maximum of 6. Filling a table die by die is easier (equivalent to the approach with polynomials).
 
  • #15
tnich
Homework Helper
1,048
336
By this method I get for ##n=5## the coefficient of ##x^{18}## is
$$\left( \begin{matrix} 5 \\ 0 \end{matrix} \right)
\left( \left(\begin{matrix} 5 \\ 13 \end{matrix} \right)\right)-
\left( \begin{matrix} 5 \\ 1 \end{matrix} \right)
\left( \left(\begin{matrix} 5 \\ 7 \end{matrix} \right)\right)+
\left( \begin{matrix} 5 \\ 2 \end{matrix} \right)
\left( \left(\begin{matrix} 5 \\ 1 \end{matrix} \right)\right) = 780$$
where
$$\left( \left(\begin{matrix} n \\ k \end{matrix} \right)\right) \equiv \left(\begin{matrix} n+k-1 \\ k \end{matrix} \right)$$
(This equation makes more sense if you think of it as finding the number of combinations of integers ##0 \leq n_k \leq 5## such that ##\sum_{k=1}^5 {n_k} = 13##, which is equivalent to the OP.)
I think that works intuitively. It is all of the combinations of 5 non-negative integers that sum to 13, less combinations where one integer is at least 6, plus combinations where two integers are at least 6. (There are no combinations in which three or more integers are at least 6.) The third term is needed to avoid double counting.
More generally, when throwing n dice with m sides each (numbered from 1 to m), the number of ways the throw can show a total of T spots is:
##\sum_{k=0}^{floor \left(\frac {T-n} m \right)} (-1)^k \begin{pmatrix} n\\k \end{pmatrix} \left(\begin {pmatrix} n \\ T-n-mk \end{pmatrix}\right)##
 

Related Threads on How many ways can you roll an 18 from 5 dice?

Replies
13
Views
11K
  • Last Post
Replies
11
Views
967
  • Last Post
Replies
1
Views
27K
Replies
16
Views
2K
  • Last Post
Replies
14
Views
4K
Replies
8
Views
1K
Replies
3
Views
1K
  • Last Post
Replies
6
Views
2K
Replies
14
Views
2K
Replies
3
Views
2K
Top