This post is in response to Peter’s post introducing the Approximate Geometric Mean.
The approximate geometric mean is a nice approximation of the geometric mean , but it has some quirks as we will see. After a discussion at the MathsJam gathering, I was intrigued to find out how good an approximation it is.
To get a better understanding, we first have to look again at its definition. For and , we set
where stands for the arithmetic mean. This makes also sense when and are not just integers between 1 and 10, but any real numbers. Note that we won’t consider negative and (i.e. negative and ), as the geometric mean runs into issues if we do so. The values of and may be negative, though. The looks like a mix between the and the , so what can possibly go wrong?
Same mean, different numbers
In contrast to the and the , the depends on the number base (10 in this case) and the presentation of and .
If we write , we get a different value for . This looks rather unfortunate, but it will turn out to be helpful. To ease notation we will assume in the following that unless otherwise stated. This can be done without loss of generality as .
Peter Rowlett proved in his post that . The question is, how far can the exceed the ? In other words, what’s the supremum of the ratio ?
Using the notation of and as above we get
So, the ratio doesn’t depend on and but only on and . That’s convenient. Taking and in the interval , as is usual, we can look at the plot of .
As long as we are in the blue part of the graph, looks to be a sensible approximation of the . So let’s look at the bad combinations of and .
The worst case happens when and are maximally far apart: The supremum of is its limit for and . So in general, .
This supremum doesn’t look too bad at first, but unfortunately, the result can be unusable in extreme cases. For example, if and , we have and – not only is the a better approximation of the than the in this instance, the is bigger than both the numbers and of which it is supposed to give some kind of mean!
Let’s analyse this a bit deeper. The ratio only depends on the ratio . In closed form we can write and we are left to study this function in the range . Its maximum is , but smaller give better results. And we will see, that we don’t have to put up with .
Here, the flexibility of the definition of the comes into play. Due to the choice of a suitable presentation of the numbers we can guarantee that isn’t too big. If we have which is equivalent to we calculate as above. If , we change the presentation of the number:
and continue from there.
So, let’s redefine the for like this:
Note, that in the second case we have , so that the roles of the pair are taken over by the pair . Setting in the second case, we have in both cases , so we only have to study in the interval , which will turn out to be rather benign.
Note also, that this new can still be calculated without a calculator when using the approximation , as Colin Beveridge suggested in Peter’s post.
In the example above with and we write and find with this new definition of the :
This coincides with the arithmetic mean of the two numbers and is really close to the geometric mean. This is looking promising.
If we define the of two numbers and in the way explained above, we get the following two inequalities:
Both inequalities together mean that not a lot can go wrong when using the with the appropriate presentation of the numbers: The is bigger than the , but exceeds it by maximally 20%, and it is always smaller than the .
As a consequence, the will always be between and . So it is indeed a “mean” of some kind.
A proof of these two inequalities
(I) We only have to find the maximum of . Due to the discussion above we can assume that , but can now be bigger than 10. The latter is not a problem though.
The maximum of is attained when and are maximally apart, i.e. , so
(II) We will show that . Let’s drop the assumption that . Instead we assume, again without loss of generality, that , so that we can set . For the ratio we have . If fell outside this interval, we would have had to change the presentation of one of the numbers before calculating the . Dividing the numerator and denominator in the above inequality by we get:
So we look for an upper bound of the function when varying and and want to show that this upper bound is smaller or equal to 1. Note, that we only have to check for integer (The result is actually false if we allow any real ).
For , we have for any and hence . For a fixed we can derive the function with respect to and find that the slope is always negative. Hence for a fixed , the function attains a maximum when is smallest, i.e. , so we are left to show that
For we have equality again and . For we can write with being an integer . We get the following chain of inequalities
This proves the second inequality. ☐
In summary, modifying the definition of the to assure that the ratio of the “leading characters” is as close to 1 as possible, makes sure that the works well, even in the bad cases.
One Response to “Taming the AGM”