HO28 - Maggie Johnson CS103A Handout#28 Sequences and...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Maggie Johnson Handout #28 CS103A Sequences and Summations Key topics: Sequences Arithmetic and Geometric Progressions Fractals 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 time on their hands) that decides to count their ancestors. She has two parents, four grandparents, eight great-grandparents, 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?
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
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?
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/15/2008 for the course CS 103A taught by Professor Plummer,r during the Fall '07 term at Stanford.

Page1 / 6

HO28 - Maggie Johnson CS103A Handout#28 Sequences and...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online