Sequences and Summations
Sequences
Definition of a sequence A sequence is a function from a subset of integers to a set S.
An example of a sequence Beginning with n=1
A geometric progression Beginning with n=0
An arithmetic progression Beginning with n=0
Example progression
Summations
Summations Sigma for “sum”
Product Pi for “product”
Summations Upper limit Lower limit Index of summation
Summations example The sum of the first 100 integers What’s the answer?
Summations example/picture We now have a square 10 (n) by 11 (n+1) with area 110 units We need half of that (10x11)/2
Summations challenge
Summations challenge
Summations: shifting indices
Summations: a theorem Proof: see the book
Summations: nesting
Summations: implementing a nesting as a bit of program for i = 1 to n-1 do for j=i+1 to n do sum = sum + i*j
Summations: just a wee tweak
One More Example
One More Example Table 2, page 157
One More Example Then use this
Challenge