Tool to compute a geometric mean. The geometric mean of a list of numbers is a representation which gives an estimate of the tendency of the data in a list, it has the advantage of being less sensitive to high values.

Geometric Mean - dCode

Tag(s) : Mathematics, Data processing

dCode is free and its tools are a valuable help in games, puzzles and problems to solve every day!

You have a problem, an idea for a project, a specific need and dCode can not (yet) help you? You need custom development? *Contact-me*!

Sponsored ads

➠

Tool to compute a geometric mean. The geometric mean of a list of numbers is a representation which gives an estimate of the tendency of the data in a list, it has the advantage of being less sensitive to high values.

Consider a list of \( n \) values \( X = \{x_1, x_2, \dots, x_n\} \). The geometric mean is defined by the nth root ( \( \sqrt[n]{} \) ) of the product of the values.

$$ \bar{x}_{geom} = \sqrt[n]{\prod_{i=1}^n{x_i}} $$

Example: The list of \( 3 \) numbers \( \{1, 10, 100 \} \) has for geometric mean \( \sqrt[3]{1 \times 10 \times 100} = 10 \), whereas it has for arithmetic mean \( 55.5 \).

To get a geometric representation, if we take the geometric mean of the sides of a rectangle, then we find a value \( c \) which could be the length of one side of a square of area identical to the original rectangle.

Example: Consider a rectangle of \( 6 \times 10 \), with an area of \( 60 \). The geometric mean of \( 6 \) and \( 10 \) is \( \approx 7.746 \). And a square of side length \( 7.746 \) has an area of \( \approx 60 \).

When the values are assigned coefficients, it is called a weighted geometric mean.

Using the mathematical formula : `//Python`

or to avoid a potential number overflow :

import numpy as np

def geometric_mean(iterable):

a = np.array(iterable)

return a.prod()**(1.0/len(a))`//Python`

import numpy as np

def geometric_mean(iterable):

a = np.log(iterable)

return np.exp(a.sum()/len(a))

dCode retains ownership of the source code of the script Geometric Mean online. Except explicit open source licence (indicated Creative Commons / free), any algorithm, applet, snippet, software (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any function (convert, solve, decrypt, encrypt, decipher, cipher, decode, code, translate) written in any informatic langauge (PHP, Java, C#, Python, Javascript, Matlab, etc.) which dCode owns rights will not be given for free. So if you need to download the online Geometric Mean script for offline use, check contact page !

moyenne,nombre,chiffre,geometric,list

Source : https://www.dcode.fr/geometric-mean

© 2018 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaches. dCode

Feedback