{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Sequences

# Sequences - CSE 1400 Applied Discrete Mathematics Sequences...

This preview shows pages 1–4. Sign up to view the full content.

CSE 1400 Applied Discrete Mathematics Sequences Department of Computer Sciences College of Engineering Florida Tech Spring 2011 1 Sequences 1 1 . 1 Operations on Sequences 2 1 . 2 Useful Sequences 3 1 . 3 Growth Rates 5 1 . 4 Defined by Recurrence Equations 6 1 . 5 Defined by Functions on the Natural Numbers 8 1 . 6 Computed by Algorithms 8 1 . 7 Non-Computable Sequence 9 Abstract 1 Sequences Sequences are ordered lists of values. Ordinal numbers: first, second, third, fourth, . . . , specify the positions of these values. One famous sequence is the Fibonacci sequence. h 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, . . . i The first, second, third, fourth, and fifth Fibonacci numbers are 0, 1, 1, 2, and 3. The values in the Fibonacci sequence can be named f k where the subscript k denotes the position of the value. In comput- ing, it is customary to start the subscript k at 0 so that the first, sec- ond, third, fourth, and fifth Fibonacci numbers are named f 0 , f 1 , f 2 , f 3 , and f 4 . Let ~ S = h s 0 , s 1 , s 2 , s 3 , s 4 , . . . i be a sequence. The subscripted names s 0 , s 1 , s 2 , s 3 , s 4 , . . . , are called terms and they refer to values in the first, second, third, fourth, fifth, etc., positions of the sequence. In computing theory, sequences

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

View Full Document
cse 1400 applied discrete mathematics sequences 2 contain a countably infinite number of terms. In computing practice, sequences have a finite number of terms. For instance, the sequence of primes less than 30 is ~ P < 30 = h 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 i There is a a sequence with no terms at all, called the empty sequence. I’ll use σ to denote the empty sequence, so that σ = ~ . 1 . 1 Operations on Sequences There are some basic operations that can be performed on sequences. empty() maps a sequence to True or False . null ( ~ S ) = True if ~ S is empty False if ~ S contains at least one term length() maps a finite sequence to the number of terms it contains. length ( ~ S ) = n head() maps a non-empty sequence to its first element head ( ~ S ) = s 0 last() maps a non-empty, finite sequence to its last element last ( ~ S ) = s n - 1 tail() removes the first term from a sequence tail ( ~ S ) = h s 1 , s 2 , s 3 , . . . , s n - 1 i concat(,) concatenates two finite sequences to form a single sequence concat ( ~ S , ~ T ) = h s 1 , s 2 , . . . , s n - 1 , t 0 , t 1 , . . . , t m i map(,) applies a function f to each term of a sequence map ( f , ~ S ) = h f ( s 1 ) , f ( s 2 ) , . . . , f ( n - 1 ) i
cse 1400 applied discrete mathematics sequences 3 1 . 2 Useful Sequences Here is a list of useful sequences. • The Alice sequence ~ A = h 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, . . . i keeps a “tally.” • The Gauss sequence ~ G = h 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 . . . i computes the sum of a “tally.” • The sequence of triangular numbers ~ T = h 0, 0, 1, 3, 6, 10, 15, 21, 28, 36, . . . i computes the number of edges in a complete graph. • The doubling sequence ~ D = h 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, . . . i computes a common growth model. • The Mersenne sequence ~ M = h 0, 1, 3, 7, 15, 31, 63, 127, 255, 511 . . . i computes the sum of the doubling growth model.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}