Download presentation
Presentation is loading. Please wait.
1
Summations Alexandra Stefan
2
Math background - Review
Series (the terms) and their summations: Geometric Arithmetic (This information is in the following slides and the class cheat sheet) Integrals From the Integrals cheat sheet see: The fundamental theorem of calculus Part II: Common integrals Cheat sheets and other useful links are on the Slides and Resources webpage.
3
Book Reference Book (CLRS) references for this lecture: Apendix A, especially pages , page 1150 (bounding the terms), Pages (approximation by integrals)
4
Overview Summations Summation of arithmetic series:
Where a1 is the first term and d is the step. Summation of geometric series: π=0 π π₯π 0< π₯< , π©(1) π₯> , π©( π₯ π ) π₯= , π©(π) (easy to check: 1+1+β¦+1) Approximation by integrals Induction You suspect/guess that a summation S = π© π π and prove/verify it using induction. See Dr. Bob Weems, βNotes 3: Summationsβ, section 3.D. Very useful exercise in strengthening oneβs math skills.
5
Summations Summations are formulas of the sort: π=0 π π(π)
Used to solve recurrences. Oftentimes, establishing upper bounds is sufficient, since we use big-Oh notation. If π π β₯0 , then: π=0 π π π β€ π=0 β π π Summing to infinity may give a simpler formula.
6
Summation of Arithmetic Series
Examples: 1,5,9,13,17,21,β¦., βStepβ between terms: d = 4 First term: a1 = 1 Note that 1,2,3,β¦,n is a special case where the step is +1. 3,13,23,33,43,β¦. Step? First term (a1)? General formula: Here d is the step and a1 is the first term Summation: Summation of consecutive terms: Do not confuse the summation of terms with the count of terms! (See a future slide)
7
Summation of Geometric Series 0< π₯<1
Suppose that π< π<π: Finite summations: π=0 π π₯π = 1 β π₯ π+1 1 β π₯ = π© ?? Infinite summations: π=0 β π₯π = 1 1 β π₯ Important to note: π=0 π π₯π β€ π=0 β π₯π = 1 1 β π₯ Therefore, π=0 π π₯π =π© 1 . Why?
8
Summation of Geometric Series 0< π₯<1
Suppose that π< π<π: Finite summations: π=0 π π₯π = 1 β π₯ π+1 1 β π₯ = π© 1 Infinite summations: π=0 β π₯π = 1 1 β π₯ Important to note: π=0 π π₯π β€ π=0 β π₯π = 1 1 β π₯ Therefore, π=0 π π₯π =π© 1 . Why? Because 1 1 β π₯ is independent of n. Strictly speaking we showed that it is O(1), but the sum is also β 0 and so it is Ξ©(1).
9
Summation of Geometric Series π₯β₯1
π₯>1 The formula is the same, and can be rewritten as: π=0 π π₯π = π₯ π+1 β1 π₯β1 Remember this formula! For example: β¦ + 5π= 5 π+1 β1 5β1 =π© 5π 5 is a constant and so: 5 π+1 = 5β5 π =π© 5π (Exponential!) π₯= =>
10
Do not confuse the summation of terms with the count of terms!
Progression: 1,2,3,β¦n Summation of terms: 1+2+β¦+n = n(n+1)/2=Ξ(n2) Count of terms: 1,2,3,β¦,n => n terms => Ξ(n) Progression:1, 2, 4, β¦, 2i, ...2n Summation: Count of terms: n+1 Progression:1, 2, 4, β¦, 2i, ...2pβ€n (last power of 2 less or equal to n) Count of terms: 1+lgn (more precisely: 1+floor(lgn))
11
Approximation by Integrals πβ1 π π π₯ ππ₯ β€ π=π π π(π) β€ π π+1 π π₯ ππ₯
when f(x) is a monotonically increasing function. In most cases***, our end result will be: π=1 π π(π) = Ξ( 0 π π π₯ ππ₯ ) when f(x) is monotonically increasing *** For the problems we look at, you can adjust the borders since the differences should result in lower order terms (see the worked-out example). But always be prepared to check the correctness.
12
Approximation by Integrals - Theory πβ1 π π π₯ ππ₯ β€ π=π π π(π) β€ π π+1 π π₯ ππ₯
Suppose that f(x) is a monotonically increasing function: This means that π₯β€π¦βπ π₯ β€π(π¦). Then, we can approximate summation π=π π π(π) using integral π π+1 π π₯ ππ₯ . Why? Because πβ1 π π π₯ ππ₯ β€ π(π) β€ π π+1 π π₯ ππ₯ . Proof for: π(π) β€ π π+1 π π₯ ππ₯ For every π₯ in the interval [π, π+1], π₯β₯ π. Since π(π₯) is increasing, if π₯ β₯ π then π π₯ β₯ π(π). (Remember that the integral is the sum of π π₯ on the interval [π, π+1]of size 1. ) Similar proof for πβ1 π π π₯ ππ₯ β€ π(π)
13
Approximation by Integrals - Example πβ1 π π π₯ ππ₯ β€ π=π π π(π) β€ π π+1 π π₯ ππ₯
Example: approximate T(n) = π=π π ππ using an integral: Notice that T(n) is a sum of ππ terms. We will use π(π₯) = π₯2 to approximate this summation. π(π₯) = π₯2 is a monotonically increasing function. O: T(n) = π=1 π π2 β€ 1 π+1 π₯2ππ₯ = π+1 3 β13 3 = π3+2π2+2π+1 β1 3 =π(π3) Ξ© : T(n) = π=1 π π2 β₯ 0 π π₯2ππ₯ = π3 β03 3 = π3 3 =Ξ©(π3) => π π = π©(π3)
14
Approximation by Integrals πβ1 π π π₯ ππ₯ β€ π=π π π(π) β€ π π+1 π π₯ ππ₯
when f(x) is a monotonically increasing function. π π+1 π π₯ ππ₯ β€ π=π π π(π) β€ πβ1 π π π₯ ππ₯ when f(x) is a monotonically decreasing function.
15
Worksheet 1) Find Ξ for 2) Given summation: 1 + 25 + 35 + β¦ + N5
Hint: pay attention to the borders for b). 2) Given summation: β¦ + N5 Can you solve this in terms of Ξ, Ξ© or O ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.