Thomae's function explained
Thomae's function is a real-valued function of a real variable that can be defined as:[1]
It is named after Carl Johannes Thomae, but has many other names: the popcorn function, the raindrop function, the countable cloud function, the modified Dirichlet function, the ruler function (not to be confused with the integer ruler function),[2] the Riemann function, or the Stars over Babylon (John Horton Conway's name).[3] Thomae mentioned it as an example for an integrable function with infinitely many discontinuities in an early textbook on Riemann's notion of integration.[4]
Since every rational number has a unique representation with coprime (also termed relatively prime)
and
, the function is
well-defined. Note that
is the only number in
that is coprime to
It is a modification of the Dirichlet function, which is 1 at rational numbers and 0 elsewhere.
Related probability distributions
Empirical probability distributions related to Thomae's function appear in DNA sequencing.[5] The human genome is diploid, having two strands per chromosome. When sequenced, small pieces ("reads") are generated: for each spot on the genome, an integer number of reads overlap with it. Their ratio is a rational number, and typically distributed similarly to Thomae's function.
If pairs of positive integers
are sampled from a distribution
and used to generate ratios
, this gives rise to a distribution
on the rational numbers. If the integers are independent the distribution can be viewed as a
convolution over the rational numbers,
. Closed form solutions exist for
power-law distributions with a cut-off. If
(where
is the
polylogarithm function) then
g(a/(a+b))=(ab)-\alphaLi2\alpha(e-(a+b)\beta
(e-\beta)
. In the case of uniform distributions on the set
g(a/(a+b))=(1/L2)\lfloorL/max(a,b)\rfloor
, which is very similar to Thomae's function.
The ruler function
See main article: Ruler function. For integers, the exponent of the highest power of 2 dividing
gives 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, ... . If 1 is added, or if the 0s are removed, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, ... . The values resemble tick-marks on a 1/16th
graduated ruler, hence the name. These values correspond to the restriction of the Thomae function to the
dyadic rationals: those rational numbers whose denominators are powers of 2.
Related functions
A natural follow-up question one might ask is if there is a function which is continuous on the rational numbers and discontinuous on the irrational numbers. This turns out to be impossible. The set of discontinuities of any function must be an set. If such a function existed, then the irrationals would be an set. The irrationals would then be the countable union of closed sets , but since the irrationals do not contain an interval, neither can any of the
. Therefore, each of the
would be nowhere dense, and the irrationals would be a
meager set. It would follow that the real numbers, being the union of the irrationals and the rationals (which, as a countable set, is evidently meager), would also be a meager set. This would contradict the
Baire category theorem: because the reals form a
complete metric space, they form a
Baire space, which cannot be meager in itself.
A variant of Thomae's function can be used to show that any subset of the real numbers can be the set of discontinuities of a function. If is a countable union of closed sets
, define
Then a similar argument as for Thomae's function shows that
has
A as its set of discontinuities.
See also
Further reading
Notes and References
- Beanland . Kevin . Roberts . James W. . Stevenson . Craig . 2009 . Modifications of Thomae's Function and Differentiability . . 116 . 6 . 531–535 . 40391145 . 10.4169/193009709x470425.
- Book: Dunham, William . William Dunham (mathematician) . 2008 . [{{Google books|aYTYBQAAQBAJ|The Calculus Gallery|page=149|plainurl=yes}} The Calculus Gallery: Masterpieces from Newton to Lebesgue ]. Princeton University Press . Princeton . 978-0-691-13626-4 . "...the so-called ruler function, a simple but provocative example that appeared in a work of Johannes Karl Thomae ... The graph suggests the vertical markings on a ruler—hence the name." . page 149, chapter 10.
- Web site: Topic: Provenance of a function . John Conway . The Math Forum . https://web.archive.org/web/20180613235037/mathforum.org/kb/message.jspa?messageID=1375516 . 13 June 2018.
- Book: Thomae, J. . 1875 . Einleitung in die Theorie der bestimmten Integrale . Verlag von Louis Nebert . Halle a/S . german . p. 14, §20.
- Trifonov . Vladimir . Pasqualucci . Laura . Dalla-Favera . Riccardo . Rabadan . Raul . 2011 . Fractal-like Distributions over the Rational Numbers in High-throughput Biological and Clinical Data . Scientific Reports . 1 . 191 . 191 . 10.1038/srep00191 . 22355706 . 3240948. 1010.4328 . 2011NatSR...1E.191T .