VCU, Department of Computer Science CMSC 302 Sequences and Summations Vojislav Kecman 9/19/2018.

Slides:



Advertisements
Similar presentations
1 Sequences Rosen 6 th ed., §2.4 2 Sequences A sequence represents an ordered list of elements.A sequence represents an ordered list of elements. e.g.,
Advertisements

22C:19 Discrete Math Sequence and Sums Fall 2011 Sukumar Ghosh.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
CSE115/ENGR160 Discrete Mathematics 02/22/11 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/21/12
1 Section 3.2 Sequences and Summations. 2 Sequence Function from a subset of Z (usually the set beginning with 1 or 0) to a set S a n denotes the image.
CMSC 250 Discrete Structures Summation: Sequences and Mathematical Induction.
Sequences & Summations CS 1050 Rosen 3.2. Sequence A sequence is a discrete structure used to represent an ordered list. A sequence is a function from.
Sequences and Summations
2015 년 봄학기 강원대학교 컴퓨터과학전공 문양세 이산수학 (Discrete Mathematics) 수열과 합 (Sequences and Summations)
Section 2.4. Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations.
Introduction to sequences and series
Sequences and Summations
Fall 2002CMSC Discrete Structures1 … and now for… Sequences.
Section 2.4. Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations.
1 Sequences Rosen 6 th ed., §2.4 2 Sequences A sequence represents an ordered list of elements.A sequence represents an ordered list of elements. Formally:
Discrete math Bijections 2 A function f is a one-to-one correspondence, or a bijection or reversible, or invertible, iff it is both one-to-one and onto.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 Module.
Module #12: Summations Rosen 5 th ed., §3.2 Based on our knowledge on sequence, we can move on to summations easily.
강원대학교 컴퓨터과학전공 문양세 이산수학 (Discrete Mathematics) 수열과 합 (Sequences and Summations)
Sequences and Summations Section 2.4. Section Summary Sequences. – Examples: Geometric Progression, Arithmetic Progression Recurrence Relations – Example:
CS201: Data Structures and Discrete Mathematics I
CompSci 102 Discrete Math for Computer Science
Sequences and Series (Section 9.4 in Textbook).
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
12 INFINITE SEQUENCES AND SERIES. In general, it is difficult to find the exact sum of a series.  We were able to accomplish this for geometric series.
Lecture 2.5: Sequences CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag.
2014 년 봄학기 강원대학교 컴퓨터과학전공 문양세 이산수학 (Discrete Mathematics) 수열과 합 (Sequences and Summations)
Section 3.2: Sequences and Summations. Def: A sequence is a function from a subset of the set of integers (usually the set of natural numbers) to a set.
Module #10: Proof Strategies Rosen 5 th ed., §3.1 (already covered)
Discrete Mathematics Lecture # 22 Recursion.  First of all instead of giving the definition of Recursion we give you an example, you already know the.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sequences and Summations.
3/16/20161 … and now for… Sequences. 3/16/20162 Sequences Sequences represent ordered lists of elements. A sequence is defined as a function from a subset.
8.1 CompSci 102© Michael Frank Today’s topics Integers & Number TheoryIntegers & Number Theory – –Sequences – –Summations Reading: Sections 3.2Reading:
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 Module.
8.1 CompSci 102© Michael Frank Today’s topics Integers & Number TheoryIntegers & Number Theory – –More proof techniques – –Sequences – –Summations Reading:
Sequences Lecture 11. L62 Sequences Sequences are a way of ordering lists of objects. Java arrays are a type of sequence of finite size. Usually, mathematical.
22C:19 Discrete Structures Sequence and Sums Fall 2014 Sukumar Ghosh.
Fall 2002CMSC Discrete Structures1 Chapter 3 Sequences Mathematical Induction Recursion Recursion.
Sequences and Sums.
INFINITE SEQUENCES AND SERIES In general, it is difficult to find the exact sum of a series.  We were able to accomplish this for geometric series and.
Relations, Functions, and Matrices
The sum of the infinite and finite geometric sequence
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Copyright © Cengage Learning. All rights reserved.
Mathematical Induction Recursion
Rosen 5th ed., §3.2 ~19 slides, ~1 lecture
Rosen 5th ed., §3.2 ~19 slides, ~1 lecture
Rosen 5th ed., §3.2 ~9 slides, ~½ lecture
ICS 253: Discrete Structures I
CS 250, Discrete Structures, Fall 2015
CS 250, Discrete Structures, Fall 2011 Nitesh Saxena
CMSC Discrete Structures
CS 250, Discrete Structures, Fall 2013
Sets, Sequences, and Summations
Copyright © Zeph Grunschlag,
SUMMATION or SIGMA NOTATION
Recurrences (Method 4) Alexandra Stefan.
MA/CSSE 474 More Math Review Theory of Computation
Rosen 5th ed., §3.2 ~9 slides, ~½ lecture
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
9.1 Sequences Sequences are ordered lists generated by a
Discrete Mathematics and its Applications
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
Sequences and Summation Notation
Chapter 1 Introduction to the Theory of Computation
Discrete Mathematics and its Applications
Presentation transcript:

VCU, Department of Computer Science CMSC 302 Sequences and Summations Vojislav Kecman 9/19/2018

Sequences Rosen 6th ed., §2.4 9/19/2018

§2.4: Sequences, Strings, & Summations A sequence or series is just like an ordered n-tuple, except: Each element in the series has an associated index number. A sequence or series may be infinite. A string is a sequence of symbols from some finite alphabet. A summation is a compact notation for the sum of all terms in a (possibly infinite) series. 9/19/2018

Sequences Def. A sequence or series {an} is identified with a generating function f: S  A for some subset Sℕ and for some set A. Often we have S = ℕ or S=ℤ+= ℕ {0}. Sequences may also be generalized to indexed sets, in which the set S does not have to be a subset of ℕ. For general indexed sets, S may not even be a set of numbers at all. Def. If f is a generating function for a series {an}, then for nS, the symbol an denotes f(n), also called term n of the sequence. The index of an is n. (Or, often i is used.) A series is sometimes denoted by listing its first and/or last few elements, and using ellipsis (…) notation. E.g., “{an} = 0, 1, 4, 9, 16, 25, …” is taken to mean n ℕ+, an = (n-1)2. it is an infinite sequence 9/19/2018

Sequence Examples Some authors write “the sequence (i.e., series) a1, a2, …” instead of {an}, to ensure that the set of indices is clear. Be careful: Our book often leaves the indices ambiguous. Ex. An example of an infinite series: Consider the series {an} = a1, a2, …, where (n1) an= f(n) = 1/n. Then, we have {an} = 1, 1/2, 1/3, … 9/19/2018

Example with Repetitions Like tuples, but unlike sets, a sequence may contain repeated instances of an element. Consider the sequence {bn} = b0, b1, … (note that 0 is an index) where bn = (1)n. Thus, {bn} = 1, 1, 1, 1, … Note repetitions! This {bn} denotes an infinite sequence of 1’s and 1’s, not the 2-element set {1, 1}. 9/19/2018

Recognizing Sequences Sometimes, you’re given the first few terms of a sequence, and you are asked to find the sequence’s generating function, or a procedure to enumerate the sequence. Examples: What’s the next number? 1,2,3,4,… 1,3,5,7,9,… 2,3,5,7,11,... 0,3,8,15, … 5 (the 5th smallest number >0) 11 (the 6th smallest odd number >0) 13 (the 6th smallest prime number) 24 ( f ( n ) = ) 9/19/2018

The Trouble with Sequence Recognition As you know, these problems are popular on IQ tests, but… The problem of finding “the” generating function given just an initial subsequence is not a mathematically well defined, i.e., posed, problem. This is because there are infinitely many computable functions that will generate any given initial subsequence. We implicitly are supposed to find the simplest such function (because this one is assumed to be most likely), but, how are we to objectively define the simplicity of a function? We might define simplicity as the reciprocal of complexity, but… There are many different plausible, competing definitions of complexity, and this is an active research area. So, these questions really have no objective right answer! Still, we will ask you to answer them anyway… (Because others will too.) 9/19/2018

Example of Ill-Posedness of a Sequence Recognition 0,3,8,15, …is a series Solution 1 Solution 2 Solution 3 In fact instead of sin and exp we can use any other function 24 ( f ( n ) = ) 9/19/2018

What are Strings, Really? This book says “finite sequences of the form a1, a2, …, an are called strings”, but infinite strings are also discussed sometimes. Strings are normally restricted to sequences composed of symbols drawn from a finite alphabet, and are often indexed from 0 or 1. But these are really arbitrary restrictions also. Either way, the length of a (finite) string is just its number of terms (or of distinct indices). 9/19/2018

Strings, more formally Def. Let  be a finite set of symbols, i.e. an alphabet. A string s over alphabet  is any sequence {si} of symbols, si, normally indexed by ℕ or ℕ{0}. Notation. If a, b, c, … are symbols, the string s = a, b, c, … can also be written abc…(i.e., without commas). 9/19/2018

Strings, more formally Def. If s is a finite string and t is any string, then the concatenation of s with t, written just st, is simply the string consisting of the symbols in s, in sequence, followed by the symbols in t, in sequence. 9/19/2018

More Common String Notations Def. The length |s| of a finite string s is its number of positions (i.e., its number of index values i). Def. If s is a finite string and nℕ, then sn denotes the concatenation of n copies of s. s = ab, s4 = abababab  or “” denotes the empty string, the string of length 0. This is fairly common, but the book uses λ instead. Def. If  is an alphabet and nℕ, n : {s | s is a string over  of length n}, and * : {s | s is a finite string over }. 9/19/2018

Example  is English alphabet and n = 3ℕ n * 9/19/2018

CMSC 302 Summations 9/19/2018

Summation Notation Def. Given a series {an}, an integer lower bound (or limit) j0, and an integer upper bound kj, then the summation of {an} from j to k is written and defined as follows: Here, i is called the index of summation. 9/19/2018

Generalized Summations Notation. For an infinite series, we may write: To sum a function over all members of a set X={x1, x2, …}: 9/19/2018

Simple Summation Example 9/19/2018

More Summation Examples An infinite series with a finite sum: Using a predicate to define a set of elements to sum over: Note, this is a set {2 3 5 7} 9/19/2018

Summation Manipulations Some handy identities for summations: (Distributive law) (An application of commutativity) (Index shifting) 9/19/2018

More Summation Manipulations Other identities that are sometimes useful: (Series splitting) (Order reversal) (Grouping) 9/19/2018

Example: Impress Your Friends Boast, “I’m so smart; give me any 2-digit number n, and I’ll add all the numbers from 1 to n in my head in just a few seconds.” i.e., Evaluate the summation: There is a simple closed-form formula for the result, discovered by Euler at age 12! And frequently rediscovered by many… Leonhard Euler (1707-1783) 9/19/2018

Euler’s Trick, Illustrated Consider the sum: 1+2+…+(n/2)+((n/2)+1)+…+(n-1)+n We have n/2 pairs of elements, each pair summing to n+1, for a total of (n/2)(n+1), or n(n+1) / 2 !!! n+1 … n+1 n+1 9/19/2018

Symbolic Derivation of Trick For case where n is even… 9/19/2018

Concluding Euler’s Derivation So, you only have to do 1 easy multiplication in your head, then cut in half. Also works for odd n (prove this at home). 9/19/2018

Geometric Progression Def. A geometric progression is a series of the form a, ar, ar2, ar3, …, ark, where a,rℝ. The sum of such a series is given by: We can reduce this to closed form via clever manipulation of summations... 9/19/2018

Geometric Sum Derivation Here we go... 9/19/2018

Geometric Sum Derivation ... 9/19/2018

Geometric Sum Derivation ... I stopped here last time 9/19/2018

Nested Summations These have the meaning you’d expect. Note issues of free vs. bound variables, just like in quantified expressions, integrals, etc. 9/19/2018

Some Shortcut Expressions Geometric series Euler’s trick Quadratic series Cubic series 9/19/2018

Using the Shortcuts Example: Evaluate . Use series splitting. Solve for desired summation. Apply quadratic series rule. Evaluate. 9/19/2018

Summations: Conclusion You need to know: How to read, write & evaluate summation expressions like: Summation manipulation laws we covered. Shortcut closed-form formulas, & how to use them. 9/19/2018

References Rosen Discrete Mathematics and its Applications, 6th ed., Mc GrawHill, 2007 9/19/2018