Problem 855: (2024 AIME I, 12)
Define $f(x)=|| x|-\tfrac{1}{2}|$ and $g(x)=|| x|-\tfrac{1}{4}|$. Find the number of intersections of the graphs of $y=4g(f(\sin (2 \pi x)))$ and $x=4g(f(\cos (3 \pi y)))$.
- Both $h(x)=4g(f(\sin2\pi x))$ and $k(y)=4g(f(\cos3\pi y))$ take values in $[0,1]$, so all intersections lie in the unit square.
- As $x$ goes from $0$ to $1$, $|\sin2\pi x|$ makes $2$ full sweeps and each of $f$, $g$ doubles the number of sweeps: $h$ runs between $0$ and $1$ in $16$ monotone pieces. Similarly $k$, with $3$ half-periods, runs between $0$ and $1$ in $24$ monotone pieces.
- Each piece of one graph crosses each piece of the other once, $16\cdot24=384$, and there is one more intersection at the corner $(1,1)$, where both graphs have a steep piece.
- The total is $385$. The answer is $\boxed{385}$.
Define $f(x)=|| x|-\tfrac{1}{2}|$ and $g(x)=|| x|-\tfrac{1}{4}|$. Find the number of intersections of the graphs of $y=4g(f(\sin (2 \pi x)))$ and $x=4g(f(\cos (5 \pi y)))$.