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? $\textbf{(A)}\ \frac{3}{50} \qquad$ $\textbf{(B)}\ \frac{4}{25} \qquad$ $\textbf{(C)}\ \frac{41}{200} \qquad$ $\textbf{(D)}\ \frac{6}{25} \qquad$ $\textbf{(E)}\ \frac{13}{50}$
Solution
Write $z=x+iy$ with $x=\cos a\pi$, $y=\sin b\pi$. Then $z^4=(x^4-6x^2y^2+y^4)+4xy(x^2-y^2)i$, which is real iff $xy(x^2-y^2)=0$, i.e.\ $x=0$, or $y=0$, or $x^2=y^2$.
The allowed values in $[0,2)$ are $0,\frac12,\frac13,\frac23,\frac14,\frac34,\frac15,\frac25,\frac35,\frac45$ and these plus $1$: $20$ values for each of $a,b$, so $400$ equally likely pairs.
\emph{$x^2=y^2\ne0$.} Group the $a$'s by $|\cos a\pi|$: $|\cos a\pi|=1$ for $a=0,1$ (2 values); $\cos\frac\pi5=\frac{1+\sqrt5}4$ for $a=\frac15,\frac45,\frac65,\frac95$; $\frac{\sqrt2}2$ for $a=\frac14,\frac34,\frac54,\frac74$; $\frac12$ for $a=\frac13,\frac23,\frac43,\frac53$; $\cos\frac{2\pi}5=\frac{\sqrt5-1}4$ for $a=\frac25,\frac35,\frac75,\frac85$.
Group the $b$'s by $|\sin b\pi|$: $1$ for $b=\frac12,\frac32$ (2 values); $\frac{\sqrt2}2$ for $b=\frac14,\frac34,\frac54,\frac74$; $\frac{\sqrt3}2$ for $b=\frac13,\frac23,\frac43,\frac53$; $\sin\frac\pi5$ for $b=\frac15,\frac45,\frac65,\frac95$ and $\sin\frac{2\pi}5$ for $b=\frac25,\frac35,\frac75,\frac85$.
The two lists of values have only $1$ and $\frac{\sqrt2}2$ in common ($\frac{1+\sqrt5}4$, $\frac12$, $\frac{\sqrt5-1}4$ differ from $\sin\frac\pi5\approx0.588$, $\sin\frac{2\pi}5\approx0.951$, $\frac{\sqrt3}2$). This gives $2\cdot2+4\cdot4=20$ more pairs.
In total $76+20=96$ pairs, so the probability is $\frac{96}{400}=\frac6{25}$, answer (D).
Rational numbers $a,b$ are chosen at random among all rationals in $[0,2)$ writable as $n/d$ with $1\le d\le6$. What is the probability that $(\cos(a\pi)+i\sin(b\pi))^4$ is real?