Computer Science Matrix - Summation and Induction
Introduction to Summation Notation
Sigma Notation (): This is a compact way to represent a sum of a sequence of numbers, analogous to a
for loopin computer science.Components:
: The sigma symbol, indicating summation.
: The index variable (or generator variable), which changes with each term.
: The starting index (lower limit).
: The terminal index (upper limit).
: The generator or general term, which defines the pattern of the terms being summed.
Evaluating Sums
To evaluate a sum, substitute the index variable with values from the starting index up to the terminal index, and then add the resulting terms.
Example 1: Evaluate
Start index:
Terminal index:
Generator:
Expansion:
Calculation:
Example 2: Evaluate
Start index:
Terminal index:
Generator:
Expansion:
Calculation:
Example 3: Evaluate
Start index:
Terminal index:
Generator:
Expansion:
Calculation: (Note: The calculation was not completed in the transcript, but the expansion is key).
Writing Sums in Sigma Notation
The goal is to reverse the process of evaluation: given an expanded sum, find its compact sigma notation.
Rule of Thumb: If something stays the same throughout all terms, it stays the same in the generator.
Example A: Write the sum in sigma notation.
Pattern Recognition: All numbers are even, multiples of 2.
Generator: (or , etc.).
Indices:
For ,
For ,
…
For ,
Sigma Notation:
Example B: Write the sum in sigma notation.
Pattern Recognition: All numbers are powers of 2.
Generator:
Indices:
For ,
For ,
…
For ,
Sigma Notation:
There can be multiple ways to represent a sum with different starting indices, but the overall sequence of terms remains the same.
Example C: Write the sum in sigma notation.
Pattern Recognition: The function and the denominator remain constant. The numerator increases by 1 each time.
Generator:
Indices:
For ,
For ,
…
For ,
Sigma Notation:
Rules for Sums (Properties of Summation)
These rules are derived from properties of addition and multiplication.
Let and , and is a constant.
Rule 1: Constant Multiple Rule
If a constant is multiplied by the generator, it can be factored out of the summation:
Concept: Just as you can factor out a common term from an expanded sum, you can factor out a constant from a sigma notation.
Rule 2: Sum/Difference Rule
The sum (or difference) of two generators can be split into the sum (or difference) of two separate summations:
Concept: This allows distributing the summation across terms being added or subtracted within the generator.
Rule 3: Sum of a Constant
If the generator is just a constant (i.e., it doesn't depend on the index ):
Special Case: If the starting index is ():
Concept: This is equivalent to repeated addition, which is multiplication (e.g., ).
This rule holds even if the constant is negative or if subtraction is involved.
Application: Approximating Area with Rectangles (Riemann Sums)
Problem: Approximate the area under the curve on the interval using right-endpoint rectangles.
Step 1: Calculate the width of each rectangle ( or base)
Step 2: Determine the heights of the rectangles
Using right endpoints, the x-values for the heights are .
Heights:
Step 3: Write the approximate area () as an expanded sum
Step 4: Convert the expanded sum to sigma notation
Step 5: Substitute the function into the sum
Step 6: Simplify the expression using summation rules
Since is a constant with respect to the index , can be factored out:
This result shows that to find the exact area, a formula for the sum of squares () is needed.
Special Summation Formulas
These formulas provide immediate values for common sums, eliminating the need for manual expansion and calculation.
1. Sum of the First Integers (Gauss's Formula)
Formula:
Origin: Attributed to Carl Friedrich Gauss. He observed that pairing the first and last numbers (1 and ), second and second-to-last (2 and ), etc., always yields the sum . There are such pairs.
Example: For , the sum is .
2. Sum of the First Squares
Formula:
This formula is more complex and relates to geometric principles involving hexagons in 2D space.
3. Sum of the First Cubes
Formula:
This formula relates to 3D principles, such as tetrahedrons.
These formulas are essential for simplifying expressions derived from applications like Riemann sums and should be memorized.
Mathematical Induction
Purpose: To rigorously prove that a mathematical statement (or formula) is true for all natural numbers.
Motivation: While we can test a formula with a few numbers, we cannot test it for infinitely many. Induction provides a formal proof method.
Analogy: The