Navvye/Olympiad-Problems-CSV huggingface dataset:
Problem: The figure is constructed from $11$ line segments, each of which has length $2$ . The area of pentagon $ABCDE$ can be written as $\sqrt{m} + \sqrt{n}$ , where $m$ and $n$ are positive integers. What is $m + n ?$ [asy] /* Made by samrocksnature */ pair A=(-2.4638,4.10658); pair B=(-4,2.6567453480756127); pair C=(-3.47132,0.6335248637894945); pair D=(-1.464483379039766,0.6335248637894945); pair E=(-0.956630463955801,2.6567453480756127); pair F=(-2,2); pair G=(-3,2); draw(A--B--C--D--E--A); draw(A--F--A--G); draw(B--F--C); draw(E--G--D); label("A",A,N); label("B",B,W); label("C",C,S); label("D",D,S); label("E",E,dir(0)); dot(A^^B^^C^^D^^E^^F^^G); [/asy]
$\textbf{(A)} ~20 \qquad\textbf{(B)} ~21 \qquad\textbf{(C)} ~22 \qquad\textbf{(D)} ~23 \qquad\textbf{(E)} ~24$

Solution: [asy] /* Made by samrocksnature, adapted by Tucker, then adjusted by samrocksnature again, then adjusted by erics118 xD*/ pair A=(-2.4638,4.10658); pair B=(-4,2.6567453480756127); pair C=(-3.47132,0.6335248637894945); pair D=(-1.464483379039766,0.6335248637894945); pair E=(-0.956630463955801,2.6567453480756127); pair F=(-1.85,2); pair G=(-3.1,2); draw(A--G--A--F, lightgray); draw(B--F--C, lightgray); draw(E--G--D, lightgray); dot(F^^G, lightgray); draw(A--B--C--D--E--A); draw(A--C--A--D); label("A",A,N); label("B",B,W); label("C",C,S); label("D",D,S); label("E",E,dir(0)); dot(A^^B^^C^^D^^E); [/asy]
Draw diagonals $AC$ and $AD$ to split the pentagon into three parts. We can compute the area for each triangle and sum them up at the end. For triangles $ABC$ and $ADE$ , they each have area $2\cdot\frac{1}{2}\cdot\frac{4\sqrt{3}}{4}=\sqrt{3}$ . For triangle $ACD$ , we can see that $AC=AD=2\sqrt{3}$ and $CD=2$ . Using Pythagorean Theorem, the altitude for this triangle is $\sqrt{11}$ , so the area is $\sqrt{11}$ . Adding each part up, we get $2\sqrt{3}+\sqrt{11}=\sqrt{12}+\sqrt{11} \implies \boxed{23}$

Answer: D 23
Problem: A square piece of paper has side length $1$ and vertices $A,B,C,$ and $D$ in that order. As shown in the figure, the paper is folded so that vertex $C$ meets edge $\overline{AD}$ at point $C'$ , and edge $\overline{BC}$ intersects edge $\overline{AB}$ at point $E$ . Suppose that $C'D = \frac{1}{3}$ . What is the perimeter of triangle $\bigtriangleup AEC' ?$
$\textbf{(A)} ~2 \qquad\textbf{(B)} ~1+\frac{2}{3}\sqrt{3} \qquad\textbf{(C)} ~\frac{13}{6} \qquad\textbf{(D)} ~1 + \frac{3}{4}\sqrt{3} \qquad\textbf{(E)} ~\frac{7}{3}$ [asy] /* Made by samrocksnature */ pair A=(0,1); pair CC=(0.666666666666,1); pair D=(1,1); pair F=(1,0.440062); pair C=(1,0); pair B=(0,0); pair G=(0,0.22005); pair H=(-0.13,0.41); pair E=(0,0.5); dot(A^^CC^^D^^C^^B^^E); draw(E--A--D--F); draw(G--B--C--F, dashed); fill(E--CC--F--G--H--E--CC--cycle, gray); draw(E--CC--F--G--H--E--CC); label("A",A,NW); label("B",B,SW); label("C",C,SE); label("D",D,NE); label("E",E,NW); label("C'",CC,N); label("F",F,NE); [/asy]

Solution: We can set the point on $CD$ where the fold occurs as point $F$ . Then, we can set $FD$ as $x$ , and $CF$ as $1-x$ because of symmetry due to the fold. It can be recognized that this is a right triangle, and solving for $x$ , we get,
\[x^2 + \left(\frac{1}{3}\right)^2 = (1-x)^2 \rightarrow x^2 + \frac{1}{9} = x^2 - 2x + 1 \rightarrow x=\frac{4}{9}\]
We know this is a 3-4-5 triangle because the side lengths are $\frac{3}{9}, \frac{4}{9}, \frac{5}{9}$ . We also know that $EAC'$ is similar to $C'DF$ because angle $EC'F$ is a right angle. Now, we can use similarity to find out that the perimeter is just the perimeter of $C'DF \times \frac{AC'}{DF}$ . That's just $\frac{4}{3} \times \frac{\frac{2}{3}}{\frac{4}{9}} = \frac{4}{3} \times \frac{3}{2} = 2$ . Therefore, the final answer is $\boxed{2}$

Answer: A 2
Problem: A square piece of paper has side length $1$ and vertices $A,B,C,$ and $D$ in that order. As shown in the figure, the paper is folded so that vertex $C$ meets edge $\overline{AD}$ at point $C'$ , and edge $\overline{BC}$ intersects edge $\overline{AB}$ at point $E$ . Suppose that $C'D = \frac{1}{3}$ . What is the perimeter of triangle $\bigtriangleup AEC' ?$
$\textbf{(A)} ~2 \qquad\textbf{(B)} ~1+\frac{2}{3}\sqrt{3} \qquad\textbf{(C)} ~\frac{13}{6} \qquad\textbf{(D)} ~1 + \frac{3}{4}\sqrt{3} \qquad\textbf{(E)} ~\frac{7}{3}$ [asy] /* Made by samrocksnature */ pair A=(0,1); pair CC=(0.666666666666,1); pair D=(1,1); pair F=(1,0.440062); pair C=(1,0); pair B=(0,0); pair G=(0,0.22005); pair H=(-0.13,0.41); pair E=(0,0.5); dot(A^^CC^^D^^C^^B^^E); draw(E--A--D--F); draw(G--B--C--F, dashed); fill(E--CC--F--G--H--E--CC--cycle, gray); draw(E--CC--F--G--H--E--CC); label("A",A,NW); label("B",B,SW); label("C",C,SE); label("D",D,NE); label("E",E,NW); label("C'",CC,N); label("F",F,NE); [/asy]

Solution: Let the line we're reflecting over be $\ell$ , and let the points where it hits $AB$ and $CD$ , be $M$ and $N$ , respectively. Notice, to reflect over a line we find the perpendicular passing through the midpoint of the two points (which are the reflected and the original). So, we first find the equation of the line $\ell$ . The segment $CC'$ has slope $\frac{0 - 1}{1 - 2/3} = -3$ , implying line $\ell$ has a slope of $\frac{1}{3}$ . Also, the midpoint of segment $CC'$ is $\left( \frac{5}{6}, \frac{1}{2} \right)$ , so line $\ell$ passes through this point. Then, we get the equation of line $\ell$ is simply $y = \frac{1}{3} x + \frac{2}{9}$ . Then, if the point where $B$ is reflected over line $\ell$ is $B'$ , then we get $BB'$ is the line $y = -3x$ . The intersection of $\ell$ and segment $BB'$ is $\left( - \frac{1}{15}, \frac{1}{5} \right)$ . So, we get $B' = \left(- \frac{2}{15}, \frac{2}{5} \right)$ . Then, line segment $B'C'$ has equation $y = \frac{3}{4} x + \frac{1}{2}$ , so the point $E$ is the $y$ -intercept, or $\left(0, \frac{1}{2} \right)$ . This implies that $AE = \frac{1}{2}, AC' = \frac{2}{3}$ , and by the Pythagorean Theorem, $EC' = \frac{5}{6}$ (or you could notice $\triangle AEC'$ is a $3-4-5$ right triangle). Then, the perimeter is $\frac{1}{2} + \frac{2}{3} + \frac{5}{6} = 2$ , so our answer is $\boxed{2}$ . ~rocketsri

Answer: A 2
Problem: A square piece of paper has side length $1$ and vertices $A,B,C,$ and $D$ in that order. As shown in the figure, the paper is folded so that vertex $C$ meets edge $\overline{AD}$ at point $C'$ , and edge $\overline{BC}$ intersects edge $\overline{AB}$ at point $E$ . Suppose that $C'D = \frac{1}{3}$ . What is the perimeter of triangle $\bigtriangleup AEC' ?$
$\textbf{(A)} ~2 \qquad\textbf{(B)} ~1+\frac{2}{3}\sqrt{3} \qquad\textbf{(C)} ~\frac{13}{6} \qquad\textbf{(D)} ~1 + \frac{3}{4}\sqrt{3} \qquad\textbf{(E)} ~\frac{7}{3}$ [asy] /* Made by samrocksnature */ pair A=(0,1); pair CC=(0.666666666666,1); pair D=(1,1); pair F=(1,0.440062); pair C=(1,0); pair B=(0,0); pair G=(0,0.22005); pair H=(-0.13,0.41); pair E=(0,0.5); dot(A^^CC^^D^^C^^B^^E); draw(E--A--D--F); draw(G--B--C--F, dashed); fill(E--CC--F--G--H--E--CC--cycle, gray); draw(E--CC--F--G--H--E--CC); label("A",A,NW); label("B",B,SW); label("C",C,SE); label("D",D,NE); label("E",E,NW); label("C'",CC,N); label("F",F,NE); [/asy]

Solution: Assume that E is the midpoint of $\overline{AB}$ . Then, $\overline{AE}=\frac{1}{2}$ and since $C'D=\frac{1}{3}$ $\overline{AC'}=\frac{2}{3}$ . By the Pythagorean Theorem, $\overline{EC'}=\frac{5}{6}$ . It easily follows that our desired perimeter is $\boxed{2}$ ~samrocksnature

Answer: A 2
Problem: A square piece of paper has side length $1$ and vertices $A,B,C,$ and $D$ in that order. As shown in the figure, the paper is folded so that vertex $C$ meets edge $\overline{AD}$ at point $C'$ , and edge $\overline{BC}$ intersects edge $\overline{AB}$ at point $E$ . Suppose that $C'D = \frac{1}{3}$ . What is the perimeter of triangle $\bigtriangleup AEC' ?$
$\textbf{(A)} ~2 \qquad\textbf{(B)} ~1+\frac{2}{3}\sqrt{3} \qquad\textbf{(C)} ~\frac{13}{6} \qquad\textbf{(D)} ~1 + \frac{3}{4}\sqrt{3} \qquad\textbf{(E)} ~\frac{7}{3}$ [asy] /* Made by samrocksnature */ pair A=(0,1); pair CC=(0.666666666666,1); pair D=(1,1); pair F=(1,0.440062); pair C=(1,0); pair B=(0,0); pair G=(0,0.22005); pair H=(-0.13,0.41); pair E=(0,0.5); dot(A^^CC^^D^^C^^B^^E); draw(E--A--D--F); draw(G--B--C--F, dashed); fill(E--CC--F--G--H--E--CC--cycle, gray); draw(E--CC--F--G--H--E--CC); label("A",A,NW); label("B",B,SW); label("C",C,SE); label("D",D,NE); label("E",E,NW); label("C'",CC,N); label("F",F,NE); [/asy]

Solution: As described in Solution 1, we can find that $DF=\frac{4}{9}$ , and $C'F = \frac{5}{9}.$
Then, we can find we can find the length of $\overline{AE}$ by expressing the length of $\overline{EF}$ in two different ways, in terms of $AE$ . If let $AE = a$ , by the Pythagorean Theorem we have that $EC = \sqrt{a^2 + \left(\frac{2}{3}\right)^2} = \sqrt{a^2 + \frac{4}{9}}.$ Therefore, since we know that $\angle EC'F$ is right, by Pythagoras again we have that $EF = \sqrt{\left(\sqrt{a^2+\frac{4}{9}}\right)^2 + \left(\frac{5}{9}\right)^2} = \sqrt{a^2 + \frac{61}{81}}.$
Another way we can express $EF$ is by using Pythagoras on $\triangle XEF$ , where $X$ is the foot of the perpendicular from $F$ to $\overline{AE}.$ We see that $ADFX$ is a rectangle, so we know that $AD = 1 = FX$ . Secondly, since $FD = \frac{4}{9}, EX = a - \frac{4}{9}$ . Therefore, through the Pythagorean Theorem, we find that $EF = \sqrt{\left(a-\frac{4}{9}\right)^2 + 1^2} = \sqrt{a^2 - \frac{8}{9}a +\frac{97}{81}}.$
Since we have found two expressions for the same length, we have the equation $\sqrt{a^2 + \frac{61}{81}} = \sqrt{a^2 - \frac{8}{9}a +\frac{97}{81}}.$ Solving this, we find that $a=\frac{1}{2}$
Finally, we see that the perimeter of $\triangle AEC'$ is $\frac{1}{2} + \frac{2}{3} + \sqrt{\left(\frac{1}{2}\right)^2 + \frac{4}{9}},$ which we can simplify to be $2$ . Thus, the answer is $\boxed{2}.$ ~laffytaffy

Answer: A 2
Problem: A square piece of paper has side length $1$ and vertices $A,B,C,$ and $D$ in that order. As shown in the figure, the paper is folded so that vertex $C$ meets edge $\overline{AD}$ at point $C'$ , and edge $\overline{BC}$ intersects edge $\overline{AB}$ at point $E$ . Suppose that $C'D = \frac{1}{3}$ . What is the perimeter of triangle $\bigtriangleup AEC' ?$
$\textbf{(A)} ~2 \qquad\textbf{(B)} ~1+\frac{2}{3}\sqrt{3} \qquad\textbf{(C)} ~\frac{13}{6} \qquad\textbf{(D)} ~1 + \frac{3}{4}\sqrt{3} \qquad\textbf{(E)} ~\frac{7}{3}$ [asy] /* Made by samrocksnature */ pair A=(0,1); pair CC=(0.666666666666,1); pair D=(1,1); pair F=(1,0.440062); pair C=(1,0); pair B=(0,0); pair G=(0,0.22005); pair H=(-0.13,0.41); pair E=(0,0.5); dot(A^^CC^^D^^C^^B^^E); draw(E--A--D--F); draw(G--B--C--F, dashed); fill(E--CC--F--G--H--E--CC--cycle, gray); draw(E--CC--F--G--H--E--CC); label("A",A,NW); label("B",B,SW); label("C",C,SE); label("D",D,NE); label("E",E,NW); label("C'",CC,N); label("F",F,NE); [/asy]

Solution: Draw a perpendicular line from $\overline{AB}$ at $E$ , and let it intersect $\overline{DC}$ at $E'$ . The angle between $\overline{AB}$ and $\overline{EE'}$ is $2\theta$ , where $\theta$ is the angle between the fold and a line perpendicular to $\overline{AD}$ . The slope of the fold is $\frac{1}{3}$ because it is perpendicular to $\overline{CC'}$ $\overline{CC'}$ has a slope of $-3$ using points $C'$ and $C$ , and perpendicular lines have slopes negative inverses of each other). Using tangent double angle formula, the slope of $\overline{EC'}$ is $\frac{3}{4}$ , which implies $\overline{AE}$ $\frac{1}{2}$ . By the Pythagorean Theorem, $\overline{EC'}=\frac{5}{6}$ . It easily follows that our desired perimeter is $\boxed{2}$ ~forrestc

Answer: A 2
Problem: A square piece of paper has side length $1$ and vertices $A,B,C,$ and $D$ in that order. As shown in the figure, the paper is folded so that vertex $C$ meets edge $\overline{AD}$ at point $C'$ , and edge $\overline{BC}$ intersects edge $\overline{AB}$ at point $E$ . Suppose that $C'D = \frac{1}{3}$ . What is the perimeter of triangle $\bigtriangleup AEC' ?$
$\textbf{(A)} ~2 \qquad\textbf{(B)} ~1+\frac{2}{3}\sqrt{3} \qquad\textbf{(C)} ~\frac{13}{6} \qquad\textbf{(D)} ~1 + \frac{3}{4}\sqrt{3} \qquad\textbf{(E)} ~\frac{7}{3}$ [asy] /* Made by samrocksnature */ pair A=(0,1); pair CC=(0.666666666666,1); pair D=(1,1); pair F=(1,0.440062); pair C=(1,0); pair B=(0,0); pair G=(0,0.22005); pair H=(-0.13,0.41); pair E=(0,0.5); dot(A^^CC^^D^^C^^B^^E); draw(E--A--D--F); draw(G--B--C--F, dashed); fill(E--CC--F--G--H--E--CC--cycle, gray); draw(E--CC--F--G--H--E--CC); label("A",A,NW); label("B",B,SW); label("C",C,SE); label("D",D,NE); label("E",E,NW); label("C'",CC,N); label("F",F,NE); [/asy]

Solution: It is easy to prove that the ratio of the sum of the larger leg and hypotenuse to the smaller leg depends monotonically on the angle of a right triangle, which means: \[C' F + DF = CF + DF = CD = AD = 3 C'D \implies C' D : DF : C' F = 3 : 4 : 5.\]
For a similar triangle, the ratio of the perimeter to the larger leg is $\frac {3 + 4 +5}{4} = 3.$
$\triangle AEC'  \sim \triangle DC'F \implies$ the perimeter of triangle $\bigtriangleup AEC'$ is $3 AC' = \boxed{2}.$

Answer: A 2
Problem: Ang, Ben, and Jasmin each have $5$ blocks, colored red, blue, yellow, white, and green; and there are $5$ empty boxes. Each of the people randomly and independently of the other two people places one of their blocks into each box. The probability that at least one box receives $3$ blocks all of the same color is $\frac{m}{n}$ , where $m$ and $n$ are relatively prime positive integers. What is $m + n ?$
$\textbf{(A)} ~47 \qquad\textbf{(B)} ~94 \qquad\textbf{(C)} ~227 \qquad\textbf{(D)} ~471 \qquad\textbf{(E)} ~542$

Solution: Let our denominator be $(5!)^3$ , so we consider all possible distributions.
We use PIE (Principle of Inclusion and Exclusion) to count the successful ones.
When we have at $1$ box with all $3$ balls the same color in that box, there are $_{5} C _{1} \cdot _{5} P _{1} \cdot (4!)^3$ ways for the distributions to occur ( $_{5} C _{1}$ for selecting one of the five boxes for a uniform color, $_{5} P _{1}$ for choosing the color for that box, $4!$ for each of the three people to place their remaining items).
However, we overcounted those distributions where two boxes had uniform color, and there are $_{5} C _{2} \cdot _{5} P _{2} \cdot (3!)^3$ ways for the distributions to occur ( $_{5} C _{2}$ for selecting two of the five boxes for a uniform color, $_{5} P _{2}$ for choosing the color for those boxes, $3!$ for each of the three people to place their remaining items).
Again, we need to re-add back in the distributions with three boxes of uniform color... and so on so forth.
Our success by PIE is \[_{5} C _{1} \cdot _{5} P _{1} \cdot (4!)^3 - _{5} C _{2} \cdot _{5} P _{2} \cdot (3!)^3 + _{5} C _{3} \cdot _{5} P _{3} \cdot (2!)^3 - _{5} C _{4} \cdot _{5} P _{4} \cdot (1!)^3 + _{5} C _{5} \cdot _{5} P _{5} \cdot (0!)^3 = 120 \cdot 2556.\] \[\frac{120 \cdot 2556}{120^3}=\frac{71}{400},\] yielding an answer of $\boxed{471}$

Answer: D 471
Problem: Ang, Ben, and Jasmin each have $5$ blocks, colored red, blue, yellow, white, and green; and there are $5$ empty boxes. Each of the people randomly and independently of the other two people places one of their blocks into each box. The probability that at least one box receives $3$ blocks all of the same color is $\frac{m}{n}$ , where $m$ and $n$ are relatively prime positive integers. What is $m + n ?$
$\textbf{(A)} ~47 \qquad\textbf{(B)} ~94 \qquad\textbf{(C)} ~227 \qquad\textbf{(D)} ~471 \qquad\textbf{(E)} ~542$

Solution: As In Solution 1, the probability is \[\frac{\binom{5}{1}\cdot 5\cdot (4!)^3 - \binom{5}{2}\cdot 5\cdot 4\cdot (3!)^3 + \binom{5}{3}\cdot 5\cdot 4\cdot 3\cdot (2!)^3 - \binom{5}{4}\cdot 5\cdot 4\cdot 3\cdot 2\cdot (1!)^3 + \binom{5}{5}\cdot 5\cdot 4\cdot 3\cdot 2\cdot 1}{(5!)^3}\] \[= \frac{5\cdot 5\cdot (4!)^3 - 10\cdot 5\cdot 4\cdot (3!)^3 + 10\cdot 5\cdot 4\cdot 3\cdot (2!)^3 - 5\cdot 5! + 5!}{(5!)^3}.\] Dividing by $5!$ , we get \[\frac{5\cdot (4!)^2 - 10\cdot (3!)^2 + 10\cdot (2!)^2 - 5 + 1}{(5!)^2}.\] Dividing by $4$ , we get \[\frac{5\cdot 6\cdot 24 - 10\cdot 9 + 10 - 1}{30\cdot 120}.\] Dividing by $9$ , we get \[\frac{5\cdot 2\cdot 8 - 10 + 1}{10\cdot 40} = \frac{71}{400} \implies \boxed{471}\]

Answer: D 471
Problem: Ang, Ben, and Jasmin each have $5$ blocks, colored red, blue, yellow, white, and green; and there are $5$ empty boxes. Each of the people randomly and independently of the other two people places one of their blocks into each box. The probability that at least one box receives $3$ blocks all of the same color is $\frac{m}{n}$ , where $m$ and $n$ are relatively prime positive integers. What is $m + n ?$
$\textbf{(A)} ~47 \qquad\textbf{(B)} ~94 \qquad\textbf{(C)} ~227 \qquad\textbf{(D)} ~471 \qquad\textbf{(E)} ~542$

Solution: Use complementary counting. 
Denote $T_n$ as the total number of ways to put $n$ colors to $n$ boxes by 3 people out of which $f_n$ ways are such that no box has uniform color. Notice $T_n = (n!)^3$ . From this setup we see the question is asking for $1-\frac{f_5}{(5!)^3}$ . To find $f_5$ we want to exclude the cases of a) one box of the same color, b) 2 boxes of the same color, c) 3 boxes of same color, d) 4 boxes of the same color, and e) 5 boxes of the same color. Cases d) and e) coincide. From this, we have
\[f_5=T_5 -{\binom{5}{1}\binom{5}{1}\cdot f_4 - \binom{5}{2}\binom{5}{2}\cdot 2!\cdot f_3 - \binom{5}{3}\binom{5}{3}\cdot 3!\cdot f_2 - 5!}\]
In case b), there are $\binom{5}{2}$ ways to choose 2 boxes that have the same color, $\binom{5}{2}$ ways to choose the two colors, 2! ways to permute the 2 chosen colors, and $f_3$ ways so that the remaining 3 boxes don’t have the same color. The same goes for cases a) and c). In case e), the total number of ways to permute 5 colors is $5!$ . Now, we just need to calculate $f_2$ $f_3$ and $f_4$
We have $f_2=T_2-2 = (2!)^3 - 2 = 6$ , since we subtract the number of cases where the boxes contain uniform colors, which is 2.
In the same way, $f_3=T_3-\Big[3!+ \binom{3}{1}\binom{3}{1}\cdot f_2 \Big] = 156$ - again, we must subtract the number of ways at least 1 box has uniform color. There are $3!$ ways if 3 boxes each contains uniform color. Two boxes each contains uniform color is the same as previous. If one box has the same color, there are $\binom{3}{1}$ ways to pick a box, and $\binom{3}{1}$ ways to pick a color for that box, 1! ways to permute the chosen color, and $f_2$ ways for the remaining 2 boxes to have non-uniform colors. Similarly, $f_4=(4!)^3-\Big[ 4!+ \binom{4}{2}\binom{4}{2}\cdot 2! \cdot f_2+ \binom{4}{1}\binom{4}{1}\cdot f_3\Big] = 10,872$
Thus, $f_5 = f_5=(5!)^3-\Big[\binom{5}{1}\binom{5}{1}\cdot f_4+ \binom{5}{2}\binom{5}{2}\cdot 2!\cdot f_3+\binom{5}{3}\binom{5}{3}\cdot 3!\cdot f_2 + 5!\Big] = (5!)^3 - 306,720$
Thus, the probability is $\frac{306,720}{(5!)^3} = 71/400$ and the answer is $\boxed{471}$

Answer: D 471
Problem: Ang, Ben, and Jasmin each have $5$ blocks, colored red, blue, yellow, white, and green; and there are $5$ empty boxes. Each of the people randomly and independently of the other two people places one of their blocks into each box. The probability that at least one box receives $3$ blocks all of the same color is $\frac{m}{n}$ , where $m$ and $n$ are relatively prime positive integers. What is $m + n ?$
$\textbf{(A)} ~47 \qquad\textbf{(B)} ~94 \qquad\textbf{(C)} ~227 \qquad\textbf{(D)} ~471 \qquad\textbf{(E)} ~542$

Solution: WLOG fix which block Ang places into each box. (This can also be thought of as labeling each box by the color of Ang's block.) There are then $(5!)^2$ total possibilities.
As in Solution 1 , we use PIE. With $1$ box of uniform color, there are ${}_{5} C _{1} \cdot (4!)^2$ possibilities ( ${}_{5} C _{1}$ for selecting one of the five boxes (whose color is fixed by Ang), $4!$ for each of Ben and Jasmin to place their remaining items). We overcounted cases with $2$ boxes, of which there are ${}_{5} C _{2} \cdot (3!)^2$ possibilities, and so on.
The probability is thus \[\frac{{}_{5} C _{1} \cdot (4!)^2 - {}_{5} C _{2} \cdot (3!)^2 + {}_{5} C _{3} \cdot (2!)^2 - {}_{5} C _{4} \cdot (1!)^2 + {}_{5} C _{5} \cdot (0!)^2}{(5!)^2}\] \[= \frac{5 \cdot (4!)^2 - 10 \cdot (3!)^2 + 10 \cdot (2!)^2 - 5 + 1}{(5!)^2}\] at which point we can proceed as in #Alternate simplification to simplify to $\frac{71}{400} \implies \boxed{471}$

Answer: D 471
Problem: Ang, Ben, and Jasmin each have $5$ blocks, colored red, blue, yellow, white, and green; and there are $5$ empty boxes. Each of the people randomly and independently of the other two people places one of their blocks into each box. The probability that at least one box receives $3$ blocks all of the same color is $\frac{m}{n}$ , where $m$ and $n$ are relatively prime positive integers. What is $m + n ?$
$\textbf{(A)} ~47 \qquad\textbf{(B)} ~94 \qquad\textbf{(C)} ~227 \qquad\textbf{(D)} ~471 \qquad\textbf{(E)} ~542$

Solution: $!n$ denotes the number of derangements of $n$ elements, i.e. the number of permutations where no element appears in its original position. Recall the recursive formula $!0 = 1, !1 = 0, !n = (n-1)(!(n-1)+{!}(n-2))$
We will consider the number of candidate boxes (ones that currently remain uniform-color) after each person places their blocks.
After Ang, all $5$ boxes are candidates, and each has a fixed color its blocks must be to remain uniform-color.
Ben has $5!$ total ways to place blocks. There are $\tbinom{5}{k}\cdot{!}k$ ways to disqualify $k$ candidates, $0 \le k \le 5$ . (There are $\tbinom{5}{k}$ ways to choose the candidates to disqualify, and $!k$ ways to arrange the disqualified candidates' same-color blocks.)
Jasmin has $5!$ total ways to place blocks. Currently, $k$ boxes are no longer candidates. Consider the number of ways for Jasmin to place blocks such that no box remains a candidate, where $n$ is the number of boxes and $k$ is the number of non-candidates, and call it $D(n,k)$ (not to be confused with partial derangements). We wish to find $5!-D(5,k)$ for each $k$ $0 \le k \le 5$
Notice that $D(n,0) = {!}n$ , since all boxes are candidates and no block can be placed in the same-colored box. Also notice the recursive formula $D(n,k) = D(n-1,k-1)+D(n,k-1)$ , since the first non-candidate box can either contain its same-color block (in which case it can be ignored), or a different-color block (in which case it can be treated as a candidate).
We can make a table ( $n$ horizontal, $k$ vertical): \[\begin{array}{r|rrrrrr} D(n,k) & 0 & 1 & 2 & 3 & 4 & 5 \\ \hline 0 & 1 & 0 & 1 & 2 & 9 & 44 \\ 1 & & 1 & 1 & 3 & 11 & 53 \\ 2 & & & 2 & 4 & 14 & 64 \\ 3 & & & & 6 & 18 & 78 \\ 4 & & & & & 24 & 96 \\ 5 & & & & & & 120 \\ \end{array}\] (Note that $D(n,n) = n!$ since there are no candidates to begin with, which checks out with the diagonal.)
The desired values of $D(5,k)$ are in the rightmost column.
The probability that at least one box is of uniform color is thus \begin{align*} & \frac{\sum_{k=0}^{5}{\left(\binom{5}{k}\cdot{!}k\right)(5!-D(5,k))}}{(5!)^2} \\ ={}& \frac{(1\cdot1)(120-44)+(5\cdot0)(120-53)+(10\cdot1)(120-64)+(10\cdot2)(120-78)+(5\cdot9)(120-96)+(1\cdot44)(120-120)}{(5!)^2} \\ ={}& \frac{76+0+560+840+1080+0}{(5!)^2} \\ ={}& \frac{19+140+210+270}{(5!)(5\cdot3\cdot2)} \\ ={}& \frac{639}{(5!)(5\cdot3\cdot2)} \\ ={}& \frac{71}{(5\cdot4\cdot2)(5\cdot2)} \\ ={}& \frac{71}{400} \implies \boxed{471}

Answer: D 471