Section Summary. Sequences. Recurrence Relations. Summations Special Integer Sequences (optional)

Similar documents
Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

Section Summary. Definition of a Function.

Sec$on Summary. Sequences. Recurrence Relations. Summations. Ex: Geometric Progression, Arithmetic Progression. Ex: Fibonacci Sequence

Definition: A sequence is a function from a subset of the integers (usually either the set

Discrete Structures Lecture Sequences and Summations

Countable and uncountable sets. Matrices.

Countable and uncountable sets. Matrices.

CS100: DISCRETE STRUCTURES. Lecture 3 Matrices Ch 3 Pages:

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

Chapter 2 - Basics Structures

Matrices. Chapter Definitions and Notations

Matrix Multiplication

Elementary maths for GMT

Recurrence Relations

Phys 201. Matrices and Determinants

Section 9.2: Matrices.. a m1 a m2 a mn

Matrices: 2.1 Operations with Matrices

Linear Equations in Linear Algebra

Lecture 3 Linear Algebra Background

Matrices BUSINESS MATHEMATICS

Matrix Arithmetic. j=1

Section 9.2: Matrices. Definition: A matrix A consists of a rectangular array of numbers, or elements, arranged in m rows and n columns.

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

Linear Algebra Tutorial for Math3315/CSE3365 Daniel R. Reynolds

A matrix over a field F is a rectangular array of elements from F. The symbol

MATRICES. a m,1 a m,n A =

Sequences A sequence is a function, where the domain is a set of consecutive positive integers beginning with 1.

MATH2210 Notebook 2 Spring 2018

ICS141: Discrete Mathematics for Computer Science I

Review of Vectors and Matrices

. a m1 a mn. a 1 a 2 a = a n

Matrices and Vectors

Two matrices of the same size are added by adding their corresponding entries =.

Lecture 3: Matrix and Matrix Operations

Chapter 5: Sequences, Mathematic Induction, and Recursion

Prepared by: M. S. KumarSwamy, TGT(Maths) Page

Linear Algebra V = T = ( 4 3 ).

Introduction. Vectors and Matrices. Vectors [1] Vectors [2]

A Review of Matrix Analysis

Mathematics 13: Lecture 10

Recurrence Relations and Recursion: MATH 180

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

8. Sequences, Series, and Probability 8.1. SEQUENCES AND SERIES

A FIRST COURSE IN LINEAR ALGEBRA. An Open Text by Ken Kuttler. Matrix Arithmetic

COM S 330 Lecture Notes Week of Feb 9 13

CLASS 12 ALGEBRA OF MATRICES

1 Matrices and Systems of Linear Equations. a 1n a 2n

Sequences and Series. College Algebra

Matrix representation of a linear map

3. Vector spaces 3.1 Linear dependence and independence 3.2 Basis and dimension. 5. Extreme points and basic feasible solutions

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections )

Matrix representation of a linear map

n n matrices The system of m linear equations in n variables x 1, x 2,..., x n can be written as a matrix equation by Ax = b, or in full

Linear Algebra March 16, 2019

Stage-structured Populations

Kevin James. MTHSC 3110 Section 2.1 Matrix Operations

DS-GA 1002 Lecture notes 0 Fall Linear Algebra. These notes provide a review of basic concepts in linear algebra.

Chapter 2. Ma 322 Fall Ma 322. Sept 23-27

Announcements Wednesday, October 10

Functions. Given a function f: A B:

Matrices. 1 a a2 1 b b 2 1 c c π

Matrix Basic Concepts

Section-A. Short Questions

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

CSCE 222 Discrete Structures for Computing. Dr. Hyunyoung Lee

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Chapter 4 - MATRIX ALGEBRA. ... a 2j... a 2n. a i1 a i2... a ij... a in

Chapter 8: Recursion. March 10, 2008

CS Discrete Mathematics Dr. D. Manivannan (Mani)

Knowledge Discovery and Data Mining 1 (VO) ( )

ICS 6N Computational Linear Algebra Matrix Algebra

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

Systems of Linear Equations and Matrices

ELEMENTARY LINEAR ALGEBRA

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

Elementary Row Operations on Matrices

Sequences are ordered lists of elements

Matrix Algebra & Elementary Matrices

Systems of Linear Equations and Matrices

Matrix Algebra Determinant, Inverse matrix. Matrices. A. Fabretti. Mathematics 2 A.Y. 2015/2016. A. Fabretti Matrices

Introduction to Quantitative Techniques for MSc Programmes SCHOOL OF ECONOMICS, MATHEMATICS AND STATISTICS MALET STREET LONDON WC1E 7HX

Linear System of Equations

Propositional Logic, Predicates, and Equivalence

12 Sequences and Recurrences

Matrices and Linear Algebra

Think about systems of linear equations, their solutions, and how they might be represented with matrices.

A primer on matrices

MATH Mathematics for Agriculture II

Jim Lambers MAT 610 Summer Session Lecture 1 Notes

CHAPTER 6. Direct Methods for Solving Linear Systems

Matrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices

Linear Algebra and Matrix Inversion

Section 5.5: Matrices and Matrix Operations

Matrix Arithmetic. a 11 a. A + B = + a m1 a mn. + b. a 11 + b 11 a 1n + b 1n = a m1. b m1 b mn. and scalar multiplication for matrices via.

Fundamentals of Engineering Analysis (650163)

CHAPTER 7: Systems and Inequalities

is a 3 4 matrix. It has 3 rows and 4 columns. The first row is the horizontal row [ ]

Transcription:

Section 2.4

Section Summary Sequences. o Examples: Geometric Progression, Arithmetic Progression Recurrence Relations o Example: Fibonacci Sequence Summations Special Integer Sequences (optional)

Sequences Definition1: A sequence is a function from a subset of the integers (usually either the set {0, 1, 2, 3, 4,..} or {1, 2, 3, 4,.} ) to a set S. The notation a n is used to denote the image of the integer n. We can think of a n as the equivalent of f(n) where f is a function from {0,1,2,..} to S. We call a n a term of the sequence. o A sequence is a discrete structure used to represent an ordered list. o 1,2,3,5,8 is a finite sequence, 1,3,9,27,,3 n, is an finite sequence Example: consider the sequence {a n }, where a n =1/n, list the first four items of the sequence. Solution: o 1,1/2,1/3,1/4

Geometric Progression Definition 2: A geometric progression is a sequence of the form: where the initial term a and the common ratio r are real numbers. Examples: 1. Let a = 1 and r = 1. Then: 2. Let a = 2 and r = 5. Then: 3. Let a = 6 and r = 1/3. Then:

Arithmetic Progression Definition 3: A arithmetic progression is a sequence of the form: where the initial term a and the common difference d are real numbers. Examples: 1. Let a = 1 and d = 4: 2. Let a = 7 and d = 3: 3. Let a = 1 and d = 2:

Strings Strings : Sequences of the form a 1, a 2,..., a n used in computer science are also called strings. This string is also denoted by a 1 a 2... a n. ( e.g. bit strings, which are finite sequences of bits) The length of a string is the number of terms in this string. The empty string, denoted by λ, is the string that has no terms. The empty string has length zero. Example: the string abcd is a string of length four.

Recurrence Relations Definition 4: A recurrence relation for the sequence {a n } is a equation that expresses a n in terms of one or more of the previous terms of the sequence, namely, a 0, a 1,, a n-1, for all integers n with n n 0, where n 0 is a nonnegative integer. A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation. A recurrence relation is said to recursively define a sequence. The initial conditions for a sequence specify the terms that precede the first term where the recurrence relation takes effect.

Questions about Recurrence Relations Example 1: Let {a n } be a sequence that satisfies the recurrence relation a n = a n-1 + 3 for n = 1,2,3,4,. and suppose that a 0 = 2. What are a 1, a 2 and a 3? [Here a 0 = 2 is the initial condition.] Solution: We see from the recurrence relation that a 1 = a 0 + 3 = 2 + 3 = 5 a 2 = 5 + 3 = 8 a 3 = 8 + 3 = 11

Questions about Recurrence Relations Example 2: Let {a n } be a sequence that satisfies the recurrence relation a n = a n-1 a n-2 for n = 2,3,4,. and suppose that a 0 = 3 and a 1 = 5. What are a 2,a 3 and a 4? [Here the initial conditions are a 0 = 3 and a 1 = 5. ] Solution: o We see from the recurrence relation that o a 2 = a 1 - a 0 = 5 3 = 2 o a 3 = a 2 a 1 = 2 5 = 3 o a 4 = a 3 a 3 = 3 2= 5

Fibonacci Sequence Definition 5: Define the Fibonacci sequence, f 0,f 1,f 2,, by: o Initial Conditions: f 0 = 0, f 1 = 1 o Recurrence Relation: f n = f n-1 + f n-2 for n=2,3,4. Example: Find f2,f3,f4, f5 and f6. Answer: o f2 = f1 + f0 = 1 + 0 = 1, o f3 = f2 + f1 = 1 + 1 = 2, o f4 = f3 + f2 = 2 + 1 = 3, o f5 = f4 + f3 = 3 + 2 = 5, o f6 = f5 + f4 = 5 + 3 = 8.

Questions about Recurrence Relations Example : Determine whether the sequence {a n }, where a n = 3n for every nonnegative integer n, is a solution of the recurrence relation a n = 2 an 1 a n 2 for n = 2, 3, 4,.... Answer the same question where a n = 2 n and where a n = 5. Solution: o Suppose that a n = 3n for every nonnegative integer n. Then, for n 2, we see that 2a n 1 a n 2 = 2(3(n 1)) 3(n 2) = 3n = a n. Therefore, {a n }, where a n = 3n, is a solution of the recurrence relation. o Suppose that a n = 2 n for every nonnegative integer n. Note that a 0 = 1, a 1 = 2, and a 2 = 4. Because 2a 1 a 0 = 2 2 1 = 3 a 2, we see that {a n }, where a n = 2 n, is not a solution of the recurrence relation. o Suppose that a n = 5 for every nonnegative integer n. Then for n 2, we see that a n = 2a n 1 a n 2 = 2 5 5 = 5 = a n. Therefore, {a n }, where a n = 5, is a solution of the recurrence relation.

Solving Recurrence Relations Finding a formula for the nth term of the sequence generated by a recurrence relation together with the initial conditions is called solving the recurrence relation. Such a formula is called a closed formula.

Iterative Solution Example Method 1: Working upward, forward substitution Starting with the initial condition, and working upward until we reach a n to deduce a closed formula for the sequence. Example : Let {a n } be a sequence that satisfies the recurrence relation a n = a n-1 + 3 for n = 2,3,4,. and suppose that a 1 = 2. a 2 = 2 + 3 a 3 = (2 + 3) + 3 = 2 + 3 2 a 4 = (2 + 2 3) + 3 = 2 + 3 3... a n = a n-1 + 3 = (2 + 3 (n 2)) + 3 = 2 + 3(n 1)

Iterative Solution Example Method 2: Working downward, backward substitution starting with the term a n and working downward until we reach the initial condition to deduce this same formula. Example : Let {a n } be a sequence that satisfies the recurrence relation a n = a n-1 + 3 for n = 2,3,4,. and suppose that a 1 = 2. a n = a n-1 + 3 = (a n-2 + 3) + 3 = a n-2 + 3 2 = (a n-3 + 3 )+ 3 2 = a n-3 + 3 3... = a 2 + 3(n 2) = (a 1 + 3) + 3(n 2) = 2 + 3(n 1)

Financial Application Example: Suppose that a person deposits $10,000.00 in a savings account at a bank yielding 11% per year with interest compounded annually. How much will be in the account after 30 years? Solution : o Let P n denote the amount in the account after 30 years. P n satisfies the following recurrence relation: o P n = P n-1 + 0.11P n-1 = (1.11) P n-1 with the initial condition P 0 = 10,000 o P 1 = (1.11)P 0 o P 2 = (1.11)P 1 = (1.11) 2 P 0 o P 3 = (1.11)P 2 = (1.11) 3 P 0 o : o P n = (1.11)P n-1 = (1.11) n P 0 = (1.11) n 10,000 o P n = (1.11) n 10,000 o P 30 = (1.11) 30 10,000 = $228,992.97

Special Integer Sequences Given a few terms of a sequence, try to identify the sequence. Conjecture a formula, recurrence relation, or some other rule. Some questions to ask? o Are there repeated terms of the same value? o Can you obtain a term from the previous term by adding an amount or multiplying by an amount? o Can you obtain a term by combining the previous terms in some way? o Are they cycles among the terms? o Do the terms match those of a well known sequence?

Questions on Special Integer Sequences Example 1: Find formulae for the sequences with the following first five terms: 1, 1/2, 1/4, 1/8, 1/16 Solution: Note that the denominators are powers of 2. The sequence with a n = 1/2 n is a possible match. This is a geometric progression with a = 1 and r = ½. Example 2: Consider 1,3,5,7,9 Solution: Note that each term is obtained by adding 2 to the previous term. A possible formula is a n = 2n + 1. This is an arithmetic progression with a =1 and d = 2.

Questions on Special Integer Sequences Example 3: How can we produce the terms of a sequence if the first 10 terms are 5, 11, 17, 23, 29, 35, 41, 47, 53, 59? Solution: Note that each of the first 10 terms of this sequence after the first is obtained by adding 6 to the previous term. Consequently, the nth term could be produced by starting with 5 and adding 6 a total of n 1 times; that is, a reasonable guess is that the nth term is 5 + 6(n 1) = 6n 1. This is an arithmetic progression with a = 5 and d = 6.

Useful Sequences

Questions on Special Integer Sequences Example : Conjecture a simple formula for an if the first 10 terms of the sequence {a n } are 1, 7, 25, 79, 241, 727, 2185, 6559, 19681, 59047. Solution: Comparing these terms with the corresponding terms of the sequence {3 n }, we notice that the nth term is 2 less than the corresponding power of 3. We see that a n = 3 n 2 for 1 n 10 and conjecture that this formula holds for all n.

Summations Sum of the terms from the sequence The notation: represents The variable j is called the index of summation. It runs through all the integers starting with its lower limit m and ending with its upper limit n.

Summations Example: What is the value of? Solution: Example : What is the value of? Solution :

Summations More generally for a set S: Example: What is the value of? Solution: o the sum of the values of s for all the members of the set {0, 2, 4},

Product Notation (optional) Product of the terms from the sequence The notation: represents

Geometric Series THEOREM 1: Sums of terms of geometric progressions

Double summations Double summations arise in many contexts (as in the analysis of nested loops in computer programs) o first expand the inner summation and then continue by computing the outer summation Example : Solution :

Section 2.6

Section Summary Definition of a Matrix Matrix Arithmetic Transposes and Powers of Arithmetic Zero-One matrices

Matrix Definition 1: A matrix is a rectangular array of numbers. A matrix with m rows and n columns is called an m n matrix. o The plural of matrix is matrices. o A matrix with the same number of rows as columns is called square. o Two matrices are equal if they have the same number of rows and the same number of columns and the corresponding entries in every position are equal. 3 2 matrix

Notation Let m and n be positive integers and let The i th row of A is the 1 n matrix [a i1, a i2,,a in ]. The j th column of A is the m 1 matrix: The (i,j) th element or entry of A is the element a ij. We can use A = [a ij ] to denote the matrix with its (i,j) th element equal to a ij.

Matrix Arithmetic: Addition Definition 3: Let A = [a ij ] and B = [b ij ] be m n matrices. The sum of A and B, denoted by A + B, is the m n matrix that has a ij + b ij as its (i,j)th element. In other words, A + B = [a ij + b ij ]. Example: Note that matrices of different sizes can not be added.

Matrix Multiplication Definition 4: Let A be an m k matrix and B be a k n matrix. The product of A and B, denoted by A B, is the m n matrix that has its (i,j) th element equal to the sum of the products of the corresponding elments from the i th row of A and the j th column of B. In other words, if AB = [c ij ] then c ij = a i1 b 1j + a i2 b 2j + + a kj b 2j. Example: = The product of two matrices is undefined when the number of columns in the first matrix is not the same as the number of rows in the second.

Illustration of Matrix Multiplication The Product of A = [a ij ] and B = [b ij ]

Matrix Multiplication is not Commutative Example: Let Does AB = BA? Solution: AB BA

Identity Matrix and Powers of Matrices Definition 5: The identity matrix of order n is the n n matrix I n = [ ij ], where ij = 1 if i = j and ij = 0 if i j. when A is an m n matrix, AI n = I m A = A Powers of square matrices can be defined. When A is an n n matrix, we have: A 0 = I n A r = AAA A r times

Transposes of Matrices Definition 6: Let A = [a ij ] be an m n matrix. The transpose of A, denoted by A t,is the n m matrix obtained by interchanging the rows and columns of A. If A t = [b ij ], then b ij = a ji for i =1,2,,n and j = 1,2,...,m.

Transposes of Matrices Definition 7: A square matrix A is called symmetric if A = A t. Thus A = [a ij ] is symmetric if a ij = a ji for i and j with 1 i n and 1 j n. Square matrices do not change when their rows and columns are interchanged.

Zero-One Matrices A matrix all of whose entries are either 0 or 1 is called a zeroone matrix. Algorithms operating on discrete structures represented by zero-one matrices are based on Boolean arithmetic defined by the following Boolean operations:

Zero-One Matrices Definition 8: Let A = [a ij ] and B = [b ij ] be an m n zero-one matrices. o The join of A and B is the zero-one matrix with (i,j)th entry a ij b ij. The join of A and B is denoted by A B. o The meet of of A and B is the zero-one matrix with (i,j)th entry a ij b ij. The meet of A and B is denoted by A B.

Joins and Meets of Zero-One Matrices Example: Find the join and meet of the zero-one matrices Solution: o The join of A and B is o The meet of A and B is

Boolean Product of Zero-One Matrices Definition 9: Let A = [a ij ] be an m k zero-one matrix and B = [b ij ] be a k n zero-one matrix. The Boolean product of A and B, denoted by A B, is the m n zero-one matrix with(i,j)th entry c ij = (a i1 b 1j ) (a i2 b 2j ) (a ik b kj ). Example: Find the Boolean product of A and B, where

Boolean Powers of Zero-One Matrices Definition 10: Let A be a square zero-one matrix and let r be a positive integer. The rth Boolean power of A is the Boolean product of r factors of A, denoted by A [r]. Hence, We define A [0] to be In. The Boolean product is well defined because the Boolean product of matrices is associative.

Boolean Powers of Zero-One Matrices Example: Let Find A n for all positive integers n. Solution: