Teach Time Encyclopedia - Learn About Our World
Home Page
Teach Time
Featured Topics

United States
by state

CITYology

Academic Disciplines

Historical Timelines

Themed Timelines

Calendars

Reference Tables

Biographies

How-tos



Friday, September 05, 2008

Arithmetic-geometric mean

The arithmetic-geometric mean M(x, y) of two positive real numbers x and y is defined as follows: we first form the arithmetic mean of x and y and call it a1, i.e. a1 = (x+y) / 2. We then form the geometric mean of x and y and call it g1, i.e. g1 is the square root of xy. Now we can iterate this operation with a1 taking the place of x and g1 taking the place of y. In this way, two sequences (an) and (gn) are defined:

and

Both of these sequences converge to the same number, which we call the arithmetic-geometric mean M(x, y) of x and y.

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).

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

where K(x) is the complete elliptic integral of the first kind.

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: generalized mean



Internet Hotel Solutions

Site Sponsors
AC Units
Baltimore Harbor
Boot Camp Grads
Bra Size
Burkittsville
College Hotels
Digital Harbor
Free Cell Phones
Golden Hare Travel
Golf Vacations
Golf Courses
Gourmet
Hair Styles
Hippodrome
iWoman
Lesson Plans
Maryland Hotels
MD Genealogy
Minor League Stuff
Motel Site
Ocean City
OC Real Estate
Old Agers
Office Supplies
Orlando
Pet Friendly Hotel
Room Prices
Savannah, GA
Ski Vacations
South Baltimore
Student Teaching
Travel Sources
University Hotels
Visit Military Bases
Washington, DC

Brought to you by NoChildLeftBehind.com and the Beaches and Towns Network, LLC.