Chapter 8
15 min read
Section 72 of 353

Sigma Notation and Summation

The Definite Integral

Learning Objectives

By the end of this section, you will be able to:

  1. Read and write sigma notation to express sums compactly
  2. Expand sigma notation into its individual terms
  3. Apply key properties of summation (linearity, constant multiple, splitting)
  4. Use closed-form formulas for common sums (integers, squares, cubes)
  5. Connect sigma notation to Riemann sums and definite integrals
  6. Recognize sigma notation in machine learning formulas
  7. Implement summations efficiently in Python

The Big Picture: Why We Need Compact Notation for Sums

"Mathematics is the art of giving the same name to different things." — Henri Poincaré

Imagine you need to write the sum of the first 100 integers: 1 + 2 + 3 + ... + 100. Writing out all 100 terms would be tedious and error-prone. We need a compact notation that captures the pattern of a sum without listing every term.

Sigma notation (also called summation notation) solves this problem brilliantly. Using the Greek capital letter sigma (Σ\Sigma), we can write the sum of 100 integers simply as:

100Σi=1
i
"The sum of i, as i goes from 1 to 100"

Why This Matters

Sigma notation is not just convenient shorthand — it's the language of accumulation. Every integral begins as a sum. Every average, variance, loss function, and gradient in machine learning is expressed using sigma notation. Mastering this notation is essential for understanding calculus and its applications.

Where Sigma Notation Appears

∫ Calculus

  • Riemann sums (area under curves)
  • Definite integrals as limits of sums
  • Taylor series expansions
  • Numerical integration methods

📊 Statistics

  • Mean: xˉ=1nxi\bar{x} = \frac{1}{n}\sum x_i
  • Variance: σ2=1n(xixˉ)2\sigma^2 = \frac{1}{n}\sum (x_i - \bar{x})^2
  • Expected values
  • Probability distributions

🤖 Machine Learning

  • Loss functions (MSE, cross-entropy)
  • Gradient computation (backpropagation)
  • Batch normalization
  • Attention mechanisms

💰 Finance

  • Present value of cash flows
  • Portfolio returns
  • Risk measures
  • Bond pricing

Historical Context: The Evolution of Summation

The sigma symbol (Σ\Sigma) was introduced by Leonhard Eulerin the 18th century. Euler, perhaps the most prolific mathematician in history, recognized the need for standardized notation to express infinite series and sums.

Ancient Roots: Gauss and the Sum of Integers

The story goes that as a schoolboy, Carl Friedrich Gauss was assigned to add the integers from 1 to 100. While his classmates laboriously computed, young Gauss realized that pairing the numbers cleverly would give the answer instantly:

1 + 100 = 101

2 + 99 = 101

3 + 98 = 101

...

50 + 51 = 101

50 pairs × 101 = 5,050

This insight generalizes to the famous formula: i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2}. Such closed-form formulas let us compute sums without adding each term — essential when the sum has infinitely many terms or when speed matters.

Why Greek Sigma?

The capital Greek letter sigma (Σ\Sigma) was chosen because it corresponds to "S" in the Latin alphabet — S for Sum. Similarly, the integral sign \int is an elongated S, representing the sum of infinitely many infinitesimal pieces.


Sigma Notation: The Formal Definition

Let's precisely define sigma notation and understand each component.

Definition: Sigma Notation

nΣi = m
ai = am + am+1 + am+2 + ... + an
ComponentNameMeaning
ΣSigmaIndicates summation (adding up terms)
iIndex variableCounter that takes integer values from m to n
mLower boundStarting value of the index (where the sum begins)
nUpper boundEnding value of the index (where the sum ends)
aᵢGeneral termExpression to evaluate for each value of i

Reading Sigma Notation Aloud

When you see sigma notation, read it as: "The sum of [expression], as [index] goes from [lower bound] to [upper bound]."

NotationRead AsExpanded FormValue
∑_{i=1}^{4} iSum of i, as i goes from 1 to 41 + 2 + 3 + 410
∑_{k=0}^{3} k²Sum of k squared, as k goes from 0 to 30 + 1 + 4 + 914
∑_{j=1}^{3} 2jSum of 2j, as j goes from 1 to 32 + 4 + 612
∑_{n=1}^{5} 1Sum of 1, as n goes from 1 to 51 + 1 + 1 + 1 + 15

The Index Variable is a Dummy

The letter used for the index (ii, jj,kk, nn) doesn't matter — it's just a placeholder. These two sums are identical:

5Σi=1i2=5Σk=1k2=1 + 4 + 9 + 16 + 25 = 55

Expanding and Compacting Sums

From Sigma to Expanded Form

To expand sigma notation, substitute each integer value of the index into the general term, then add:

4Σi=1(2i + 1)

Step 1: Substitute i = 1: 2(1) + 1 = 3

Step 2: Substitute i = 2: 2(2) + 1 = 5

Step 3: Substitute i = 3: 2(3) + 1 = 7

Step 4: Substitute i = 4: 2(4) + 1 = 9

Result: 3 + 5 + 7 + 9 = 24

From Expanded Form to Sigma

To write a sum in sigma notation, identify the pattern and express it with an index variable:

Sum of odd numbers:
1 + 3 + 5 + 7 + 9 =
5Σi=1(2i - 1)
Powers of 2:
1 + 2 + 4 + 8 + 16 =
4Σi=02i
Alternating signs:
1 - 2 + 3 - 4 + 5 =
5Σi=1(-1)i+1 · i
Reciprocals:
1 + 1/2 + 1/3 + 1/4 =
4Σi=11/i

Interactive: Explore Sigma Notation

Use this interactive tool to see how sigma notation expands into individual terms and computes sums. Experiment with different formulas and values of n:

ΣSigma Notation Explorer
Sigma Notation:
5Σi=1
i
1 + 2 + 3 + ... + n = n(n+1)/2
Expanded Form:
1+2+3+4+5=15
Running Total15 / 15
i = 1
1
i = 2
2
i = 3
3
i = 4
4
i = 5
5
Closed-Form Formula:
1 + 2 + 3 + ... + 5 = 5(5+1)/2 = 15

Properties of Summation

Just like regular algebra, summations follow certain rules that help us manipulate and simplify them. These properties are essential for computing definite integrals.

Key Properties of Summation

Constant Multiple Rule

nΣi=1c · ai = c ·nΣi=1ai
Example:
3Σi=12i = 2(1) + 2(2) + 2(3) = 2(1 + 2 + 3) = 2 · 6 = 12

Constants can be factored out of summations, just like in algebra.

Quick Reference: Common Summation Formulas

Sum of First n Integers
nΣi=1i = n(n+1)/2
Sum of Squares
nΣi=1i2 = n(n+1)(2n+1)/6
Sum of Cubes
nΣi=1i3 = [n(n+1)/2]2
Geometric Series
nΣi=0ri = (1-rn+1)/(1-r)

Formal Statement of Properties

1. Constant Multiple Rule
i=1ncai=ci=1nai\sum_{i=1}^{n} c \cdot a_i = c \cdot \sum_{i=1}^{n} a_i
Constants can be factored out of summations.
2. Sum/Difference Rule (Linearity)
i=1n(ai±bi)=i=1nai±i=1nbi\sum_{i=1}^{n} (a_i \pm b_i) = \sum_{i=1}^{n} a_i \pm \sum_{i=1}^{n} b_i
Summation distributes over addition and subtraction.
3. Constant Sum
i=1nc=nc\sum_{i=1}^{n} c = n \cdot c
Adding a constant n times equals n times the constant.
4. Splitting Property
i=1nai=i=1mai+i=m+1nai\sum_{i=1}^{n} a_i = \sum_{i=1}^{m} a_i + \sum_{i=m+1}^{n} a_i
A sum can be split at any index m where 1 ≤ m < n.

Closed-Form Summation Formulas

These formulas let us compute sums without adding each term. They are essential for evaluating Riemann sums as n approaches infinity.

The Essential Summation Formulas

Sum of First n Integers
O(1) computation
i=1ni=1+2+3++n=n(n+1)2\sum_{i=1}^{n} i = 1 + 2 + 3 + \cdots + n = \frac{n(n+1)}{2}
Sum of Squares
Critical for integrals
i=1ni2=1+4+9++n2=n(n+1)(2n+1)6\sum_{i=1}^{n} i^2 = 1 + 4 + 9 + \cdots + n^2 = \frac{n(n+1)(2n+1)}{6}
Sum of Cubes
Beautiful identity
i=1ni3=1+8+27++n3=[n(n+1)2]2\sum_{i=1}^{n} i^3 = 1 + 8 + 27 + \cdots + n^3 = \left[\frac{n(n+1)}{2}\right]^2
Geometric Series
r ≠ 1
i=0nri=1+r+r2++rn=1rn+11r\sum_{i=0}^{n} r^i = 1 + r + r^2 + \cdots + r^n = \frac{1-r^{n+1}}{1-r}

Proving the Sum of Integers Formula

Let's prove Gauss's formula using sigma notation. Let S=i=1niS = \sum_{i=1}^{n} i.

Write S forwards and backwards:

S = 1 + 2 + 3 + ... + (n-1) + n

S = n + (n-1) + (n-2) + ... + 2 + 1

Adding these two equations term by term:

2S = (n+1) + (n+1) + (n+1) + ... + (n+1) = n(n+1)

Therefore: S=n(n+1)2S = \frac{n(n+1)}{2}

The Sum of Cubes Surprise

Notice that i=1ni3=(i=1ni)2\sum_{i=1}^{n} i^3 = \left(\sum_{i=1}^{n} i\right)^2. The sum of cubes equals the square of the sum of integers! This elegant relationship is called Nicomachus's theorem.


The Bridge to Integration: Riemann Sums

Sigma notation is the language of Riemann sums. When we approximate the area under a curve using rectangles, we express it as:

Areai=1nf(xi)Δx\text{Area} \approx \sum_{i=1}^{n} f(x_i) \cdot \Delta x
where Δx=ban\Delta x = \frac{b-a}{n} and xi=a+iΔxx_i = a + i \cdot \Delta x

As n increases, the rectangles become thinner and the approximation improves. Taking the limit as nn \to \infty, the sum becomes the definite integral:

limni=1nf(xi)Δx=abf(x)dx\lim_{n \to \infty} \sum_{i=1}^{n} f(x_i) \cdot \Delta x = \int_a^b f(x) \, dx
The Definite Integral is the Limit of Riemann Sums
Riemann Sums: Sigma Notation in Action
Riemann Sum in Sigma Notation:
5Σi=1
f(xi) · Δx=
5Σi=1
f(xi) · 0.400
Expanded:
f(0.40) · 0.400+f(0.80) · 0.400+f(1.20) · 0.400+f(1.60) · 0.400+f(2.00) · 0.400
Width of Each Rectangle
Δx = (b - a) / n = (2 - 0) / 5 = 0.4000
Riemann Sum (Approximate Area)
3.520000
The Connection to Definite Integrals:
Riemann Sum5Σi=1f(xi)Δx
n → ∞
Definite Integral02 f(x) dx
As n → ∞, the rectangles perfectly fill the area under the curve, and the sum becomes the definite integral.

Why Closed-Form Formulas Matter

To evaluate the limit limnf(xi)Δx\lim_{n \to \infty} \sum f(x_i) \Delta x, we need to express the sum in closed form (without the sigma). The formulas fori\sum i, i2\sum i^2, andi3\sum i^3 make this possible.


Machine Learning Applications

Sigma notation is the mathematical foundation of machine learning. Nearly every formula in ML — from loss functions to gradients — uses summation.

Loss Functions: Measuring Prediction Errors

Mean Squared Error (MSE)
MSE=1ni=1n(yiy^i)2\text{MSE} = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2
Sum of squared differences between true and predicted values.
Cross-Entropy Loss
L=i=1nyilog(y^i)L = -\sum_{i=1}^{n} y_i \log(\hat{y}_i)
Sum of log-probability penalties for classification.

Gradients: Sums Over Training Examples

In machine learning, we compute gradients to update model parameters. The gradient is typically a sum over all training examples:

θL=1ni=1nθ(θ;xi,yi)\nabla_\theta L = \frac{1}{n} \sum_{i=1}^{n} \nabla_\theta \ell(\theta; x_i, y_i)
The gradient is the average of per-example gradients — a sum!

Mini-Batch Gradient Descent

We often approximate the full sum with a smaller batch:

θL1mibatchθ(θ;xi,yi)\nabla_\theta L \approx \frac{1}{m} \sum_{i \in \text{batch}} \nabla_\theta \ell(\theta; x_i, y_i)
Mini-batch gradients use a sample of m examples instead of all n.

Sigma Notation in Attention Mechanisms

The attention mechanism in transformers uses sigma notation:

Attention(Q,K,V)=softmax(QKTdk)V\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V

The softmax function is defined using sigma notation: softmax(zi)=ezijezj\text{softmax}(z_i) = \frac{e^{z_i}}{\sum_j e^{z_j}}


Python Implementation

Implementing Sigma Notation

Let's implement sigma notation in Python and verify our closed-form formulas:

Sigma Notation in Python
🐍sigma_notation.py
6Sigma Sum Function

This function directly implements sigma notation: start and end are the bounds, and f is the function being summed. This is exactly what ∑_{i=start}^{end} f(i) means.

EXAMPLE
sigma_sum(lambda i: i, 1, 5) computes 1+2+3+4+5 = 15
15Sum of First n Integers

The formula n(n+1)/2 was discovered by young Gauss when asked to sum 1 to 100. Instead of adding one by one, he paired numbers: (1+100)+(2+99)+... = 50×101 = 5050.

24Sum of Squares Formula

The formula n(n+1)(2n+1)/6 is crucial for Riemann sums. It lets us compute ∑i² without adding each term individually — essential when n → ∞.

32Pythonic Sigma Notation

Python&apos;s sum() with a generator expression is essentially sigma notation in code: sum(f(i) for i in range(a, b+1)) = ∑_{i=a}^{b} f(i)

41NumPy Vectorization

NumPy computes sums without explicit loops by operating on entire arrays at once. This is orders of magnitude faster for large n and mirrors how we think of sums mathematically.

47 lines without explanation
1import numpy as np
2
3# Sigma notation: compact way to write sums
4# ∑_{i=1}^{n} f(i) means "sum f(i) for i from 1 to n"
5
6def sigma_sum(f, start, end):
7    """
8    Compute ∑_{i=start}^{end} f(i)
9
10    This is the programmatic equivalent of sigma notation.
11    """
12    total = 0
13    for i in range(start, end + 1):
14        total += f(i)
15    return total
16
17# Example 1: Sum of first n integers
18# ∑_{i=1}^{n} i = 1 + 2 + 3 + ... + n
19n = 10
20result = sigma_sum(lambda i: i, 1, n)
21closed_form = n * (n + 1) // 2
22print(f"∑_{{i=1}}^{{{n}}} i = {result}")
23print(f"Closed form: n(n+1)/2 = {closed_form}")
24print()
25
26# Example 2: Sum of squares
27# ∑_{i=1}^{n} i² = 1 + 4 + 9 + ... + n²
28result_sq = sigma_sum(lambda i: i**2, 1, n)
29closed_form_sq = n * (n + 1) * (2*n + 1) // 6
30print(f"∑_{{i=1}}^{{{n}}} i² = {result_sq}")
31print(f"Closed form: n(n+1)(2n+1)/6 = {closed_form_sq}")
32print()
33
34# Example 3: Pythonic way using sum() and generators
35# These are equivalent to sigma notation
36pythonic_sum = sum(i for i in range(1, n + 1))
37pythonic_squares = sum(i**2 for i in range(1, n + 1))
38
39print("Pythonic equivalents:")
40print(f"sum(i for i in range(1, {n+1})) = {pythonic_sum}")
41print(f"sum(i**2 for i in range(1, {n+1})) = {pythonic_squares}")
42print()
43
44# NumPy vectorized approach (most efficient)
45# This is how we compute sums in practice
46indices = np.arange(1, n + 1)
47numpy_sum = np.sum(indices)
48numpy_squares = np.sum(indices ** 2)
49
50print("NumPy vectorized:")
51print(f"np.sum(np.arange(1, {n+1})) = {numpy_sum}")
52print(f"np.sum(np.arange(1, {n+1})**2) = {numpy_squares}")

Riemann Sums with Sigma Notation

Here's how sigma notation powers the approximation of integrals:

Riemann Sums Implementation
🐍riemann_sums.py
3Riemann Sum = Sigma Notation for Area

The Riemann sum is the direct application of sigma notation to area problems: we sum up the areas of n rectangles, each with width Δx and height f(xᵢ).

15Delta x Calculation

Δx = (b-a)/n divides the interval [a,b] into n equal parts. As n increases, Δx shrinks, and our approximation improves.

24The Sum Becomes an Integral

This line is sigma notation in action: np.sum(heights) * delta_x computes ∑f(xᵢ)·Δx. As n→∞, this limit becomes ∫f(x)dx.

38Convergence to True Area

Watch how the approximation improves as n increases. With n=1000, we get 6 decimal places of accuracy. This convergence is the fundamental theorem of calculus at work!

44 lines without explanation
1import numpy as np
2
3def riemann_sum(f, a, b, n, method='right'):
4    """
5    Compute the Riemann sum of f from a to b using n rectangles.
6
7    This is ∑_{i=1}^{n} f(xᵢ) · Δx
8
9    The method parameter determines which x value we use:
10    - 'left': xᵢ = a + (i-1)·Δx  (left endpoints)
11    - 'right': xᵢ = a + i·Δx    (right endpoints)
12    - 'midpoint': xᵢ = a + (i-0.5)·Δx (midpoints)
13    """
14    delta_x = (b - a) / n
15
16    if method == 'left':
17        x_values = np.array([a + i * delta_x for i in range(n)])
18    elif method == 'right':
19        x_values = np.array([a + i * delta_x for i in range(1, n + 1)])
20    else:  # midpoint
21        x_values = np.array([a + (i - 0.5) * delta_x for i in range(1, n + 1)])
22
23    # Apply sigma notation: ∑ f(xᵢ) · Δx
24    heights = f(x_values)
25    return np.sum(heights) * delta_x
26
27# Example: Approximate ∫₀² x² dx using Riemann sums
28# The exact answer is [x³/3]₀² = 8/3 ≈ 2.6667
29
30def f(x):
31    return x ** 2
32
33a, b = 0, 2
34exact = 8/3
35
36print("Approximating ∫₀² x² dx (exact = 8/3 ≈ 2.6667)")
37print()
38print("n       Right Sum    Midpoint    Error (Right)")
39print("-" * 55)
40
41for n in [4, 10, 50, 100, 1000]:
42    right = riemann_sum(f, a, b, n, 'right')
43    mid = riemann_sum(f, a, b, n, 'midpoint')
44    error = abs(right - exact)
45    print(f"{n:<8}{right:.6f}     {mid:.6f}    {error:.6f}")
46
47# As n → ∞, the Riemann sum approaches the definite integral!
48# lim_{n→∞} ∑_{i=1}^{n} f(xᵢ)Δx = ∫_a^b f(x) dx

Sigma Notation in Machine Learning

Almost every ML formula uses sigma notation under the hood:

Sigma Notation in ML Loss Functions
🐍ml_sums.py
6MSE as Sigma Notation

Mean Squared Error is a perfect example of sigma notation: we sum squared errors over all n training examples, then divide by n to get the average.

EXAMPLE
MSE = (1/4)[(3-2.8)² + (5-5.1)² + (2-2.5)² + (7-6.5)²]
25Cross-Entropy as Sigma Notation

The cross-entropy loss sums log-probabilities over all examples. The sigma notation makes it clear that we&apos;re aggregating information from the entire dataset.

43Gradient = Sum of Per-Example Gradients

In machine learning, the gradient is computed as a sum (or average) over training examples. This is why mini-batch gradient descent works: we approximate the full sum with a smaller sample.

51The Universal Pattern

Almost every loss function and gradient in ML uses sigma notation. Understanding sums deeply is essential for understanding how neural networks learn.

59 lines without explanation
1import numpy as np
2
3# Sigma notation is everywhere in machine learning!
4
5# Example 1: Mean Squared Error (MSE)
6# MSE = (1/n) ∑_{i=1}^{n} (yᵢ - ŷᵢ)²
7
8def mse_loss(y_true, y_pred):
9    """
10    Mean Squared Error loss function.
11    Uses sigma notation: sum of squared differences.
12    """
13    n = len(y_true)
14    return (1/n) * np.sum((y_true - y_pred) ** 2)
15
16# Example predictions
17y_true = np.array([3, 5, 2, 7])
18y_pred = np.array([2.8, 5.1, 2.5, 6.5])
19
20loss = mse_loss(y_true, y_pred)
21print(f"MSE Loss: {loss:.4f}")
22print()
23
24# Example 2: Cross-Entropy Loss
25# L = -∑_{i=1}^{n} yᵢ log(ŷᵢ)
26
27def cross_entropy_loss(y_true, y_pred):
28    """
29    Binary cross-entropy: -∑[y·log(ŷ) + (1-y)·log(1-ŷ)]
30    The sum is sigma notation!
31    """
32    eps = 1e-15  # Prevent log(0)
33    y_pred = np.clip(y_pred, eps, 1 - eps)
34    return -np.mean(y_true * np.log(y_pred) +
35                    (1 - y_true) * np.log(1 - y_pred))
36
37print("Cross-Entropy Loss example:")
38y_true_binary = np.array([1, 0, 1, 1])
39y_pred_probs = np.array([0.9, 0.1, 0.8, 0.95])
40ce_loss = cross_entropy_loss(y_true_binary, y_pred_probs)
41print(f"CE Loss: {ce_loss:.4f}")
42print()
43
44# Example 3: Gradient Descent Update
45# θ_new = θ_old - α · (1/n) ∑_{i=1}^{n} ∇L(θ; xᵢ, yᵢ)
46
47def gradient_descent_step(theta, X, y, learning_rate=0.01):
48    """
49    One step of gradient descent for linear regression.
50    The gradient is a sum over all training examples!
51    """
52    n = len(y)
53    predictions = X @ theta
54    errors = predictions - y
55
56    # Gradient: (1/n) ∑ xᵢ · (ŷᵢ - yᵢ) — sigma notation!
57    gradient = (1/n) * (X.T @ errors)
58
59    # Update rule
60    return theta - learning_rate * gradient
61
62print("Every gradient in ML is a sigma notation expression!")
63print("∇L = (1/n) ∑_{i=1}^{n} ∇ℓ(θ; xᵢ, yᵢ)")

Common Pitfalls

Pitfall 1: Confusing Index and General Term

In i=1ni2\sum_{i=1}^{n} i^2, the index is i and the general term is . Don't confuse which changes and which stays constant!

Pitfall 2: Wrong Bounds

Pay attention to whether sums start at 0 or 1. i=0nri\sum_{i=0}^{n} r^i has n+1 terms, but i=1nri\sum_{i=1}^{n} r^i has only n terms.

Pitfall 3: Trying to Factor Non-Constants

You can only factor out constants from a sum. This is wrong:

i=1nii2ii=1ni2\sum_{i=1}^{n} i \cdot i^2 \neq i \cdot \sum_{i=1}^{n} i^2

The variable i is not constant — it changes with each term!

Pitfall 4: Distributing Over Products

Summation does not distribute over multiplication:

i=1n(aibi)(ai)(bi)\sum_{i=1}^{n} (a_i \cdot b_i) \neq \left(\sum a_i\right) \cdot \left(\sum b_i\right)

Example: (1·1) + (2·2) = 1 + 4 = 5, but (1+2)·(1+2) = 9 ≠ 5.


Test Your Understanding

Test Your Understanding: Sigma Notation
1. What is the value of ∑_{i=1}^{4} i?
6
10
15
20
2. Which property allows us to write ∑(3·aᵢ) = 3·∑aᵢ?
Sum Rule
Constant Multiple Rule
Index Shift
Splitting Property
3. What does ∑_{i=1}^{n} 5 equal?
5
5n
n
5 + n
4. What is ∑_{i=1}^{3} i² ?
6
9
14
36
5. As n → ∞, what does the Riemann sum approach?
Zero
Infinity
The definite integral
The derivative

Summary

Sigma notation is the language of summation — a compact, powerful way to express adding many terms. It bridges discrete sums to continuous integrals and appears throughout calculus, statistics, and machine learning.

Key Concepts

ConceptDescription
Σ (sigma)Summation symbol — indicates adding terms
Index variableCounter (i, j, k, n) that steps through integer values
BoundsLower and upper limits on the index
General termExpression evaluated for each index value
Closed-form formulaExpression that computes sum without adding each term
Riemann sum∑f(xᵢ)Δx — area approximation using rectangles

Essential Formulas

i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
i=1ni2=n(n+1)(2n+1)6\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}
i=1ni3=[n(n+1)2]2\sum_{i=1}^{n} i^3 = \left[\frac{n(n+1)}{2}\right]^2
i=0nri=1rn+11r\sum_{i=0}^{n} r^i = \frac{1-r^{n+1}}{1-r}

Key Takeaways

  1. Sigma notation compactly expresses sums using i=mnai\sum_{i=m}^{n} a_i
  2. Linearity: Constants factor out, and sums distribute over addition
  3. Closed-form formulas let us compute sums without adding each term
  4. Riemann sums use sigma notation to approximate areas: f(xi)Δx\sum f(x_i) \Delta x
  5. As nn \to \infty, Riemann sums become definite integrals
  6. Machine learning uses sigma notation in every loss function and gradient
  7. In Python, use sum() with generators or np.sum() for efficient computation
The Power of Sigma Notation:
"Sigma notation transforms an endless list of additions into a single, elegant expression — bridging the discrete world of sums to the continuous world of integrals."
Coming Next: In the next section, we'll explore The Definite Integral as a Limit. We'll take Riemann sums to their logical conclusion by letting nn \to \infty, finally arriving at the definite integral — the exact area under a curve.
Loading comments...