An interesting family of functions
You probably already know that we represent numbers using base 10 (or decimal) notation. You may also know that this choice is, ultimately, arbitrary. In principle any integer (greater than 1) can be used as a base.
The representation of a number in a given base b need not be unique though. For example, in base 10 we have 1 = 0.999… In general, if a number x > 0 has a terminating base b expansion, then we can come up with a second expansion by subtracting one from the last non-zero digit after the decimal and replacing all the zeroes after this digit by the digit for b - 1. This follows from the identity
It can be shown that if b is an integer, this is the only way for a number to have more than 1 base b representations. For non-integer bases this is false. For instance, since φ + 1 = φ² (where φ is the golden ratio), the base φ expansion of φ² can be 100 or 11. This is one of the reasons why non-integer bases are a pain, so we will not use them.
For any integer b > 1 and any x ≥ 0 we can define the canonical base b expansion of x to be xnxn - 1…x0.x-1x-2… where all the xi are integers from 0 to b - 1 such that
With the following two additional requirements:
If xn = 0, then n = 0,
For every i there is a k > i so that x-k ≠ b - 1.
The first requirement simply excludes stuff like “017” and the second one excludes “0.999…”. If there is some i such that x-k = 0 for k > i, we say that x has a terminating base b expansion. It can be shown that this happens precisely if x = 0 or x = p/q for coprime integers p, q with the property that any prime factor of q is also a prime factor of b (simply compute the full sum, you will notice that q divides some power of b).
We will abuse language and still call the dot “.” the decimal point. For x < 0, the base b expansion is simply the same as for -x, but with a minus sign in front.
Base conversion functions
The above led me to defining the following family of functions, that I’ll call the base conversion functions Bb, c for b > 1 an integer and c ≠ 0. They are defined as follows: for any x ≥ 0 let xnxn - 1…x0.x-1x-2… be its unique (canonical) base b expansion. We now set
if the sum converges, of course.
The reason for the name should be clear. We essentially pretend that the base b expansion of x is a base c expansion (though c need not be an integer). If we want to, we can extend Bb, c by setting Bb, c(-x) = - Bb, c(x) and even Bb, c(x + iy) = Bb, c(x) + i Bb, c(y), but in essence we really only care about the function for positive inputs.
Even that is not true actually. First of all, Bb, c(0) = 0, so that’s not very exciting and, similarly Bb, c(1) = 1. Note that if N = NnNn - 1…N0 is an integer and 0 ≤ y < 1 we get
so that, in actuality, we really only care about Bb, c on integers and on [0,1].
Domain
Of course, Bb, c(x) is defined in terms of an infinite series and so we need to check when this series converges. First of all, if x has a terminating base b expansion, then Bb, c(x) is just a finite sum and so we clearly get convergence. What happens for more general x? Take x = xnxn - 1…x0.x-1x-2…
A necessary (but in principle not sufficient) condition for Bb, c(x) to exist is that the terms in the sum approach zero. This is equivalent to saying that the absolute value of the terms should approach zero. The (-i)th term is xici, so we need that xi|c|i → 0. If |c| ≤ 1 we have that |c|i → 1 or ∞ depending on if c = ±1 or not. In either case, convergence can only occur if xi → 0 and since this is a sequence of integers, this only happens if eventually all xi are zero.
In other words, if |c| ≤ 1, then the domain of Bb, c is precisely those x with a terminating base b expansion.
However, if |c| > 1, this is not the case. Then we get
In other words, for |c| > 1 the function Bb, c is defined on all of R. In fact, we even get a bound on how big Bb, c(x) can be, since n ≤ logb(x) = ln(x)/ln(b) we get
Continuity
Can we conclude anything about the continuity of Bb, c? First of all, we have the trivial observation that Bb, b = id, which is of course continuous (and derivable and what have you). What if c ≠ b?
Let’s look at continuity around 0. If |c| ≤ 1, we can consider the sequence b-n → 0 so that Bb, c(b-n) = c-n which does not approach 0. In other words, the function is discontinuous at this point.
What if |c| > 1? In that case we do have continuity. After all, take any ε > 0, then for some n we get that
Now if |x| < b-n its first non-zero digit will be x-i for some i > n and all later digits are at most b - 1, so that |Bb, c(x)| < ε.
In other words, Bb, c is continuous at 0 if and only if |c| > 1.
What happens for x > 0 (we don’t need to consider any other x)? Perhaps unsurprisingly, we need to consider the cases where x has a terminating or non-terminating expansion separately.
Suppose x = xnxn - 1…x0.x-1x-2…x-m000… where x-m ≠ 0. For ease of notation pick d = b - 1 and y = xm - 1. Now we define the sequence yk = x - b-(m + k) → x. It is easy to see that
Now that means that Bb, 1(x) - Bb, 1(y) = 1 + 9k, which clearly does not approach 0. If |c| ≠ 1, we get
So, if |c| > 1 this difference approaches c-m ≠ 0 and if |c| < 1, the above difference approaches ∞. If c = -1, then the above simplifies to (-1)m[1 - d((-1)-k - 1)/2] which alternates between (-1)m and (-1)m[1 + d] = (-1)mb.
Suppose now that x = xnxn - 1…x0.x-1x-2… has a non-terminating base b expansion. In order for Bb, c(x) to exist we need that |c| > 1. Surprisingly, Bb, c will be continuous at x. Take ε > 0, now there is some N so that
Take the integer p so that pb-N < x < (p + 1)b-N and let 0 < δ < min((p + 1)b-N - x, x - pb-N). Now, if |x - y| < δ we get that the first N digits after the decimal point will be the same for x and for y. Take y = ynyn - 1…y0.y-1y-2… the base b expansions of y, now:
Where we use the property that -d ≤ xi - yi ≤ d.
In other words, we get the following proposition.
Proposition: If |c| ≤ 1, Bb, c is discontinuous in all points of its domain. If |c| > 1, then Bb, c is continuous in all numbers with a non-terminating base b expansion and discontinuous in all numbers with a terminating base b expansion.
Directional continuity
We have seen that Bb, c is discontinuous at all numbers with a terminating base b expansion. We can still try and figure out whether these functions might be right-continuous at these points (since we’ve already disproven left continuity). So let x = xnxn - 1…x0.x-1x-2…x-m000… where x-m ≠ 0.
Consider first the case where |c| ≤ 1. In this case, set yk = x + b-(m + k) so that its base b expansion is
Therefore, we get
Which, as |c| ≤ 1, does not approach zero. Hence, the function Bb, c is left and right discontinuous at x.
However, if |c| > 1 this is not the case. Take any ε > 0, now we can again find some N with
And pick 0 < δ < min(b-m, b-N), so that if 0 < y - x < δ that then the first max(m, N) digits of x and y are the same. But then, by the same argument as above, |Bb, c(x) - Bb, c(y)| < ε.
Proposition: For |c| ≤ 1, the map Bb, c is left and right discontinuous on its entire domain. For |c| > 1, the map Bb, c is left continuous on its entire domain, but right continuous (and therefore continuous) only at those numbers with a non-terminating base b expansion.
In fact, if |c| > 1, we can say a bit more about the discontinuity that occurs at x with a terminating base b expansion. After all, take ε > 0 and find N again so that the inequality from above holds. We can take 0 < δ < min(b-m, b-N) again, so that the base b expansion of z with 0 < x - z < δ looks like
Where, like before, y = xm - 1. Now we get
But, as k → ∞, that third term will approach zero (in that it can be bounded by any ε > 0). So we get that Bb, c(y) → Bb, c(x) - c-m as y → x from below. In other words, the functions Bb, c have a jump discontinuity at those numbers with terminating base b expansions.
B2,10
I think that of all these functions, one is by far the most accessible: B2, 10. It simply takes any x, writes it in binary and then interprets that as a decimal number. I believe that B2, 10: [0,1] → [0,1] could easily serve as an example of a function that’s pretty easy to define, but nonetheless is quite pathological.
After all, we get that B2, 10 has a jump discontinuity at every p/2n for p, n integers, which form a dense subset of the domain. Still, since this subset is countable, this function is in fact Riemann-integrable.
I have tried to plot this function in Python, but since the im B2, 10 is quite small (it’s a cantor set), it doesn’t exactly look interesting. If anyone can make a more interesting plot of this function or any other base conversion function, I’d love to see it.
Comments
Post a Comment