Home / Maths for AI / Symbols / Sums, products and sets

Sigma (summation)

Say it: "the sum of"

What it means

Add up a list of terms. ∑i=1nxi\sum_{i=1}^{n} x_i means x1+x2+⋯+xnx_1 + x_2 + \dots + x_n: ii counts from the bottom number to the top one.

Example

∑i=14i2=1+4+9+16=30\sum_{i=1}^{4} i^2 = 1 + 4 + 9 + 16 = 30

Square each of 1, 2, 3, 4 and add.

In code

import numpy as np
i = np.arange(1, 5)
print((i ** 2).sum())

Output

30

Where it appears in machine learning

Every loss function averages a sum of errors over the training examples, and every dot product is a sum.

Related symbols

Learn it properly in the free lesson Reading ML Maths, with practice questions that check your answers.