Handout #41
CS103A
February 22, 2008
Robert Plummer
Sequences and Summations
A mathematician, like a poet or a painter, is a maker of patterns.
G.H. Hardy
A Mathematician’s Apology (1940)
Sequences
Imagine a person (with a lot of spare time) who decides to count her ancestors.
She has two
parents, four grandparents, eight greatgrandparents, and so forth.
We could write these numbers
in a row: 2, 4, 8, 16, 32, 64, …
(where the … means and so forth).
To express a pattern of numbers in this manner, we often label the position of each number in the
row as in the following table.
1
2
3
4
5
6
2
4
8
16
32
64
When represented in this manner it is easy to recognize a formula that would give us the kth
element in the row: A
k
= 2
k
.
Note that we are just making an observation based on evidence in
guessing this formula.
We would need to do a proof to be absolutely certain.
A sequence
is an ordered list of elements written in a row, such that each element has a unique
position in the list.
We use a
k
to denote a single element of a sequence called a term
.
The k in a
k
is called a subscript
or index
.
An explicit formula
for a sequence is a rule that shows how the
value of a
k
is derived from k.
What is the programming analogy of a sequence?
A common problem in computer science is determining an explicit formula given only the first
few elements of a sequence.
When trying to find such a formula we try to find a pattern.
A good
place to start is in asking the following questions:
•
Are there runs of the same values?
•
Are terms obtained from previous terms by adding the same amount, or an amount that
depends on position in the sequence?
•
Are terms obtained from previous terms by multiplying by a particular amount?
•
Are terms obtained by combining previous terms in a certain way?
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
2
Here are some practice problems:
7, 11, 15, 19, 23,
27,
31,
35...
3,
6, 11, 18, 27,
38,
51,
66,
83...
0,
2,
8
26, 80, 242, 728, 2186, 6560, 19682...
And just for fun:
O,
T,
T,
F,
F,
S,
S,
E, ...
Summation & Product Notation
Going back to our original question of counting ancestors, suppose we want to know the total
number of ancestors for the past six generations.
There is a convenient shorthand notation to
write such sums.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Winter '07
 Plummer,R
 Computer Science, Tn, Geometric progression, Fractal, Koch.

Click to edit the document details