Free preview

83 lessons

Mathematical Foundations for ML

Free preview

Mathematical Foundations for ML · 83 lessons

Build the maths foundations that make ML click

No surprise gaps

Actually remember it

Skip what you know

One subscription. All learning paths included.

Our content is best on a larger screen

Sigma notation

Anatomy of sigma notation

Explanation

When we need to add up a long sequence of terms, writing them all out gets tedious fast. Mathematics has a shorthand for this: sigma notation, named after the capital Greek letter Σ\Sigma (sigma), which acts as a summation operator - it tells us to add up a series of terms.

Sigma notation

Definition

A summation written in sigma notation has five components:

i=14i2\sum_{i=1}^{4} i^2
  • Σ\Sigma - the summation operator, meaning "add up".
  • ii - the index variable, a placeholder that takes each integer value in turn.
  • i=1i=1 - the lower limit, the starting value of the index.
  • 44 - the upper limit, the ending value of the index.
  • i2i^2 - the general term, the expression evaluated for each value of the index.

The expression above tells us to evaluate i2i^2 for each integer ii from 11 to 44 and add the results together.

The index letter is arbitrary

Gotcha

The choice of letter for the index variable does not affect the sum. The letters ii, jj, kk, and nn are all common choices. For example, i=14i2\displaystyle\sum_{i=1}^{4} i^2 and k=14k2\displaystyle\sum_{k=1}^{4} k^2 represent exactly the same sum - only the placeholder name has changed.

If the lower limit exceeds the upper limit, there are no terms to add. By convention, such an empty sum equals 00 - the additive identity.

Example

Identify each component of the following expression:

j=16(3j1)\sum_{j=1}^{6} (3j - 1)

Solution

  • Summation operator: Σ\Sigma tells us to add up the terms.
  • Index variable: jj.
  • Lower limit: j=1j = 1, so jj starts at 11.
  • Upper limit: 66, so jj ends at 66.
  • General term: 3j13j - 1, the expression evaluated for each value of jj.

The expression tells us to evaluate 3j13j - 1 for each integer jj from 11 to 66 and add the results together.

Practice questions

4 questions

In the expression j=27(3j+1)\displaystyle\sum_{j=2}^{7} (3j + 1), what is the general term?

Select the correct answer:

+ 3 more questions

Expanding sigma notation

Explanation

Now that we can identify the parts of sigma notation, the next step is to expand a summation - writing out each term individually.

Expanding a sigma expression

Procedure

To expand a sigma expression with lower limit aa and upper limit bb:

  1. Substitute the lower limit i=ai = a into the general term.
  2. Substitute i=a+1i = a + 1, then i=a+2i = a + 2, and so on.
  3. Continue until reaching the upper limit i=bi = b.
  4. Write the results separated by ++ signs.

Example

Expand each of the following:

  1. i=15(2i1)\displaystyle\sum_{i=1}^{5} (2i - 1)
  2. i=1nai\displaystyle\sum_{i=1}^{n} a_i

Solution

1. We substitute i=1,2,3,4,5i = 1, 2, 3, 4, 5 into the general term 2i12i - 1:

i=15(2i1)=1+3+5+7+9\sum_{i=1}^{5} (2i - 1) = 1 + 3 + 5 + 7 + 9
Full substitution steps

Details

2. Here the upper limit is the letter nn rather than a specific number, so we cannot write every term. We write the first few, use "\ldots" to show the pattern continues, and end with the last term:

i=1nai=a1+a2++an\sum_{i=1}^{n} a_i = a_1 + a_2 + \ldots + a_n

Practice questions

4 questions

What is the expansion of i=14(i+2)\displaystyle\sum_{i=1}^{4} (i + 2)?

Select the correct answer:

+ 3 more questions

Writing sums in sigma notation

Explanation

We have seen how to expand a sigma expression into its terms. Now we go in the other direction: given an expanded sum, we write it in sigma notation.

Writing a sum in sigma notation

Procedure

  1. Spot the pattern - how does each term relate to its position? The first term is position 11, the second is position 22, and so on.
  2. Write the general term - express the pattern as a formula in terms of an index variable ii.
  3. Set the limits - the lower limit is the first value of ii (usually 11), and the upper limit is the last.

Example

Write 3+6+9+12+153 + 6 + 9 + 12 + 15 in sigma notation.

Solution

Step 1: Spot the pattern. We label each term by its position:

Position (ii)1122334455
Term33669912121515

Each term is 33 times its position: 3×1=33 \times 1 = 3, 3×2=63 \times 2 = 6, 3×3=93 \times 3 = 9, and so on.

Step 2: Write the general term. The ii-th term is 3i3i.

Step 3: Set the limits. The index starts at i=1i = 1 (for the first term, 33) and ends at i=5i = 5 (for the last term, 1515).

Putting it together:

3+6+9+12+15=i=153i3 + 6 + 9 + 12 + 15 = \sum_{i=1}^{5} 3i

Practice questions

4 questions

Which sigma expression represents 4+8+12+16+204 + 8 + 12 + 16 + 20?

Select the correct answer:

+ 3 more questions