Summation (CSCI 2824, Spring 2015)In this lecture we will cover the basic notation for summation (and product). Concepts learned:
SummationGiven a sequence of numbers We write this summation succinctly as: The symbol Example 1:Once again we think in terms of code: Adding up a Sequence
int SumSequence(int n, int [] A){ int j; int sum = 0; for (j=1; j <= n; ++j){ sum = sum + A[j]; } return sum; } If the sequence with the base case Take the sequence The base case is The closed form for It is really the summation of first The last equation gives us which gives us the required closed form for Observation Getting closed form representations for sequences and summations is often a difficult art in itself. Carl Fredrich Gauss was one of the unrivalled master at this!! ProductGiven a sequence of numbers roduct of the
first We write this summation succinctly as: The symbol Example 1: |