640 likes | 670 Views
Learn about geometric sums and their applications in solving arithmetic problems. Discover important properties and methods! Study with Prof. J. Elder in COSC 3101B.
E N D
Recall: Insertion Sort COSC 3101B, PROF. J. ELDER
Arithmetic Sum ∑i=1..ni = 1 + 2 + 3 + . . . + n = ? COSC 3101B, PROF. J. ELDER
1 + 2 + 3 + . . . + n-1 + n = S n + n-1 + n-2 + . . . + 2 + 1 = S (n+1) + (n+1) + (n+1) + . . . + (n+1) + (n+1) = 2S n (n+1) = 2S COSC 3101B, PROF. J. ELDER
1 + 2 + 3 + . . . + n-1 + n = S n + n-1 + n-2 + . . . + 2 + 1 = S (n+1) + (n+1) + (n+1) + . . . + (n+1) + (n+1) = 2S n (n+1) = 2S Algebraic argument Let’s restate this argument using a geometric representation COSC 3101B, PROF. J. ELDER
= number of blue dots. 1 + 2 + 3 + . . . + n-1 + n = S n + n-1 + n-2 + . . . + 2 + 1 = S (n+1) + (n+1) + (n+1) + . . . + (n+1) + (n+1) = 2S n (n+1) = 2S 1 2 . . . . . . . . n COSC 3101B, PROF. J. ELDER
= number of blue dots 1 + 2 + 3 + . . . + n-1 + n = S = number of black dots n + n-1 + n-2 + . . . + 2 + 1 = S (n+1) + (n+1) + (n+1) + . . . + (n+1) + (n+1) = 2S n (n+1) = 2S n . . . . . . . 2 1 1 2 . . . . . . . . n COSC 3101B, PROF. J. ELDER
= number of blue dots 1 + 2 + 3 + . . . + n-1 + n = S = number of black dots n + n-1 + n-2 + . . . + 2 + 1 = S (n+1) + (n+1) + (n+1) + . . . + (n+1) + (n+1) = 2S n (n+1) = 2S n n There are n(n+1) dots in the grid n n n n n+1 n+1 n+1 n+1 n+1 COSC 3101B, PROF. J. ELDER
+ n (n 1) = S 2 = number of blue dots 1 + 2 + 3 + . . . + n-1 + n = S = number of black dots n + n-1 + n-2 + . . . + 2 + 1 = S (n+1) + (n+1) + (n+1) + . . . + (n+1) + (n+1) = 2S n (n+1) = 2S n n n n n n Note = Q(# of terms · last term)) n+1 n+1 n+1 n+1 n+1 COSC 3101B, PROF. J. ELDER
Arithmetic Sum ∑i=1..ni = 1 + 2 + 3 + . . . + n = Q(# of terms · last term) True whenever terms increase slowly COSC 3101B, PROF. J. ELDER
Geometric Sum ∑i=0..n2i = 1 + 2 + 4 + 8 +. . . + 2n = ? COSC 3101B, PROF. J. ELDER
Geometric Sum COSC 3101B, PROF. J. ELDER
Geometric Sum ∑i=0..n2i = 1 + 2 + 4 + 8 +. . . + 2n = 2 · last term - 1 COSC 3101B, PROF. J. ELDER
Geometric Sum ∑i=0..nri = r0 + r1 + r2 +. . . + rn = ? COSC 3101B, PROF. J. ELDER
+ + + + + 2 3 n 1 r r r . . . r Geometric Sum = S + = + + + + + 2 3 n n 1 Sr r r r . . . r r + - = - n 1 S Sr 1 r + - n 1 r 1 = S - r 1 COSC 3101B, PROF. J. ELDER
Geometric Sum When r>1 + - n 1 r 1 Biggest Term ∑i=0..nri = =θ(rn) - r 1 COSC 3101B, PROF. J. ELDER
Geometric Increasing ∑i=0..nri = r0 + r1 + r2 +. . . + rn = Q(biggest term) True whenever terms increase quickly COSC 3101B, PROF. J. ELDER
+ n 1 Geometric Sum When r<1? 1 r - ∑i=0..nri = - 1 r COSC 3101B, PROF. J. ELDER
+ n 1 Geometric Sum When r<1 1 r - ∑i=0..nri = Biggest Term =θ(1) - 1 r COSC 3101B, PROF. J. ELDER
Bounded Tail ∑i=0..nri = r0 + r1 + r2 +. . . + rn = Q(1) True whenever terms decrease quickly COSC 3101B, PROF. J. ELDER
Sum of Shrinking Function n f(i) = 1 ∑i=1..n f(i) = n COSC 3101B, PROF. J. ELDER
Sum of Shrinking Function ¥ f(i) = 1/2i COSC 3101B, PROF. J. ELDER
Sum of Shrinking Function n f(i) = 1/i ∑i=1..n f(i) = ? COSC 3101B, PROF. J. ELDER
Harmonic Sum ∑i=1..n1/i = 1/1+1/2+1/3+1/4+1/5+…+1/n = ? COSC 3101B, PROF. J. ELDER
Harmonic Sum ∑i=1..n1/i = 1/1+1/2+1/3+1/4+1/5+…+1/n = Q(log(n)) COSC 3101B, PROF. J. ELDER
Approximating Sum by Integrating ∑i=1..n f(i) ≈ ∫x=1..n f(x) dx The area under the curve approximates the sum COSC 3101B, PROF. J. ELDER
Approximating Sums by Integrating: Arithmetic Sums COSC 3101B, PROF. J. ELDER
Approximating Sums by Integrating: Geometric Sums COSC 3101B, PROF. J. ELDER
Approximating Sum by Integrating Harmonic Sum COSC 3101B, PROF. J. ELDER
Adding Made Easy We will now classify (most) functions f(i) into four classes: • Geometric Like • Arithmetic Like • Harmonic • Bounded Tail For each class, we will give an easy rule for approximating its sum θ( ∑i=1..nf(i) ) COSC 3101B, PROF. J. ELDER
Adding Made Easy f(n) n COSC 3101B, PROF. J. ELDER
Geometric Like: f(n) ³ 2Ω(n)Þ ∑i=0..nf(i) = θ(f(n)) If the terms f(i) grow sufficiently quickly, then the sum will be dominated by the largest term. Classic example: ∑i=0..n 2i = 2n+1-1≈2 f(n) COSC 3101B, PROF. J. ELDER
Geometric Like: f(n) ³ 2Ω(n)Þ ∑i=1..nf(i) = θ(f(n)) If the terms f(i) grow sufficiently quickly, then the sum will be dominated by the largest term. For which functions f(i) is this true? How fast and how slow can it grow? COSC 3101B, PROF. J. ELDER
Geometric Like: f(n) ³ 2Ω(n)Þ ∑i=1..nf(i) = θ(f(n)) ∑i=1..n (1000)i≈1.001(1000)n = 1.001 f(n) Even bigger? COSC 3101B, PROF. J. ELDER
Geometric Like: f(n) ³ 2Ω(n)Þ ∑i=1..nf(i) = θ(f(n)) 2i 2n ∑i=1..n 22≈22= 1f(n) No Upper Extreme: Even bigger! COSC 3101B, PROF. J. ELDER
Geometric Like: f(n) ³ 2Ω(n)Þ ∑i=1..nf(i) = θ(f(n)) COSC 3101B, PROF. J. ELDER
Geometric Like: f(n) ³ 2Ω(n)Þ ∑i=1..nf(i) = θ(f(n)) COSC 3101B, PROF. J. ELDER
Geometric Like: f(n) ³ 2Ω(n)Þ ∑i=1..nf(i) = θ(f(n)) Do All functions in 2Ω(n)have this property? Maybe not. COSC 3101B, PROF. J. ELDER
Geometric Like: f(n) ³ 2Ω(n)Þ ∑i=1..nf(i) = θ(f(n)) Functions that oscillate with exponentially increasing amplitude do not have this property. COSC 3101B, PROF. J. ELDER
Geometric Like: f(n) ³ 2Ω(n)Þ ∑i=1..nf(i) = θ(f(n)) Functions expressed with +, -, ×, , exp, log do not oscillate continually. They are well behaved for sufficiently large n. These do have this property. COSC 3101B, PROF. J. ELDER
Adding Made Easy f(n) n COSC 3101B, PROF. J. ELDER
Arithmetic Like: f(n) = nθ(1)-1 Þ ∑i=1..nf(i) = θ(n·f(n)) If the terms f(i) are increasing or decreasing relatively slowly, then the sum is roughly the number of terms, n, times the final value. Example 1: ∑i=1..n1 =n · 1 COSC 3101B, PROF. J. ELDER
Arithmetic Like: f(n) = nθ(1)-1 Þ ∑i=1..nf(i) = θ(n·f(n)) If the terms f(i) are increasing or decreasing relatively slowly, then the sum is roughly the number of terms, n, times the final value. Example 2: ∑i=1..ni = 1 + 2 + 3 + . . . + n COSC 3101B, PROF. J. ELDER
Arithmetic Like: f(n) = nθ(1)-1 Þ ∑i=1..nf(i) = θ(n·f(n)) Half the terms are roughly the same and the sum is roughly the number of terms, n, times this value ∑i=1..ni = 1 + . . . + n/2 + . . . + n ∑i=1..n i = θ(n · n) COSC 3101B, PROF. J. ELDER
Arithmetic Like: f(n) = nθ(1)-1 Þ ∑i=1..nf(i) = θ(n·f(n)) Is the statement true for this function? ∑i=1..ni2 = 12 + 22 + 32 + . . . + n2 COSC 3101B, PROF. J. ELDER
Arithmetic Like: f(n) = nθ(1)-1 Þ ∑i=1..nf(i) = θ(n·f(n)) Again half the terms are roughly the same. ∑i=1..ni = 12 + . . . + (n/2)2 + . . . + n2 1/4 n2 ∑i=1..n i2 = θ(n · n2) COSC 3101B, PROF. J. ELDER
Arithmetic Like: f(n) = nθ(1)-1 Þ ∑i=1..nf(i) = θ(n·f(n)) area of small square £∑i=1..n f(i) ≈area under curve £area of big square = n/2· f(n/2) =n · f(n) COSC 3101B, PROF. J. ELDER
Arithmetic Like: f(n) = nθ(1)-1 Þ ∑i=1..nf(i) = θ(n·f(n)) The key property is f(n/2) = θ(f(n)) f(n) = n2 ∑i=1..ni2 = 12 + 22 + 32 + . . . + n2 = ? COSC 3101B, PROF. J. ELDER
Adding Made Easy f(n) Half done n COSC 3101B, PROF. J. ELDER