RosettaCodeData/Task/Averages-Pythagorean-means/00-TASK.txt

24 lines
972 B
Plaintext

;Task
Compute all three of the [[wp:Pythagorean means|Pythagorean means]] of the set of integers <big>1</big> through <big>10</big> (inclusive).
Show that <big><math>A(x_1,\ldots,x_n) \geq G(x_1,\ldots,x_n) \geq H(x_1,\ldots,x_n)</math></big> for this set of positive integers.
* The most common of the three means, the [[Averages/Arithmetic mean|arithmetic mean]], is the sum of the list divided by its length:
: <big><math> A(x_1, \ldots, x_n) = \frac{x_1 + \cdots + x_n}{n}</math></big>
* The [[wp:Geometric mean|geometric mean]] is the <math>n</math>th root of the product of the list:
: <big><math> G(x_1, \ldots, x_n) = \sqrt[n]{x_1 \cdots x_n} </math></big>
* The [[wp:Harmonic mean|harmonic mean]] is <math>n</math> divided by the sum of the reciprocal of each item in the list:
: <big><math> H(x_1, \ldots, x_n) = \frac{n}{\frac{1}{x_1} + \cdots + \frac{1}{x_n}} </math></big>
{{task heading|See also}}
{{Related tasks/Statistical measures}}
<br><hr>