{ "problem": "Rational numbers $a$ and $b$ are chosen at random among all rational numbers in the interval $[0,2)$ that can be written as fractions $\\frac{n}{d}$ where $n$ and $d$ are integers with $1 \\le d \\le 5$. What is the probability that \\[(\\text{cos}(a\\pi)+i\\text{sin}(b\\pi))^4\\]is a real number?", "level": "Level 4", "type": "Precalculus", "solution": "There are 20 possible values of $a$ and $b,$ namely\n\\[S = \\left\\{ 0, 1, \\frac{1}{2}, \\frac{3}{2}, \\frac{1}{3}, \\frac{2}{3}, \\frac{4}{3}, \\frac{5}{3}, \\frac{1}{4}, \\frac{3}{4}, \\frac{5}{4}, \\frac{7}{4}, \\frac{1}{5}, \\frac{2}{5}, \\frac{3}{5}, \\frac{4}{5}, \\frac{6}{5}, \\frac{7}{5}, \\frac{8}{5}, \\frac{9}{5} \\right\\}.\\]Let $x = \\cos a \\pi$ and $y = \\sin b \\pi.$ We want to see when\n\\[(x + yi)^4 = x^4 + 4ix^3 y - 6x^2 y^2 - 4ixy^3 + y^4\\]is real. This occurs exactly when $4x^3 y - 4xy^3 = 4xy(x^2 - y^2) = 0,$ so either $x = 0,$ $y = 0,$ $x = y,$ or $x = -y.$ In other words, $\\cos a \\pi = 0,$ $\\sin b \\pi = 0,$ $\\cos a \\pi = \\sin b \\pi,$ or $\\cos a \\pi = -\\sin b \\pi.$\n\nIf $\\cos a \\pi = 0,$ then $a = \\frac{1}{2}$ or $a = \\frac{3}{2},$ and $b$ can be any value in $S.$ This gives us 40 pairs $(a,b).$\n\nIf $\\sin b \\pi = 0,$ then $b = 0$ or $b = 1,$ and $a$ can be any value in $S.$ This gives us 40 pairs $(a,b),$ but the four pairs $\\left( \\frac{1}{2}, 0 \\right),$ $\\left( \\frac{1}{2}, 1 \\right),$ $\\left( \\frac{3}{2}, 0 \\right),$ and $\\left( \\frac{3}{2}, 1 \\right)$ have already been counted, so it gives us only 36 additional pairs.\n\nIf $\\cos a \\pi = \\sin b \\pi,$ then\n\\[\\cos a \\pi = \\cos \\left( \\frac{\\pi}{2} - b \\pi \\right),\\]which implies $a \\pi - \\left( \\frac{\\pi}{2} - b \\pi \\right) = 2 \\pi k$ for some integer $k,$ or $a \\pi + \\left( \\frac{\\pi}{2} - b \\pi \\right) = 2 \\pi k'$ for some integer $k'.$ These lead to $a + b - \\frac{1}{2} = 2k$ or $a - b + \\frac{1}{2} = 2k'.$ We have already counted the pairs where $b = 0$ or $b = 1,$ so we exclude these values. We can check that if the denominator of $b$ is 3 or 5, then there are no possible values of $a.$\n\nIf $b = \\frac{1}{2},$ then $a = 0$ for either equation. If $b = \\frac{3}{2},$ then $a = 1$ for either equation. Finally, we can check that if $b \\in \\left\\{ \\frac{1}{4}, \\frac{3}{4}, \\frac{5}{4}, \\frac{7}{4} \\right\\},$ then there is exactly one solution for $a$ for the equation $a + b - \\frac{1}{2} = 2k$ (which lies in $\\left\\{ \\frac{1}{4}, \\frac{3}{4}, \\frac{5}{4}, \\frac{7}{4} \\right\\}$), and one solution for $a$ for the equation $a - b + \\frac{1}{2} = 2k'$ (which lies in $\\left\\{ \\frac{1}{4}, \\frac{3}{4}, \\frac{5}{4}, \\frac{7}{4} \\right\\}$). Furthermore, if $a + b - \\frac{1}{2} = 2k$ and $a - b + \\frac{1}{2} = 2k',$ then subtracting these equations, we get\n\\[2b - 1 = 2k - 2k',\\]so $b = k - k' + \\frac{1}{2}.$ Thus, $b = \\frac{1}{2}$ or $b = \\frac{3}{2},$ and we count these values just once. This gives us $2 + 8 = 10$ pairs $(a,b).$\n\nSimilarly, if $\\cos a \\pi = -\\sin b \\pi,$ then\n\\[\\cos a \\pi = -\\sin b \\pi = \\sin (-b \\pi) = \\cos \\left( \\frac{\\pi}{2} + b \\pi \\right),\\]which implies $a \\pi - \\left( \\frac{\\pi}{2} + b \\pi \\right) = 2 \\pi k$ for some integer $k,$ or $a \\pi + \\left( \\frac{\\pi}{2} + b \\pi \\right) = 2 \\pi k'$ for some integer $k'.$ These lead to $a - b - \\frac{1}{2} = 2k$ or $a + b + \\frac{1}{2} = 2k'.$ We have already counted the pairs where $b = 0$ or $b = 1,$ so we exclude these values. We can check that if the denominator of $b$ is 3 or 5, then there are no possible values of $a.$\n\nIf $b = \\frac{1}{2},$ then $a = 1$ for either equation. If $b = \\frac{3}{2},$ then $a = 0$ for either equation. Finally, we can check that if $b \\in \\left\\{ \\frac{1}{4}, \\frac{3}{4}, \\frac{5}{4}, \\frac{7}{4} \\right\\},$ then there is exactly one solution for $a$ for the equation $a - b - \\frac{1}{2} = 2k$ (which lies in $\\left\\{ \\frac{1}{4}, \\frac{3}{4}, \\frac{5}{4}, \\frac{7}{4} \\right\\}$), and one solution for $a$ for the equation $a + b + \\frac{1}{2} = 2k'$ (which lies in $\\left\\{ \\frac{1}{4}, \\frac{3}{4}, \\frac{5}{4}, \\frac{7}{4} \\right\\}$). Furthermore, if $a - b - \\frac{1}{2} = 2k$ and $a + b + \\frac{1}{2} = 2k',$ then subtracting these equations, we get\n\\[2b + 1 = 2k' - 2k,\\]so $b = k' - k - \\frac{1}{2}.$ Thus, $b = \\frac{1}{2}$ or $b = \\frac{3}{2},$ and we count these values just once. We can also confirm that all of the pairs in this case are different from the pairs in the previous case. This gives us $2 + 8 = 10$ pairs $(a,b).$\n\nThus, there are a total of $40 + 36 + 10 + 10 = 96$ possible pairs $(a,b).$ There are $20^2 = 400$ ways to choose the pair $(a,b),$ which gives us a probability of $\\frac{96}{400} = \\boxed{\\frac{6}{25}}.$" }