What is the name of this formula??

88 Views Asked by At

Let formula_a = lambda array: sum(array) / len(array). We may rename this formula to be average or mean if so desired. Let formula_b = lambda array: reduce(mul, array) ** (1 / len(array)). What is the name of this second formula?

1

There are 1 best solutions below

3
On BEST ANSWER

Hint: If the array is called $a$ and $N = \text{len}(a)$, then the code expresses the formula

$$\left(\prod_{i=0}^{N-1} a_i\right)^{1/N}$$

Or equivalently

$$\sqrt[N]{\prod_{i=0}^{N-1} a_i}$$

Extended hint: The formula is known as the geometric mean of a series of values (i.e. the array). (Wikipedia)