Sigma notation ninja tricks 1: jumping constants

Almost exactly ten years ago, I wrote a page on this blog explaining big-sigma notation. Since then it’s consistently been one of the highest-traffic posts on my blog, and still gets occasional comments and questions. A few days ago, a commenter named Kevin asked,

Could you explain how to take a constant outside of a summation and bring it inside the summation?

This made me realize there’s a lot more still to be explained! In particular, understanding what sigma notation means is one thing, but becoming fluent in its use requires learning a number of “tricks”. Of course, as always, they’re not really “tricks” at all: understanding what the notation means is the necessary foundation for understanding why the tricks work!

Trick 1: jumping constants

For today, we’ll start by considering what Kevin asked about. Consider what is meant by this sigma notation:

$\displaystyle \sum_{i=1}^{4} c X_i$

It doesn’t really matter what the $X$’s are, the point is just that each $X_i$ might be different, whereas $c$ is a constant that doesn’t change. So this can be expanded as

$\displaystyle \sum_{i=1}^{4} c X_i = c X_1 + c X_2 + c X_3 + c X_4$

Since multiplication distributes over addition, we can factor out the $c$:

$c X_1 + c X_2 + c X_3 + c X_4 = c (X_1 + X_2 + X_3 + X_4)$

The right-hand side can now be written as

$\displaystyle c \left( \sum_{i=1}^4 X_i \right),$

so overall we have shown that

$\displaystyle \sum_{i=1}^4 c X_i = c \left(\sum_{i=1}^4 X_i\right).$

We usually omit the parentheses and just write

$\displaystyle c \sum_{i=1}^4 X_i.$

Our argument didn’t really depend on any of the specifics (like the fact that $i$ goes from $1$ to $4$). The general principle is that constants can “jump” back and forth across the sigma, which corresponds to multiplication distributing across addition.

The one remaining question is—what counts as a “constant”? The answer is, anything that doesn’t depend on the index variable. So the “constant” can even involve some variables, as long as they are other variables! For example,

$\displaystyle \sum_{i = 1}^k (n^2 + k) g(i) = (n^2 + k) \sum_{i=1}^k g(i)$

In the context of this sum, $n^2 + k$ is a “constant”, because it does not have $i$ in it. Since it doesn’t contain $i$, it is going to be exactly the same for each term of the sum, which means it can be factored out.