Pathological cases - Dirichlet function
Categories: limits calculus
The Dirichlet function has the strange property that it is nowhere continuous. The function is defined for every possible value of x, but the function is not continuous anywhere on the number line. It is a piecewise function defined by:
The stylised letter Q represents the set of rational numbers, so this function takes the value 1 if x is rational, and 0 if x is irrational. It is sometimes called the indicator function of the set of rational numbers, written as:
Despite its appearance, this is a function!
Properties of the real number line
Every real number is either rational or irrational. A rational number can be expressed as the ratio of two integers, for example 1/3 or 17/100. An irrational number cannot be expressed as the ratio of two integers. Well-known examples of irrational numbers are the square root of 2 and the mathematical constant π. But of course, there are infinitely many irrational numbers that don't have special names.
The real numbers are often represented by a line. This diagram shows a section of the real number line with a few values marked on it:
The lower part of the line, in magenta, shows some of the rational numbers. Every integer n is a rational number because of course it can be written as n/1. The halfway points (1/2, 3/2 etc) are also rational, and the halfway points between those numbers (1/4, 3/4 etc) are also rational. We could carry on subdividing to create eighths, sixteenths and so on. We could do this forever.
This means that the set of rational numbers has an interesting property. If we choose any two rational numbers a and b, there will be infinitely many rational numbers between them. That is true no matter how close a and b are.
This also means that for any rational number r, there will be another rational number s such that |r - s| is less than ε, where ε is some arbitrarily small number. That is to say, for any r we can always find an s that is as close as we like to r. We say that the set of rational numbers is dense because it has this property.
Notice also that we haven't even included all of the possible rational numbers here, we are only considering numbers whose denominator is power of two. There are infinitely many other rational numbers.
The upper part of the line shows the irrational numbers. We have used a base of the square root of 2 and found other irrational numbers based on halves, quarters and eighths of root 2. Again we can repeat this indefinitely, and by the same logic as before we can say that the set of irrational numbers is also dense.
Rational and irrational numbers are interleaved
To properly understand the Dirichlet function, we need to know two other facts about real numbers:
- If we choose any two rational numbers a and b, there will always be an irrational number between them.
- If we choose any two irrational numbers a and b, there will always be a rational number between them.
What we saw above makes these statements seem plausible, but how do we prove them?
Statement 1 can be proved as follows. By definition, a and b are two distinct rational numbers. We will use a to represent the smaller number and b to represent the larger. Basic arithmetic tells us that:
Now let's create a new irrational value s:
We know this value is irrational because it is a rational number divided by the irrational value π. Also, since (b - a) is positive, and π > 1, we can say that:
Adding a to every term gives:
Since s is irrational and a is rational, a + s is irrational. Therefore we have proved that any arbitrary pair of rational numbers a and b must have an irrational number, a + s, between them.
We could prove statement 2 similarly, but there is an alternative approach. We wish to prove that any two irrational numbers must have a rational number between them. We start by observing that any irrational number, expressed as a decimal, must have an infinite, non-repeating sequence of decimal digits. For example, here are two irrational decimal numbers:
Also, of course, the two sequences must differ at some point, because a and b are different numbers. So we can create a rational number by simply truncating the larger number b after the first different digit:
This new value must be bigger than a because its final digit is greater than the corresponding digit of a. And it must be smaller than b, because all the trailing digits of s (after the final non-zero) are zero, whereas b must have some non-zero digits (because an irrational number cannot end in an infinitely repeating sequence of zeros).
Since s has a finite number of decimal places, it is a rational number:
So we have proved that any arbitrary pair of irrational numbers a and b must have a rational number between them.
The Dirichlet function has no limits anywhere
The result of these properties is that the Dirichlet function contains no limits anywhere. That is:
does not exist for any a.
To prove this, we will use the standard definition of a limit:
Let's choose a value of ε = 1/2. If there is a limit at a, it must be true that (for some value of δ > 0) f(x) is in the interval f(a) ± 1/2 for all x in the interval a ± δ. If we can show that this is not true for any x, we have proved the result.
Here are the steps of the proof
- First, let's choose any a such that f(a) = 1 (ie any rational value of a).
- For any value of δ > 0, we know that there will be another rational number b somewhere between a and a + δ. This follows because the set of rational numbers is dense.
- As we have previously proved, there will be an irrational number s somewhere between a and b. This means that s must also be somewhere between a and a + δ.
- Since s is irrational, f(s) = 0, which is not within the interval f(a) ± 1/2. Therefore, no rational value a can be a limit.
If we choose any irrational value for a, similar reasoning proves that a still cannot be a limit. Since a must either be rational or irrational, this means that no value a can be a limit of the Dirichlet function.
See also
Join the GraphicMaths Newletter
Sign up using this form to receive an email when new content is added:
Popular tags
adder adjacency matrix alu and gate angle area argand diagram binary maths cartesian equation chain rule chord circle cofactor combinations complex modulus complex polygon complex power complex root cosh cosine cosine rule cpu cube decagon demorgans law derivative determinant diagonal directrix dodecagon eigenvalue eigenvector ellipse equilateral triangle euler eulers formula exponent exponential exterior angle first principles flip-flop focus gabriels horn gradient graph hendecagon heptagon hexagon horizontal hyperbola hyperbolic function hyperbolic functions infinity integration by parts integration by substitution interior angle inverse hyperbolic function inverse matrix irrational irregular polygon isosceles trapezium isosceles triangle kite koch curve l system line integral locus maclaurin series major axis matrix matrix algebra mean minor axis nand gate newton raphson method nonagon nor gate normal normal distribution not gate octagon or gate parabola parallelogram parametric equation pentagon perimeter permutations polar coordinates polynomial power probability probability distribution product rule proof pythagoras proof quadrilateral radians radius rectangle regular polygon rhombus root sech set set-reset flip-flop sine sine rule sinh sloping lines solving equations solving triangles square standard curves standard deviation star polygon statistics straight line graphs surface of revolution symmetry tangent tanh transformation transformations trapezium triangle turtle graphics variance vertical volume volume of revolution xnor gate xor gate