Simple Sigmas

Yesterday I spent the better half of the day designing and testing running variance and SMA functions for a project I happen to be working on. As with all things in embedded systems, memory is scarce. Therefore we abstain from remembering sets of information as much as possible.

For the running variance problem, I stumbled upon Welford’s method for computing variance, but that is another story :bulb:.

Anyways… While refreshing some of the basic math skills whilst working on the problem I rediscovered some amazing properties that one should exploit whenever performing summation operations on series.

$\sum\limits_{i=1}^{n} 1 = n$

$\sum\limits_{i=1}^{n} c = c \cdot n$

$\sum\limits_{i=1}^{n} i = \frac{n(n + 1)}{2} $

$\sum\limits_{i=1}^{n} i^2 = \frac{n(n + 1)(2n + 1)}{6} $

$\sum\limits_{i=1}^{n} i^3 = (\frac{n(n + 1)}{6})^2 $

Lifesavers… remember these :floppy_disk: