返回题库

AIME 2019 II · 第 4 题

AIME 2019 II — Problem 4

专题
Contest Math
难度
L4
来源
AIME

题目详情

Problem

A standard six-sided fair die is rolled four times. The probability that the product of all four numbers rolled is a perfect square is mn\tfrac{m}{n}, where mm and nn are relatively prime positive integers. Find m+nm+n.

解析

Solution 1

Notice that, other than the number 5, the remaining numbers 1, 2, 3, 4, 6 are only divisible by 2 and/or 3. We can do some cases on the number of 5's rolled (note that there are 64=12966^4 = 1296 outcomes).

Case 1 (easy): Four 5's are rolled. This has probability 164\frac{1}{6^4} of occurring.

Case 2: Two 5's are rolled.

Case 3: No 5's are rolled.

To find the number of outcomes for the latter two cases, we will use recursion. Consider a 5-sided die with faces numbered 1, 2, 3, 4, 6. For n1n \ge 1, let ana_n equal the number of outcomes after rolling the die nn times, with the property that the product is a square. Thus, a1=2a_1 = 2 as 1 and 4 are the only possibilities.

To find an+1a_{n+1} given ana_n (where n1n \ge 1), we observe that if the first nn rolls multiply to a perfect square, then the last roll must be 1 or 4. This gives 2an2a_n outcomes. Otherwise, the first nn rolls do not multiply to a perfect square (5nan5^n - a_n outcomes). In this case, we claim that the last roll is uniquely determined (either 2, 3, or 6). If the product of the first nn rolls is 2x3y2^x 3^y where xx and yy are not both even, then we observe that if xx and yy are both odd, then the last roll must be 6; if only xx is odd, the last roll must be 2, and if only yy is odd, the last roll must be 3. Thus, we have 5nan5^n - a_n outcomes in this case, and an+1=2an+(5nan)=5n+ana_{n+1} = 2a_n + (5^n - a_n) = 5^n + a_n.

Computing a2a_2, a3a_3, a4a_4 gives a2=7a_2 = 7, a3=32a_3 = 32, and a4=157a_4 = 157. Thus for Case 3, there are 157 outcomes. For case 2, we multiply a2a_2 by (42)=6\binom{4}{2} = 6 to distribute the two 5's among four rolls. Thus the probability is

1+67+15764=20064=25162    m+n=187\frac{1 + 6 \cdot 7 + 157}{6^4} = \frac{200}{6^4} = \frac{25}{162} \implies m+n = \boxed{187} -scrabbler94

Solution 2

We can solve this without finding the amount of cases. Notice when we roll a 1 or a 4, it does not affect whether or not the product is a square number. We have a 1/3 chance of rolling either a 1 or 4. We have a 2/3 chance of rolling a 2,3,5 or 6. Let's call rolling 1 or 4 rolling a dud (a perfect square).

Probability of rolling 4 duds: (13)4\left(\frac{1}{3}\right)^4

Probability of rolling 3 duds: 4(13)3234 * \left(\frac{1}{3}\right)^3 * \frac{2}{3}

Probability of rolling 2 duds: 6(13)2(23)26 * \left(\frac{1}{3}\right)^2 * \left(\frac{2}{3}\right)^2

Probability of rolling 1 dud: 413(23)34 * \frac{1}{3} * \left(\frac{2}{3}\right)^3

Probability of rolling 0 duds: (23)4\left(\frac{2}{3}\right)^4

Now we will find the probability of a square product given we have rolled each amount of duds

Probability of getting a square product given 4 duds: 1

Probability of getting a square product given 3 duds: 0 (you will have 1 non-dud and that's never going to be square)

Probability of getting a square product given 2 duds: 14\frac{1}{4} (as long as our two non-duds are the same, our product will be square)

Probability of getting a square product given 1 dud: 3!43\frac{3!}{4^3} = 332\frac{3}{32} (the only way to have a square product is rolling a 2,3 and 6. There are 3! ways of doing that and a total of 434^3 ways to roll 3 non-duds).

Probability of getting a square product given 0 duds: 4044\frac{40}{4^4}= 532\frac{5}{32} (We can have any two non-duds twice. For example, 2,2,5,5. There are (42)=6\binom{4}{2} = 6 ways of choosing which two non-duds to use and (42)=6\binom{4}{2} = 6 ways of choosing how to arrange those 4 numbers. That gives us 6*6=36 combinations. We can also have 2,2,2,2 or 3,3,3,3 or 5,5,5,5 or 6,6,6,6. This gives us a total of 40 combinations).

We multiply each probability of rolling k duds with the probability of getting a square product given k duds and then sum all the values.

(13)41+4(13)3230+6(13)2(23)214+413(23)3332+(23)4532=25162.\left(\frac{1}{3}\right)^4 * 1 + 4 * \left(\frac{1}{3}\right)^3 * \frac{2}{3} * 0 + 6 * \left(\frac{1}{3}\right)^2 * \left(\frac{2}{3}\right)^2 * \frac{1}{4} + 4 * \frac{1}{3} * \left(\frac{2}{3}\right)^3 * \frac{3}{32} + \left(\frac{2}{3}\right)^4 * \frac{5}{32} = \frac{25}{162}. 25+16225+162 = 187\boxed{187}

-dnaidu (silverlizard)

Solution 3

Note that rolling a 1/4 will not affect whether or not the product is a perfect square. This means that in order for the product to be a perfect square, all non 1/4 numbers rolled must come in pairs, with the only exception being the triplet 2,3, 6. Now we can do casework:

If there are four 1/4's, then there are 24=162^4=16 combinations. If there are three 1/4's, then there are 0 combinations, because the fourth number isn't a square. If there are two 1/4's, there are 22=42^2=4 ways to choose the two 1/4's, 4 ways to choose the remaining pair of numbers, and 4!2!2!=6\frac{4!}{2!2!}=6 ways to arrange, so there are 446=964\cdot 4\cdot 6=96 combinations for this case. If there is one 1/4, then there are 2 ways to choose whether it is a 1 or 4, and the remaining three numbers must be 2, 3, and 6, so there are 4!4! ways to order, meaning there are 24!=482\cdot 4!=48 combinations for this case. Our final case is if there are no 1/4's, in which case we must have two pairs. If the two pairs are of different numbers, then there (42)\binom{4}{2} to choose the numbers and 4!2!2!=6\frac{4!}{2!2!}=6 ways to arrange them, so 66=366\cdot 6=36. If all four numbers are the same there are 44 combinations, so there are 4+36=404+36=40 combinations for this case.

Hence there are 16+0+96+48+40=20016+0+96+48+40=200 combinations where the product of the dice is a perfect square, and there are 64=12966^4=1296 total combinations, so the desired probability is 2001296=25162\frac{200}{1296}=\frac{25}{162}, yielding an answer of 25+162=18725+162=\boxed{187}.

-Stormersyle

Solution 4 (Casework)

Another way to solve this problem is to do casework on all the perfect squares from 121^2 to 36236^2, and how many ways they can be ordered 121^2- 1,1,1,11,1,1,1- 11 way. 222^2- 4,1,1,14,1,1,1 or 2,2,1,12,2,1,1- (42)+4=10\binom{4}{2}+4=10 ways. 323^2- 3,3,1,13,3,1,1- (42)=6\binom{4}{2}=6 ways. 424^2- 4,4,1,14,4,1,1, 2,2,2,22,2,2,2, or 2,2,4,12,2,4,1- (42)+1+12=19\binom{4}{2}+1+12=19 ways. 525^2- 5,5,1,15,5,1,1- (42)=6\binom{4}{2}=6 ways. 626^2- 6,6,1,16,6,1,1, 1,2,3,61,2,3,6, 2,3,2,32,3,2,3, 3,3,4,13,3,4,1- 2(42)+4!+12=482*\binom{4}{2}+4!+12=48 ways. 727^2- Since there is a prime greater than 6 in its prime factorization there are 00 ways. 828^2- 4,4,4,14,4,4,1 or 2,4,2,42,4,2,4- (42)+4=10\binom{4}{2}+4=10 ways. 929^2- 3,3,3,33,3,3,3- 11 way. 10210^2- 2,2,5,52,2,5,5 or 1,4,5,51,4,5,5- 6+12=186+12=18 ways. 11211^2- 00 ways for the same reason as 727^2. 12212^2- 6,6,2,26,6,2,2, 4,4,3,34,4,3,3, 2,3,4,62,3,4,6, or 1,4,6,61,4,6,6- 2(42)+4!+12=482*\binom{4}{2}+4!+12=48 ways. 13213^2- 00 ways. 14214^2- 00 ways. 15215^2- 3,3,5,53,3,5,5- (42)=6\binom{4}{2}=6 ways. 16216^2- 4,4,4,44,4,4,4- 11 way. 17217^2- 00 ways. 18218^2- 3,3,6,63,3,6,6- (42)=6\binom{4}{2}=6 ways. 19219^2- 00 ways. 20220^2- 4,4,5,54,4,5,5- (42)=6\binom{4}{2}=6 ways. 21221^2- 00 ways. 22222^2- 00 ways. 23223^2- 00 ways. 24224^2-4,4,6,64,4,6,6- (42)=6\binom{4}{2}=6 ways. 25225^2- 5,5,5,55,5,5,5- 11 way. 26226^2- 00 ways. 27227^2- 00 ways. 28228^2- 00 ways. 29229^2- 00 ways. 30230^2- 5,5,6,65,5,6,6- (42)\binom{4}{2} ways. 31231^2- 00 ways. 32232^2- 00 ways. 33233^2- 00 ways. 34234^2- 00 ways. 35235^2- 00 ways. 36236^2- 6,6,6,66,6,6,6- 11 way.

There are 64=12966^4=1296 ways that the dice can land. Summing up the ways, it is easy to see that there are 200200 ways. This results in a probability of 2001296=25162    187\frac{200}{1296}=\frac{25}{162}\implies\boxed{187} -superninja2000

Solution 5 (Recursion)

We can do recursion on the number of rolls to find the number of ways we can get 44 rolls to multiply to a square.

After nn rolls, let us say that the product is p=2a3b5cp = 2^a3^b5^c.

Define the following:

An=A_{n} = the number of ways to have a product after nn rolls where aa is odd, and bb, cc are even

Bn=B_{n} = the number of ways to have a product after nn rolls where bb is odd, and aa, cc are even

Cn=C_{n} = the number of ways to have a product after nn rolls where cc is odd, and aa, bb are even

Dn=D_{n} = the number of ways to have a product after nn rolls where cc is even, and aa, bb are odd

En=E_{n} = the number of ways to have a product after nn rolls where bb is even, and aa, cc are odd

Fn=F_{n} = the number of ways to have a product after nn rolls where aa is even, and bb, cc are odd

Gn=G_{n} = the number of ways to have a product after nn rolls where a,b,a, b, and cc are all odd

Sn=S_{n} = the number of ways to have a product after nn rolls where a,b,a, b, and cc are all even (square!)

We have the following equations after considering the possible values of the nth roll:

An=Sn1+Bn1+Dn1+En1+2An1A_{n} = S_{n-1}+B_{n-1}+D_{n-1}+E_{n-1}+2A_{n-1} Bn=An1+Dn1+Fn1+Sn1+2Bn1B_{n} = A_{n-1}+D_{n-1}+F_{n-1}+S_{n-1}+2B_{n-1} Cn=Sn1+En1+Fn1+Gn1+2Cn1C_{n} = S_{n-1}+E_{n-1}+F_{n-1}+G_{n-1}+2C_{n-1} Dn=Sn1+An1+Bn1+Gn1+2Dn1D_{n} = S_{n-1}+A_{n-1}+B_{n-1}+G_{n-1}+2D_{n-1} En=An1+Cn1+Fn1+Gn1+2En1E_{n} = A_{n-1}+C_{n-1}+F_{n-1}+G_{n-1}+2E_{n-1} Fn=Bn1+En1+Cn1+Gn1+2Fn1F_{n} = B_{n-1}+E_{n-1}+C_{n-1}+G_{n-1}+2F_{n-1} Gn=Cn1+Dn1+Fn1+En1+2Gn1G_{n} = C_{n-1}+D_{n-1}+F_{n-1}+E_{n-1}+2G_{n-1} Sn=An1+Cn1+Bn1+Dn1+2Sn1S_{n} = A_{n-1}+C_{n-1}+B_{n-1}+D_{n-1}+2S_{n-1} We have the following values after considering the possible values of the 1st roll:

A1=B1=C1=D1=1;E1=F1=G1=0;S1=2A_1 = B_1 = C_1 = D_1 = 1; E_1 = F_1 = G_1 = 0; S_1 = 2 After applying recursion twice, we get:

A2=B2=D2=6,C2=4,E2=F2=G2=2,S2=8A_2 = B_2 = D_2 = 6, C_2 = 4, E_2 = F_2 = G_2 = 2, S_2 = 8 A3=B3=D3=34,C3=22,E3=F3=G3=18,S3=38A_3 = B_3 = D_3 = 34, C_3 = 22, E_3 = F_3 = G_3 = 18, S_3 = 38 Finally, we have S4=200S_4 = 200, mn=2001296=25162\frac{m}{n} = \frac{200}{1296} = \frac{25}{162}meaning our answer is 187\boxed{187}.

Solution 6

Consider all the distinct "fundamental" groups of integers from 11 to 66 whose product is a perfect square. A "fundamental" group is one that cannot be broken into two smaller groups that each have a perfect square product. For example, {2,2}\{2,2\} is a fundamental group, while {3,3,4}\{3,3,4\} is not, because it can be broken up into {3,3}\{3,3\} and {4}\{4\}.

11 and 44 are already perfect squares, so they each form a "fundamental" group and cannot belong in any other group. Pairs of the other 44 numbers ({2,2}\{2,2\},{3,3}\{3,3\}, etc. ) form "fundamental" groups as well. The last "fundamental" group is {2,3,6}\{2,3,6\}. It can be easily seen that no more groups exist.

Thus, we have the "fundamental" groups {1}\{1\},{4}\{4\},{2,2}\{2,2\},{3,3}\{3,3\},{5,5}\{5,5\},{6,6}\{6,6\}, and {2,3,6}\{2,3,6\}.

We now consider the ways to use these groups to form a sequence of 44 numbers whose product is a perfect square. To form a set, we can simply select zero to two groups of size 22 or 33 and fill in any remaining spots with 11s and 44s. We can do this in one of 55 ways: Using only 11s and 44s, using one group of size 22, using one group of size 33, using two different groups of size 22, and using the same group of size 22 twice.

If we only use 11s and 44s, each of the 44 slots can be filled with one of the 22 numbers, so there are 24=162^4=16 possibilities.

If we use one group of size 22, there are 44 options for the group to use, (42)\binom{4}{2} ways to place the two numbers (since they are identical), and 222^2 ways to fill in the remaining slots with 11s and 44s, so there are 4(42)22=964\cdot\binom{4}{2}\cdot2^2=96 possibilities.

If we use one group of size 33, there is only 11 option for the group to use, 4324\cdot3\cdot2 ways to place the three numbers (since they are distinct), and 22 ways to fill in the remaining slot, so there are 4322=484\cdot3\cdot2\cdot2=48 possibilities.

If we use two different groups of size 22, there are (42)\binom{4}{2} options for the groups to use and (42)\binom{4}{2} ways to place the four numbers (since there are 22 groups of identical numbers, and one group's placement uniquely determines the other's), so there are (42)(42)=36\binom{4}{2}\cdot\binom{4}{2}=36 possibilities.

If we use the same group of size 22 twice, there are 44 options for the group to use and 11 way to place the four numbers (since they are all identical), so there are 4=44=4 possibilities.

This gives us a total of 16+96+48+36+4=20016+96+48+36+4=200 possibilities, and since there are 64=12966^4=1296 total sequences that can be rolled, the probability is equal to 2001296=25162\frac{200}{1296}=\frac{25}{162}, so the answer is 25+162=18725+162=\boxed{187}. ~emerald_block

Solution 7(Generating functions)

Let's look at the prime factorization of some of these rolls:

01 => 2^0*3^0*5^0
02 => 2^1*3^0*5^0
03 => 2^0*3^1*5^0
04 => 2^2*3^0*5^0
05 => 2^0*3^0*5^1
06 => 2^1*3^1*5^0

Now, using multi-variable generating functions, we get:

f(x,y,z)=1+x+y+x^2+z+xy
           | |
          \| |/
           'v'
f(x,y,z)=1+x+y+z+x^2+xy
  =(for our purposes)
      =2+x+y+z+xy

Let's square that!

4+2x+2y+2z+2xy+2x+x^2+xy+xz+x^2y+2y+xy+y^2+yz+xy^2+2z+xz+yz+z^2+xyz+2xy+x^2y+xy^2+xyz+x^2y^2
Combining like terms . . .
4+4x+4y+4z+x^2+y^2+z^2+6xy+2xz+2yz+2xyz+2x^2y+2xy^2+x^2y^2

Since we only want the parity of each of the exponents, we can collapse it again.

8+6x+6y+4z+6xy+2xz+2yz+2xyz

Last simplification: factor out a factor of two and save it for later.

4+3x+3y+2z+3xy+xz+yz+xyz

Let's take a better approach this time.

___ term :4*4+3*3+3*3+2*2+3*3+1*1+1*1+1*1=16+09+09+04+09+01+01+01=50
__x term :4*3+3*4+3*3+2*1+3*3+1*2+1*1+1*1=12+12+09+02+09+02+01+01=48
__y term :4*3+3*3+3*4+2*1+3*3+1*1+1*2+1*1=12+09+12+02+09+01+02+01=48
__z term :4*2+3*1+3*1+2*4+3*1+1*3+1*3+1*3=08+03+03+08+03+03+03+03=34
_xy term :4*3+3*3+3*3+2*1+3*4+1*1+1*1+1*2=12+09+09+02+12+01+01+02=48
_xz term :4*1+3*2+3*1+2*3+3*1+1*4+1*3+1*3=04+06+03+06+03+04+03+03=32
_yz term :4*1+3*1+3*2+2*3+3*1+1*3+1*4+1*3=04+03+06+06+03+03+04+03=32
xyz term :4*1+3*1+3*1+2*3+3*2+1*3+1*3+1+4=04+03+03+06+06+03+03+04=32

Result: 50+48x+48y+34z+48xy+32xz+32yz+32xyz

I know we could use vectors and dot products to make it look neater but come on. It already looks neat enough. Also, we didn't need the other parts, but it just looks nicer. Now let's stick back the two that turned into a four.

200+192x+192y+136z+192xy+128xz+128yz+128xyz

We seek the constant term which is 200. 200/1296=100/648=50/324=25/162, 25+162=187

~ Afly (talk)

Solution 8

There are a total of 64=12966^4=1296 possible die rolls.

We use casework:

Case 1: All 4 numbers are the same. There are obviously 66 ways.

Case 2: Sets of 2 different numbers.

A set of two different numbers is basically (x,x,y,y)(x,x,y,y) . There are a total of 4!2!2!=6\frac{4!}{2!\cdot 2!}=6 ways to arrange the numbers.

By listing these cases, we quickly see a pattern:

(1,1,2,2)(1,1,2,2) (1,1,3,3)(1,1,3,3) ...... (1,1,6,6)(1,1,6,6) (2,2,3,3)(2,2,3,3) ...... (2,2,6,6)(2,2,6,6) ...... (5,5,6,6)(5,5,6,6)

There are a total of 5+4+3+2+1=155+4+3+2+1=15 cases. Multiplying this by 66 yields 156=9015\cdot 6=90 ways.

Case 3: Sets of numbers in the form of (x,x,1,4)(x,x,1,4)

A special case must be made for the number 44 because 44 itself is a perfect square.

(1,1,1,4)(1,1,1,4) 44

(2,2,1,4)(2,2,1,4) 1212

(3,3,1,4)(3,3,1,4) 1212

(4,4,1,4)(4,4,1,4) 44

(5,5,1,4)(5,5,1,4) 1212

(6,6,1,4)(6,6,1,4) 1212

Summing these up yields a total of 4+12+12+4+12+12=564+12+12+4+12+12=56 ways.

Case 4: Sets with all 4 numbers different

Note that the sets

(1,2,3,6)(1,2,3,6) (2,3,4,6)(2,3,4,6)

Multiply to perfect square. The total of these cases are 24+24=4824+24=48.

Adding all these cases together yields 6+90+56+48=2006+90+56+48=200 ways that the product of the values of the die can be a perfect square.

Therefore the probability is

2001296=25162\frac{200}{1296}=\frac{25}{162} m+n=25+162=187m+n = 25+162 = \boxed{187}

-elchen3_f

Solution 9 (Clean Generating Functions and Roots of Unity Filter)

Recall that a number is a perfect square iff every prime in its prime factorization has even multiplicity. We can use multi-variable generating functions to track the contribution of each prime (namely 2, 3, 5) in one roll. Let f(a,b,c)f(a,b,c) be the generating function such that the coefficient of each term axbycza^xb^yc^z is the number of ways to get a product of 2x3y5z2^x3^y5^z when rolling 4 dice. For each roll, we can either roll a 1 (basically contribute nothing), roll a 2 (contribute a factor of 2), roll a 3 (contribute a factor of 3), roll a 4 (contribute two factors of 2), roll a 5 (contribute a factor of 5), or roll a 6 (contribute a factor of 2 and a factor of 3), so the generating function for one roll is 1+a+b+a2+c+ab1+a+b+a^2+c+ab. Hence, f(a,b,c)=(1+a+b+a2+c+ab)4f(a,b,c)= (1+a+b+a^2+c+ab)^4. We seek the sum of coefficients of the a2pb2qc2ra^{2p}b^{2q}c^{2r} terms (p,q,r,Z)(p, q, r, \in \mathbb{Z}*). \newline

To filter out the desired coefficients, apply Roots of Unity filter 3 times. Filter out the coefficients with even aa multiplicity using

f(1,b,c)+f(1,b,c)2=(3+2b+c)4+(c+1)42=g(b,c).\frac{f(1, b, c)+f(-1, b, c)}{2}=\frac{(3+2b+c)^4+(c+1)^4}{2}=g(b,c). Similarly, now filter out the coefficients with even bb multiplicity with

g(1,c)+g(1,c)2=(c+5)4+3(c+1)44=h(c).\frac{g(1, c)+g(-1, c)}{2}=\frac{(c+5)^4+3(c+1)^4}{4}=h(c). Apply this one more time to get

h(1)+h(1)2=64+3(2)4+448.\frac{h(1)+h(-1)}{2}=\frac{6^4+3(2)^4+4^4}{8}. The requested probability is 64+3(2)4+44864=25162    187.\frac{6^4+3(2)^4+4^4}{8\cdot 6^4}=\frac{25}{162} \implies \boxed{187}.

~bomberdoodles