This is one of the most important concepts in statistics, an essential subject for learning machine learning.
Example —
Sequence = {1, 3, 9} product = 27 n, Total values = 3 Harmonic Mean = (27) ^ (1/3)
Code —

Output:
Geometric Mean is: 3
Example —
Sequence = {1, 3, 9} sum of reciprocals = 1/1 + 1/3 + 1/9 n, Total values = 3 Harmonic Mean = 3 / ( sum of reciprocals)
Code —

Output:
Harmonic Mean is: 2.076923076923077
Example —
Sequence = {1, 3, 9} sum of reciprocals = 1/1 + 1/3 + 1/9 Sum = 10 Product = 27 n, Total values = 3 Arithmetic Mean < / strong> = 4.33 Geometric Mean = 3 Harmonic Mean = 3 / (sum of reciprocals) = 2.077