TeX source:
\bar{x}=\frac{\sum_{i=1}^{N} x_{i} n_{i}}{N}=\sum_{i=1}^{n} x_{i} f_{i},