Tool for calculating a harmonic mean from a series or list of integers or real numbers. The harmonic mean is for example used for average speeds.

Harmonic Mean - dCode

Tag(s) : Statistics

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 for calculating a harmonic mean from a series or list of integers or real numbers. The harmonic mean is for example used for average speeds.

With a list of n values \( X = \{x_1, x_2, \dots, x_n \} \). The harmonic mean is defined by the ratio of n to the sum of the inverse of the values. $$ \bar{x}_{harm} = \frac{n}{\sum_{i=1}^n \frac{1}{x_i}} $$

To compute a harmonic mean of a list of values, count the total number \( n \) of values in the list and calculate the sum \( S \) of the inverse values.

Example: A car drove a distance \( d \) at 30km/h half the distance then to 90km/h. The average speed of the car can be defined with its harmonic speed by the calculation \( n/S \) with \( n = 2 \) and \( S = 1/30 + 1/90 = 0.0444 ... \) so \( \bar{M}_{harm} = 2/(1/30+1/90) = 45 \) km/h.

Indeed, taking the distance \( d = 15km \), the car will have traveled \( d/2 \) at 30km/h in 15 minutes and \( d/2 \) at 90km/h in 5 minutes, so a total distance of 15km in 20 minutes or 45km/h on average.

The harmonic mean is used when the compared elements have inverse proportionality ratios.

Example: The price per square meter of a house is higher if the total area is small.

Example: Travel time is shorter when the speed is high.

Example: On an electronic circuit, the calculation of two resistances in parallel corresponds to the harmonic average of the 2 resistance values.

dCode retains ownership of the source code of the script Harmonic 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. To download the online Harmonic Mean script for offline use on PC, iPhone or Android, ask for price quote on contact page !

harmonic,mean,number,list,serie,speed,average

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

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

Feedback