Mathematics for Computer Science MIT 6.042J/18.062J Sums, Products & Asymptotics Copyright © Albert Meyer, 2002. Prof. Albert Meyer & Dr. Radhika Nagpal
C. F. Gauss Picture source: http://www-groups.dcs.st-and.ac.uk/~history/PictDisplay/Gauss.html
Sum for children 89 + 102 + 115 + 128 + 141 + 154 + ··· 193 + ··· 89 + 102 + 115 + 128 + 141 + 154 + ··· 193 + ··· 232 + ··· 323 + ··· + 401
Sum for children Nine-year old Gauss (so the story goes) saw that each number was 13 greater than the previous one.
Sum for children A ::= 89 + (89+13) + (89+2·13) + … + (89+24·13) + 89+(89+24·13)
first + last A = · #terms 2 Sum for children 2A = [89+ (89+24·13)]·25
A = Average · #terms Sum for children 2A = [89+ (89+24·13)]·25 first last #terms A = Average · #terms
Sum for children Example: 1 + 2 + … + (n-1) + n =
Geometric Series
Geometric Series
Geometric Series G-xG= 1 - xn+1
Geometric Series G-xG= 1- xn+1
Geometric Series G-xG= 1- xn+1 n+1
The future value of $$. Annuities I will promise to pay you $100 in exactly one year, if you will pay me $X now.
1.03 X 100. Annuities My bank will pay me 3% interest. If I deposit your $X for a year, I can’t lose if 1.03 X 100.
Annuities I can’t lose if you pay me: X = $100/1.03 ≈ $97.09
Annuities 97.09¢ today is worth $1.00 in a year $1.00 in a year is worth $1/1.03 today $n in a year is worth $nr today, where r = 1/1.03.
Annuities $n in two years is worth $nr2 today $n in k years is worth $nr k today
Annuities I will pay you $100/year for 10 years If you will pay me $Y now. I can’t lose if you pay me 100r + 100r2 + 100r3 + … + 100r10 =100r(1+ r + … + r9) = 100r(1-r10)/(1-r) = $853.02
In-Class Problem Problems 1 & 2
Book Stacking Rosen Rosen Rosen Rosen Rosen Rosen table
Book Stacking How far out? ?
Book Stacking One book center of mass of book 1 2
Book Stacking One book center of mass of book
Book Stacking One book center of mass of book
n books
n books center of mass
n books Need center of mass over table
n books center of mass of the whole stack overhang
n+1 books ∆overhang center of mass of all n+1 books at table edge of top n books at edge of book n+1 ∆overhang
overhang = Horizontal distance from n-book to n+1-book centers-of-mass
Choose origin so center of n-stack at x = 0. Now center of n+1st book is at x = 1/2, and x-coordinate for center of n+1-stack is:
n+1 books center of mass of all n+1 books at table edge of top n books at edge of book n+1
Bn ::= overhang of n books B1 = 1/2 Bn+1 = Bn + 1/2(n+1) Book stacking summary Bn ::= overhang of n books B1 = 1/2 Bn+1 = Bn + 1/2(n+1) Bn = 1/2(1 + 1/2 + … + 1/n)
nth Harmonic number Bn = Hn/2
Integral Method Estimate Hn : 1 x+1 0 1 2 3 4 5 6 7 8 1 1 2 1 3 1 2 1 0 1 2 3 4 5 6 7 8
overhang can be any desired size. Book stacking So Hn as n , and overhang can be any desired size.
Book stacking Overhang 3: need Bn 3 Hn 6 Integral bound: ln (n+1) 6 So can do with n e6-1 = 403 books Actually calculate Hn : 227 books are enough.
Crossing a Desert How big a desert can the truck cross? Gas depot
Dn ::= max distance on n tank
1 tank 1 tank truck D1= max distance on 1 tank = 1
n+1 tanks x 1-2x truck 1-2x 1-2x 1-x
n+1 tanks x 1-2x 1-2x n 1-2x 1-x
n+1 tanks x (1-2x)n + (1-x)
(1-2x)n + (1-x)
(1-2x)n + (1-x) If (1-2x)n + (1-x) = n,
(1-2x)n + (1-x) If (1-2x)n + (1-x) = n, then use n tank strategy from position x.
(1-2x)n + (1-x) If (1-2x)n + (1-x) = n, then use n tank strategy from position x. Dn+1 = Dn + x
(1-2x)n + (1-x) = n 1 2n+1 x = 1 2n+1 Dn+1 = Dn +
Can cross any desert!
In-Class Problem Problem 3