EECS 1028 M: Discrete Mathematics for Engineers Suprakash Datta Office: LAS 3043 Course page: http://www.eecs.yorku.ca/course/1028 Also on Moodle S. Datta (York Univ.) EECS 1028 W 18 1 / 16
Sequences and Summation Ch 2.4 in the text Finite or infinite Notation: a n, n N Calculus limits of infinite sequences (proving existence, evaluation...) The sum of a sequence is called a series Examples: Arithmetic progression (sequence): 1, 4, 7, 10,... Arithmetic series: 1 + 4 + 7 + 10 +... + (1 + 3(n 1)) Geometric progression (sequence) 3, 6, 12, 24, 48,... Geometric series: 3 + 6 + 12 + 24 + 48 +... + 3 2 n 1 S. Datta (York Univ.) EECS 1028 W 18 2 / 16
Specifying Sequences Enumeration: 1, 4, 7, 10, 13,... Arithmetic sequence 1, 3, 9, 27, 81,... Geometric sequence Explicit formulas for each term: a n = a + (n 1)b Arithmetic sequence a n = ar n 1 Geometric sequence a n = n 2 Recursively: a 1 = 1 and for n > 1, a n = a n 1 + 3 Arithmetic sequence a 1 = 1 and for n > 1, a n = 3a n 1 Geometric sequence a 0 = a 1 = 1 and for n > 1, a n = a n 1 + a n 2 Fibonacci sequence S. Datta (York Univ.) EECS 1028 W 18 3 / 16
Summation S n = a 1 + a 2 + a 3 + a 4 +... + a n, n N Consider the sequence S 1, S 2, S 3,..., S n, where S i = a 1 + a 2 +... + a i In general we would like to evaluate sums of series useful in algorithm analysis. e.g. what is the total time spent in a nested loop? S. Datta (York Univ.) EECS 1028 W 18 4 / 16
Sigma Notation Notation: S n = n i=1 a i = a 1 + a 2 + a 3 + a 4 +... + a n Simple rules for manipulation S n = n i=1 ca i = c n i=1 a i S n = n i=1 (a i + b i ) = n i=1 a i + n i=1 b i S n = n i=1 1 = n Related: n i=1 a i = a 1 a 2... a n S. Datta (York Univ.) EECS 1028 W 18 5 / 16
Sum of Series Arithmetic series e.g. S n = 1 + 2 +... + n (occurs frequently in the analysis of running time of simple for loops) general form S n = n i=0 t i, where t i = a + bi. Geometric series e.g. S n = 1 + 2 + 2 2 + 2 3 +... + 2 n general form S n = n i=0 t i, where t i = ar i. More general series (not either of the above) S n = 1 2 + 2 2 + 3 2 + 4 2 +... + n 2 S. Datta (York Univ.) EECS 1028 W 18 6 / 16
Sum of Arithmetic Series - A Special Case S n = n i=1 i = n(n+1) 2 S n = 2S n = = = n i = i=1 n i + i=1 n (n i + 1) adding i=1 n (n i + 1) i=1 n (i + n i + 1) i=1 n (n + 1) i=1 = n(n + 1) S. Datta (York Univ.) EECS 1028 W 18 7 / 16
Exercise: S n = n i=1 (2i 1) = n2 Prove this using the sum on the previous slide from: http://www.9math.com/book/sum-first-n-odd-natural-numbers S. Datta (York Univ.) EECS 1028 W 18 8 / 16
Sum of Arithmetic Series - The general case S n = n i=1 (a + bi) = 1 (2a + b(n 1)) n 2 n 1 n 1 n 1 S n = (a + bi) = a 1 + b i i=0 i=0 i=0 = an + bn(n 1)/2 = 1 (2an + bn(n 1)) 2 = n 1 (2a + b(n 1)) ( 2 ) a + a + b(n 1) = n 2 number of terms * average of first and last terms S. Datta (York Univ.) EECS 1028 W 18 9 / 16
Sum of Geometric Series - A special case Consider the sequence 1, r, r 2,..., r n 1, r 1 Subtracting (2) from (1) S n = 1 + r + r 2 +... + r n 1 (1) rs n = r + r 2 + r 3 +... + r n 1 + r n (2) (1 r)s n = 1 r n, or S n = 1 r n 1 r If r < 1, we can find the infinite sum (because it converges) S = lim n S n = 1 1 r S. Datta (York Univ.) EECS 1028 W 18 10 / 16
Sum of Geometric Series - The general case Consider the sequence a, ar, ar 2,..., ar n 1, r 1 S n = = a n 1 ar i i=0 n 1 r i i=0 = a(1 r n ) 1 r If r < 1, we can again find the infinite sum S = lim n S n = a 1 r S. Datta (York Univ.) EECS 1028 W 18 11 / 16
Some Observations Verify these: For any a R, the constant progression a, a, a,... is both arithmetic and geometric If a, b, c are in arithmetic progression, b = a+c, i.e., the 2 arithmetic mean of a and c If a, b, c are in geometric progression, b = ac, i.e., the geometric mean of a and c Challenge problem : Suppose that a 1, a 2,..., a 100 form an arithmetic progression and a 2 + a 3 +... + a 99 = 196. Find 100 i=1 a i. S. Datta (York Univ.) EECS 1028 W 18 12 / 16
More General Series More difficult to prove. S n = n i=1 i 2 = 1 n(n + 1)(2n + 1) 6 Proved by Induction S n = n i=1 i 3 = 1 4 n2 (n + 1) 2 Proved by Induction S = 1 i=1 = π2 i 2 6 Proved using Calculus S. Datta (York Univ.) EECS 1028 W 18 13 / 16
Caveats Need to be very careful with infinite series can get nonsense results with divergent (i.e., non-converging) series In general, tools from calculus are needed to know whether an infinite series sum exists. There are instances where the infinite series sum is much easier to compute and manipulate, e.g. geometric series with r < 1. S. Datta (York Univ.) EECS 1028 W 18 14 / 16
Problems with Recursively Defined Sequences Suppose a sequence is defined recursively as a 1 = 1; a n+1 a n = 3 n Find the value of a 9. Find the sum of the infinite geometric series whose terms are defined as a n = 2n 3 n+1. Let a n be a sequence of numbers defined by the recurrence relation a 1 = 1; a n+1 /a n = 2 n. Find log 2 a 100. S. Datta (York Univ.) EECS 1028 W 18 15 / 16
More Problems Prove that 0.99999... = 1 Solve the equation 1 + 4 + 7 +... + x = 925 Let a, b, c, d R be a sequence such that a, b, c form an arithmetic progression and b, c, d form a geometric progression. If a + d = 37 and b + c = 36, find d. S. Datta (York Univ.) EECS 1028 W 18 16 / 16