Thomae's function
View on Wikipedia

Thomae's function is a real-valued function of a real variable that can be defined as:[1]: 531
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.
Properties
[edit]- Thomae's function is bounded and maps all real numbers to the unit interval:
- is periodic with period for all integers n and all real x.
Proof of periodicity
For all we also have and hence
For all there exist and such that and Consider . If divides and , it divides and . Conversely, if divides and , it divides and . So , and .
- is discontinuous at every rational number, so its points of discontinuity are dense within the real numbers.
Proof of discontinuity at rational numbers
Let be an arbitrary rational number, with and and coprime.
This establishes
Let be any irrational number and define for all
These are all irrational, and so for all
This implies and
Let , and given let For the corresponding we have and
which is exactly the definition of discontinuity of at .
- is continuous at every irrational number, so its points of continuity are dense within the real numbers.
Proof of continuity at irrational arguments
Since is periodic with period and it suffices to check all irrational points in Assume now and According to the Archimedean property of the reals, there exists with and there exist such that
for we have
The minimal distance of to its i-th lower and upper bounds equals
We define as the minimum of all the finitely many so that for all and
This is to say, all these rational numbers are outside the -neighborhood of
Now let with the unique representation where are coprime. Then, necessarily, and therefore,
Likewise, for all irrational and thus, if then any choice of (sufficiently small) gives
Therefore, is continuous on
- is nowhere differentiable.
Proof of being nowhere differentiable
- For rational numbers, this follows from non-continuity.
- For irrational numbers:
- For any sequence of irrational numbers with for all that converges to the irrational point , the sequence is identically , and so .
- On the other hand, consider the sequence of rational numbers with , where denotes the floor of . Since , the sequence converges to using the Squeeze theorem. Also, for all .
- Thus for all , . Therefore we obtain and so is not differentiable at any irrational number .
- has a proper local maximum at each rational number, providing an example of a function with a dense set of proper local maxima.[5] See the proofs for continuity and discontinuity above for the construction of appropriate neighbourhoods, where has maxima.
- is Riemann integrable on any interval and the integral evaluates to over any set. The Lebesgue criterion for integrability states that a bounded function is Riemann integrable if and only if the set of all discontinuities has measure zero.[6] Every countable subset of the real numbers - such as the rational numbers - has measure zero, so the above discussion shows that Thomae's function is Riemann integrable on any interval. The function's integral is equal to over any set because the function is equal to zero almost everywhere.
- If is the graph of the restriction of to , then the box-counting dimension of is .[7]
Related probability distributions
[edit]Empirical probability distributions related to Thomae's function appear in DNA sequencing.[8] 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 . In the case of uniform distributions on the set , which is very similar to Thomae's function.[8]
The ruler function
[edit]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, ... (sequence A007814 in the OEIS). 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, ... (sequence A001511 in the OEIS). 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
[edit]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 Fσ set. If such a function existed, then the irrationals would be an Fσ 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 Fσ 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
[edit]- Blumberg theorem
- Cantor function
- Dirichlet function
- Euclid's orchard – Thomae's function can be interpreted as a perspective drawing of Euclid's orchard
- Volterra's function
References
[edit]- ^ Beanland, Kevin; Roberts, James W.; Stevenson, Craig (2009). "Modifications of Thomae's Function and Differentiability". The American Mathematical Monthly. 116 (6): 531–535. doi:10.4169/193009709x470425. JSTOR 40391145.
- ^ Dunham, William (2008). The Calculus Gallery: Masterpieces from Newton to Lebesgue. Princeton: Princeton University Press. page 149, chapter 10. ISBN 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.
- ^ John Conway. "Topic: Provenance of a function". The Math Forum. Archived from the original on 13 June 2018.
- ^ Thomae, J. (1875). Einleitung in die Theorie der bestimmten Integrale (in German). Halle a/S: Verlag von Louis Nebert. p. 14, §20.
- ^ Perfetti, Paolo (Fall 2006). "Solution to Problem 1129". Problem Department. Pi Mu Epsilon Journal. 12 (5): 301–319. JSTOR 24337958. Perfetti supplies the negation of Thomae's function as an example with a dense set of proper local minima.
- ^ Spivak, M. (1965). Calculus on manifolds. Perseus Books. page 53, Theorem 3-8. ISBN 978-0-8053-9021-6.
- ^ Chen, Haipeng; Fraser, Jonathan M.; Yu, Han (2022). "Dimensions of the popcorn graph". Proceedings of the American Mathematical Society. 150 (11): 4729–4742. arXiv:2007.08407. doi:10.1090/proc/15729.
- ^ a b 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. arXiv:1010.4328. Bibcode:2011NatSR...1E.191T. doi:10.1038/srep00191. PMC 3240948. PMID 22355706.
Further reading
[edit]- Abbott, Stephen (2016). Understanding Analysis (Softcover reprint of the original 2nd ed.). New York: Springer. ISBN 978-1-4939-5026-3.
- Bartle, Robert G.; Sherbert, Donald R. (1999). Introduction to Real Analysis (3rd ed.). Wiley. ISBN 978-0-471-32148-4. (Example 5.1.6 (h))
External links
[edit]Thomae's function
View on GrokipediaDefinition and Background
Formal Definition
Thomae's function, also known as the popcorn function or raindrop function, is defined on the closed interval with codomain .[6] The function is given byHistorical Context
Thomae's function was introduced by the German mathematician Carl Johannes Thomae in his 1875 textbook Einleitung in die Theorie der bestimmten Integrale, where it served as an illustrative example in the development of Riemann's theory of integration.[9] Thomae presented the function on page 14, section 20, highlighting its behavior amid discussions of integrability for functions exhibiting discontinuities. This work reflected Thomae's broader contributions to function theory, influenced by his time in Göttingen, where he intended to study under Bernhard Riemann but completed his doctorate under Friedrich Schering, and by his studies under Karl Weierstrass earlier in his career.[3] The function appeared during a period of intense exploration in 19th-century German mathematics, particularly in the rigorous analysis of discontinuous functions and the foundations of real integration following Riemann's 1854 habilitation lecture. Thomae's example contributed to ongoing debates about the boundaries of Riemann integrability, building on earlier work by Dirichlet and others on pointwise discontinuities, though it received limited contemporary attention beyond pedagogical contexts. Over time, the function acquired several alternative names reflecting its distinctive graphical features or connections to prior examples. These include the "popcorn function," due to the spiky, kernel-like appearance of its graph; the "raindrop function," evoking inverted droplets; and the "modified Dirichlet function," acknowledging its relation to Peter Gustav Lejeune Dirichlet's 1829 discontinuous example.[10] In English-language texts, particularly from the mid-20th century onward, such as in real analysis textbooks by authors like Stephen Abbott, these informal names gained traction alongside "Thomae's function" to emphasize its role in teaching continuity and integrability.[11] Despite its enduring value as a counterexample in real analysis, Thomae's function has not undergone extensive historical scrutiny, functioning mainly as a concise pedagogical device rather than a focal point of major theoretical advancement.Core Properties
Continuity Behavior
Thomae's function exhibits a distinctive continuity behavior: it is continuous at every irrational number in the interval and discontinuous at every rational number in that interval.[5] This property arises from the function's definition, where for irrational and for rational in lowest terms with , highlighting the interplay between the density of rationals and irrationals in the reals.[1] To establish continuity at an irrational point , note that . For any , select an integer , so . In the bounded interval , there are only finitely many rationals with denominator at most in reduced form, say . Let , excluding zero since is irrational. Then, for , if is irrational, ; if is rational in lowest terms, then , so . Thus, , proving continuity at . The density of irrationals ensures such neighborhoods are nonempty, while the finite exclusion of low-denominator rationals controls the function values.[5][1] For discontinuity at a rational point in lowest terms with , . Consider any ; the interval contains irrationals (by density of irrationals) where , so . Choosing , no such satisfies for all , as the irrationals force the difference to reach . Alternatively, any sequence of irrationals converging to has , so the limit at is 0, differing from . The density of rationals ensures neighborhoods also contain other rationals where approaches 0, but the jump at prevents continuity.[5][1] Thomae's function serves as a standard example of a function continuous precisely at the irrationals in but nowhere differentiable, as the oscillatory behavior near rationals disrupts differentiability even at irrationals.[12]Riemann Integrability
A bounded function on a closed interval is Riemann integrable if and only if the set of its points of discontinuity has Lebesgue measure zero. For Thomae's function on , the points of discontinuity are precisely the rational numbers in this interval, which form a countable set.[13] Every countable set of real numbers has Lebesgue measure zero, as it can be covered by open intervals of arbitrarily small total length.[14] Thus, the set of discontinuities of has measure zero, implying that is Riemann integrable on .[15] The Riemann integral of Thomae's function over equals zero: .[13] To see this, consider the Darboux upper and lower sums for any partition of . The lower sum is always zero, since every subinterval contains irrational points where , so the infimum of on each subinterval is zero.[15] For the upper sum , given , choose a positive integer such that . The set consists of the finitely many rationals in with denominator at most in lowest terms; let . Construct a partition by isolating each point in within a subinterval of length less than centered at that point (adjusting endpoints if necessary to fit within ), and filling the remaining subintervals arbitrarily. In these isolating subintervals, the supremum of is at most 1, so their total contribution to is less than . In the remaining subintervals, the supremum of is less than , and their total length is at most 1, so their contribution is less than . Thus, .[13] Since is arbitrary and for all , the upper and lower integrals coincide at 0, confirming the integral value.[15] In contrast, the Dirichlet function if is rational and if is irrational is not Riemann integrable on , as it is discontinuous at every point in , so its set of discontinuities is the entire interval, which has positive Lebesgue measure.[15] For any partition of , the upper sum (since every subinterval contains rationals) while (since every subinterval contains irrationals), so the upper and lower integrals do not agree.[16]Examples and Illustrations
Specific Function Values
Thomae's function assigns the value 1 to the endpoints of its domain, as $ f(0) = f(1) = 1 $, corresponding to the representations $ 0/1 $ and $ 1/1 $ in lowest terms. For other rational points in (0,1), the function value decreases as the denominator in lowest terms increases; for instance, $ f(1/2) = 1/2 $, $ f(1/3) = 1/3 $, $ f(2/3) = 1/3 $, $ f(1/4) = 1/4 $, $ f(3/4) = 1/4 $, and $ f(2/5) = 1/5 $. This reflects the function's dependence on the denominator $ q $ of the reduced fraction $ p/q $, where $ \gcd(p,q)=1 $ and $ q > 0 $. Importantly, fractions not in lowest terms are evaluated after reduction; for example, $ 2/4 $ simplifies to $ 1/2 $, so $ f(2/4) = 1/2 $ rather than $ 1/4 $. At irrational points, Thomae's function is uniformly zero, regardless of the point's location in [0,1]. Examples include $ f(\sqrt{2}/2) = 0 $ (where $ \sqrt{2}/2 \approx 0.707 $) and $ f(\pi - 3) = 0 $ (where $ \pi - 3 \approx 0.142 $). The following table illustrates function values at all rational points in [0,1] with denominators $ q = 1 $ to $ 5 $ in lowest terms, highlighting how higher denominators yield smaller values and introduce greater sparsity in the set of such points.| $ x $ (decimal approx.) | Reduced form $ p/q $ | $ f(x) $ |
|---|---|---|
| 0 | 0/1 | 1 |
| 1/5 (0.2) | 1/5 | 1/5 |
| 1/4 (0.25) | 1/4 | 1/4 |
| 1/3 (≈0.333) | 1/3 | 1/3 |
| 2/5 (0.4) | 2/5 | 1/5 |
| 1/2 (0.5) | 1/2 | 1/2 |
| 3/5 (0.6) | 3/5 | 1/5 |
| 2/3 (≈0.667) | 2/3 | 1/3 |
| 3/4 (0.75) | 3/4 | 1/4 |
| 4/5 (0.8) | 4/5 | 1/5 |
| 1 | 1/1 | 1 |