Calvin is playing a game of Dungeons and Dragons. In order to make it across the river, he needs to throw six standard 4-sided dice, and have their sum be a multiple of 5. How many different dice throws result in Calvin making it across the river?
Details and assumptions
The dice are considered distinct from each other.
A 4-sided dice is a (tetrahedron) dice which yields values of 1, 2, 3, 4.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Let the number of different throws that result in crossing the river when throwing k dice be x(k). We want x(6). Obviously, x(1)=0, for none of 1,2,3,4 is divisible by 5.
Also, the number of different throws that result in not crossing the river when throwing k dice would be 4^k-x(k). In these scenarios Calvin ends up with sum = 1,2,3, or 4 (mod 5).
Now let's establish the recursion between x(k) and x(k-1): For every throw of k-1 dice that results in not crossing, (i.e., the sum =1,2,3, or 4 mod 5), there is one throw of the kth die that complements the current sum and results in 0 mod 5 after the kth throw.
Namely, x(k)= 4^(k-1)-x(k-1).
Spell this out, we have: x(6) = 4^5 - x(5) = 4^5 - 4^4 + x(4) = .... = 4^5 - 4^4 + 4^3 - 4^2 +4 = 820.
Let P ( n ) be the number of ways to roll n dice such that their sum is divisible by 5 . We claim that P ( n ) = 4 n − 1 − P ( n − 1 ) . To see this, first consider that since the dice are distinct, there are 4 n ways to roll n die. Moreover, for any given roll of n − 1 dice, let their sum be s . If s ≡ 0 m o d 5 , then no matter the result of rolling the last die, the total sum will not be divisible by 5 . Alternatively, if s ≡ 0 m o d 5 , then there will be exactly one outcome of rolling the last die in which the sum is divisible by 5 , namely when 5 − s is rolled. Therefore, there is a equivalence between the number of ways to roll n dice whose sum is divisible by 5 , and n − 1 dice whose sum is not divisible by 5 , and so P ( n ) = 4 n − 1 − P ( n − 1 ) .
Now, since there is exactly 1 way to roll 0 dice, and that sum is divisible by 5 , P ( 0 ) = 1 . Furthermore, P ( 1 ) = 4 0 − P ( 0 ) = 0 ; P ( 2 ) = 4 1 − P ( 1 ) = 4 ; P ( 3 ) = 4 2 − P ( 2 ) = 1 2 ; P ( 4 ) = 4 3 − P ( 3 ) = 5 2 ; P ( 5 ) = 4 4 − P ( 4 ) = 2 0 4 ; and P ( 6 ) = 4 5 − P ( 5 ) = 8 2 0 , as needed.
Let the number of throws of n dice that result in the sum on the n dice being a multiple of 5 be a n . Observe that, for n ≥ 2 , if the sum on the first n − 1 dice is a multiple of 5 , then the sum on the first n dice can never be a multiple of 5 , whatever the n t h dice shows. However, if the sum on the first n − 1 dice is not a multiple of 5 , then there is exactly one possibility for the n t h dice such that the sum on the first n dice to be a multiple of 5 . There are 4 n − 1 possibilities for the first n − 1 dice, so a n = 4 n − 1 − a n − 1 . Noting that a 1 = 0 , we may apply this recurrence relation to find a 2 , . . . , a 6 , so a 6 = 8 2 0 . Alternatively, we may prove by induction that a n = 5 4 n + 4 ( − 1 ) n , so a 6 = 8 2 0 .
To get a multiple of 5 from 6 four-sided dice, we need to get a sum of 10, 15 or 20,
To get 10, there are four different ways of choosing the 6 numbers:
{1,1,1,1,2,4} ..... 4 ! 6 ! = 30
{1,1,1,1,3,3} ..... 4 ! 2 ! 6 ! = 15
{1,1,1,2,2,3} ..... 3 ! 2 ! 6 ! = 60
{1,1,2,2,2,2} ..... 4 ! 2 ! 6 ! = 15
Note: the numbers calculated are distinct permutations of that particular set of numbers
To get 15, we have 8 sets:
{1,1,1,4,4,4} ..... 3 ! 3 ! 6 ! = 20
{1,1,2,3,4,4} ..... 2 ! 2 ! 6 ! = 180
{1,1,3,3,3,4} ..... 3 ! 2 ! 6 ! = 60
{1,2,2,3,3,4} ..... 2 ! 2 ! 6 ! = 180
{1,2,2,2,4,4} ..... 3 ! 2 ! 6 ! = 60
{1,2,3,3,3,3} ..... 4 ! 6 ! = 30
{2,2,2,2,3,4} ..... 4 ! 6 ! = 30
{2,2,2,3,3,3} ..... 3 ! 3 ! 6 ! = 20
To get 20, we have 4 sets,
{1,3,4,4,4,4} ..... 4 ! 6 ! = 30
{2,2,4,4,4,4} ..... 4 ! 2 ! 6 ! = 15
{2,3,3,4,4,4} ..... 3 ! 2 ! 6 ! = 60
{3,3,3,3,4,4} ..... 4 ! 2 ! 6 ! = 15
Adding them up, we get 4 × 1 5 + 2 × 2 0 + 4 × 3 0 + 4 × 6 0 + 2 × 1 8 0 = 8 2 0
Ex cellent
We can solve the problem as such:-
First find out all the possilble single arrangements i.e.
the arrangements are
111241 - 6!/4! 111313 - 6!/(4! 2!) 111322 - 6!/(3! 2!) 111444 - 6!/(3! 3!) 112344 - 6!/(2! 2!) 113343 - 6!/(2!*3!) . . . . . and as such all the possible outcomes and than adding them up like
24+15+60+20+180+60+....+...= 820 <===> ANSWER
Define x 1, x 2, x 3, x 4, x 5 as the number of different dice throws with sum congruent to 1,2,3,4,5 (mod 5), given x dice. We want to find 6 5.
Observe that:
1 1 = 1 2 = 1 3 = 1 4 = 1;
1_5 = 0
2 1 = 2 2 = 2 3 = 2 4 = 3
2_5 = 4
(writing out 2_i is unnecessary, but helps in seeing the pattern)
Let x 1 + x 2 + ... + x_5 = f(x)
Observe that f(x) = 4^x.
Note that :
x i = f(x-1) - (x-1) i
this also implies that x 1 = x 2 = x 3 = x 4 for all x.
Note that if x is odd, x 1 = x 5 + 1; if x is even, x 1 + 1 = x 5, by simple induction, as we have the base case for 1 dice throw and 2 dice throws (though 2 is unnecessary); and its easy to see that the induction step is true:
if x 1 = x 5 + 1,
(x+1) 1 = f(x) - x 1 = f(x) - x_5 - 1
(x+1) 5 = f(x) - x 5 = (x+1)_1 + 1
and similar reasoning for the even---> odd case.
thus 6_5 = ((4^6 - 1)/5) + 1 = 820
We solve this problem using generating functions. Consider f ( x ) = ( x + x 2 + x 3 + x 4 ) 6 . The number of ways to get a sum of N by throwing six 4-sided dice is equal to the coefficient of x N in f ( x ) . We are interested in the sum of all coefficients of x N , where N is a multiple of 5.
Let ω be a fifth root of unity, so ω 5 = 1 and ω 4 + ω 3 + ω 2 + ω + 1 = 0 . Then ω 4 k + ω 3 k + ω 2 k + ω k + 1 = { 5 0 if k ≡ 0 ( m o d 5 ) otherwise . Hence, the sum of all coefficients of x N , where N is a multiple of 5 is given by 5 f ( 1 ) + f ( ω ) + f ( ω 2 ) + f ( ω 3 ) + f ( ω 4 ) , which is equal to 5 4 6 + ( − 1 ) 6 + ( − 1 ) 6 + ( − 1 ) 6 + ( − 1 ) 6 = 8 2 0 .
Note: Students may guess the answer by looking at small cases, and realizing the answers are close to 5 4 k .
There are 4^6ways to get an arrangement of numbers from the dice. Each arrangement of dice will have a sum. Since we assume that one fifth of the rolls of the dice will be a multiple of five, then we know that is the solution (note, we used the ceiling function because we knew any remainder from division would still count as a roll.
Python:
1 2 3 4 5 6 7 |
|
The generating function is ( x 1 + x 2 + x 3 + x 4 ) 5 and if you expand this, the coefficient of x 1 0 is 120, the coefficient of x 1 5 is 580 and the coefficient of x 2 0 is 120. These are the only terms where the power of x is a multiple of 5 so the answer is 120+120+580= 8 2 0
There are 4 6 ways to get an arrangement of numbers from the dice. Each arrangement of dice will have a sum. Since we assume that one fifth of the rolls of the dice will be a multiple of five, then we know that ⌈ 5 4 6 ⌉ is the solution (note, we used the ceiling function because we knew any remainder from division would still count as a roll.
Problem Loading...
Note Loading...
Set Loading...
Note that the number of ways to throw n 4 sided dice such that the sum is a multiple of 5 is the same number of ways to throw n − 1 4 sided dice such that the sum is not a multiple of 5 because whenever the sum of the first n − 1 4 sided dice is not a multiple of 5, there is a specific roll for the last die so that the sum would be a multiple of 5, and when the sum of the first n − 1 4 sided dice is a multiple of 5, there would be no roll for the last die so that the sum would be a multiple of 5 as the possible rolls are 1, 2, 3 or 4.
Let the number of ways to roll x 4 sided dice such that the sum of the numbers on the dice is a multiple of 5 be f ( x ) . Note that we are looking for f ( 6 ) . Let g ( x ) be the number of ways to roll x 4 sided dice so that the sum is not a multiple of 5. We know that f ( x ) = g ( x − 1 ) and f ( x ) + g ( x ) = 4 x . This allows us to calculate that
f ( 1 ) = 0 , f ( 2 ) = 4 , f ( 3 ) = 1 2 , f ( 4 ) = 5 2 , f ( 5 ) = 2 0 4 , g ( 1 ) = 4 1 − 0 = 4 g ( 2 ) = 4 2 − 4 = 1 2 g ( 3 ) = 4 3 − 1 2 = 5 2 g ( 4 ) = 4 4 − 5 2 = 2 0 4 g ( 5 ) = 4 5 − 2 0 4 = 8 2 0
Hence, there are 820 different dice throws.
[Edits for clarity - Calvin]