Skip to content

Dirichlet Function

Definition

The Dirichlet function is the indicator function of the rational numbers, defined by

f(x)=𝟙1Q(x)={ 1,if x∈Q, 0,if x∉Q.f(x)=\indicator_{\mathbb{Q}}(x)=\begin{cases} \displaystyle \,1,& \text{if }x\in\mathbb{Q},\\[2pt] \displaystyle \,0,& \text{if }x\notin\mathbb{Q}. \end{cases}

If the input xx is a rational number, the output of the Dirichlet function is 1;1\text{;} otherwise, if the input xx is an irrational number, the output of the Dirichlet function is 0.0\text{.}


Interpretation

The Dirichlet function provides a fundamental example of extreme irregularity. It sorts real numbers into rational and irrational ones, giving the value 11 to the first kind and 00 to the second.

The irregularity comes from how the two kinds are mixed: every interval (a,b)(a,b) with a<ba<b, however short, contains both rational and irrational numbers. So close to any point xx, the function takes both values 00 and 11, and its values never settle down near xx. A sketch of the graph as two horizontal lines y=0y=0 and y=1y=1 is misleading: each of these "lines" has gaps between any two of its points.

The function is the indicator function of Q\mathbb{Q}. Later it serves as the standard example of a function that is continuous at no point, and of a bounded function that is not Riemann integrable.


Key Results


Examples

  • On any nondegenerate interval, rational and irrational inputs are densely interwoven, preventing continuity.
  • Any neighbourhood contains points where the function value jumps between 00 and 1.1\text{.}

Prerequisites

Sources

Keywords: nowhere continuous function Symbols: element of, rational numbers

Last updated: 20 October 2026 03:02