Arithmetic-geometric mean
Encyclopedia : A : AR : ARI : Arithmetic-geometric mean
In mathematics, the arithmetic-geometric mean
- M(x, y)
- a1 = (x + y) / 2.
- [a_ = \frac]
- [g_ = \sqrt.]
M(x, y) is a number between the geometric and arithmetic mean of x and y; in particular it is between x and y. If r > 0, then M(rx, ry) = r M(x, y).
M(x, y) is sometimes denoted agm(x, y).
Implementation
The following example code in the Scheme programming language computes the arithmetic-geometric mean of two positive real numbers:(define agmean(lambda (a b epsilon) (letrec ((ratio-diff ; determine whether two numbers(lambda (a b) ; are already very close together (abs (/ (- a b) b)))) (loop ; actually do the computation (lambda (a b) ;; if they're already really close together, ;; just return the arithmetic mean (if (< (ratio-diff a b) epsilon) (/ (+ a b) 2) ;; otherwise, do another step (loop (sqrt (* a b)) (/ (+ a b) 2))))));; error checking (if (or (not (real? a))(not (real? b)) (<= a 0) (<= b 0)) (error 'agmean "~s and ~s must both be positive real numbers" a b) (loop a b)))))
One can show that
- [\Mu(x,y) = \frac \cdot \frac \right) }]
The reciprocal of the arithmetic-geometric mean of 1 and the square root of 2 is called Gauss's constant.
- [ \frac)} = G ]
The geometric-harmonic mean can be calculated by an analogous method, using sequences of geometric and harmonic means. The arithmetic-harmonic mean is none other than the geometric mean.
See also
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
