Thomae's function, named after Carl Johannes Thomae, has many names: the popcorn function, the raindrop function, the countable cloud function, the modified Dirichlet function, the ruler function, the Riemann function, or the Stars over Babylon (John Horton Conway's name). This real-valued function f(x) of the real variable x is defined as:
:f(x) =
\begin{cases}
\frac{1}{q} &\text{if }x\text{ is rational, }x=\tfrac{p}{q}\text{ in lowest terms and } q > 0\\
0 &\text{if }x\text{ is irrational.}
\end{cases}
It is a modification of the Dirichlet function, (which is 1 at ratio...