Branch of mathematics concerned with properties of and relations among integers. It is a popular subject among amateur mathematicians and students because of the wealth of seemingly simple problems that can be posed. Answers are much harder to come up with. It has been said that any unsolved mathematical problem of any interest more than a century old belongs to number theory. One of the best examples, recently solved, is Fermat's last theorem.
Learn more about number theory with a free trial on Britannica.com.
Branch of mathematics that deals with the properties of numbers and ways of combining them through addition, subtraction, multiplication, and division. Initially it dealt only with the counting numbers, but its definition has broadened to include all real numbers. The most important arithmetic properties (where math.a and math.b are real numbers) are the commutative laws of addition and multiplication, math.a + math.b = math.b + math.a and math.amath.b = math.bmath.a; the associative laws of addition and multiplication, math.a + (math.b + math.c) = (math.a + math.b) + math.c and math.a(math.bmath.c) = (math.amath.b)math.c; and the distributive law, which connects addition and multiplication, math.a(math.b + math.c) = math.amath.b + math.amath.c. These properties include subtraction (addition of a negative number) and division (multiplication by a fraction).
Learn more about arithmetic with a free trial on Britannica.com.
First compute the arithmetic mean of x and y and call it a1. Next compute the geometric mean of x and y and call it g1; this is the square root of the product xy:
Then 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:
These two sequences converge to the same number, which is the arithmetic-geometric mean of x and y; it is denoted by M(x, y), or sometimes by agm(x, y).
and then iterate as follows:
The first four iterations give the following values:
| n | an | gn |
|---|---|---|
| 0 | 24 | 6 |
| 1 | 15 | 12 |
| 2 | 13.5 | 13.41640786500... |
| 3 | 13.45820393250... | 13.45813903099... |
| 4 | 13.45817148175... | 13.45817148171... |
The arithmetic-geometric mean of 24 and 6 is the common limit of these two sequences, which is approximately 13.45817148173.
If r > 0, then M(rx, ry) = r M(x, y).
There is a closed form expression for M(x,y):
where K(x) is the complete elliptic integral of the first kind.
The reciprocal of the arithmetic-geometric mean of 1 and the square root of 2 is called Gauss's constant.
named after Carl Friedrich Gauss.
The geometric-harmonic mean can be calculated by an analogous method, using sequences of geometric and harmonic means. The arithmetic-harmonic mean can be similarly defined, but takes the same value as the geometric mean.
from math import sqrtdef avg(a, b, delta=None):
if None==delta:delta=(a+b)/2*1E-10if(abs(b-a)>delta):return avg((a+b)/2.0, sqrt(a*b), delta)else:return (a+b)/2.0