輸入一組數字,計算調和平均數。
調和平均數是一種特殊的平均數,用於描述一組數的總體特徵,特別適用於計算速率(如速度、效率等)。它的計算方式是:將數列的倒數求和後,取倒數,再乘以數據的個數。公式為: \( H = \frac{n}{\sum_{i=1}^{n} \frac{1}{x_i}} \) 其中,\( n \) 是數據的個數,\( x_i \) 是每個數據。
計算步驟:
解答:
倒數:
\( \frac{1}{100} = 0.01 \), \( \frac{1}{200} = 0.005 \), \( \frac{1}{300} = 0.003333 \), \( \frac{1}{400} = 0.0025 \), \( \frac{1}{500} = 0.002 \)
倒數和:
\( \frac{1}{100} + \frac{1}{200} + \frac{1}{300} + \frac{1}{400} + \frac{1}{500} = 0.01 + 0.005 + 0.0033333 + 0.0025 + 0.002 \approx 0.0228333 \)
調和平均數:
\( H = \frac{5}{0.0228333} \approx 218.9781 \)
解答:
倒數:
\( \frac{1}{60} \approx 0.01667 \), \( \frac{1}{120} \approx 0.00833 \), \( \frac{1}{180} \approx 0.00556 \)
倒數和:
\( \frac{1}{60} + \frac{1}{120} + \frac{1}{180} \approx 0.01667 + 0.00833 + 0.00556 \approx 0.03056 \)
調和平均數:
\( H = \frac{3}{0.03056} \approx 98.18 \)