Important: The stats package has been deprecated. Use the superseding package Statistics instead.
>

$\mathrm{with}\left(\mathrm{stats}\right)\:$

The harmonic mean of 1/3 and 1/5 is
>

$\mathrm{describe}\left[\mathrm{harmonicmean}\right]\left(\left[\frac{1}{3}\,\frac{1}{5}\right]\right)$

When I purchase gasoline for my automobile, I always pay 1 Sim. Of course the price is never the same. One time it was 3 Sim/bucket, at another time it was 5 Sim/bucket. The ``average price'' is then obtained as follows: The first time I obtained 1/3 buckets. The second time, it was 1/5 buckets. In total I obtained 1/3+1/5 buckets for a cost of 2 Sim. The average price I paid was then 2/ (1/3+1/5)=15/4=3.75 Sim/bucket.
>

$\mathrm{describe}\left[\mathrm{harmonicmean}\right]\left(\left[3\,5\right]\right)=\frac{2}{\frac{1}{3}+\frac{1}{5}}$

$\frac{{15}}{{4}}{=}\frac{{15}}{{4}}$
 (2) 
Note that the arithmetic mean is not appropriate in this case, since it is equal to
>

$\mathrm{describe}\left[\mathrm{mean}\right]\left(\left[3\,5\right]\right)\ne \frac{15}{4}$

${4}{\ne}\frac{{15}}{{4}}$
 (3) 
If the first time, since the price was low, I bought for 2 Sim of fuel, the average price becomes
>

$\mathrm{describe}\left[\mathrm{harmonicmean}\right]\left(\left[\mathrm{Weight}\left(3\,2\right)\,5\right]\right)=\frac{3}{\frac{2}{3}+\frac{1}{5}}$

$\frac{{45}}{{13}}{=}\frac{{45}}{{13}}$
 (4) 