mit 6.042j/18.062j sums, products & asymptotics · 2019-09-12 · title: microsoft powerpoint -...
TRANSCRIPT
1
L7-1.1Copyright © Albert R. Meyer, 2002.
Mathematics for Computer ScienceMIT 6.042J/18.062J
Sums, Products & Asymptotics
L7-1.3Copyright © Albert R. Meyer, 2002.
Sum for Children
89 + 102 + 115 + 128 + 141 +154 + ··· +193 + ··· +232 + ··· + 323 + ··· +414 + ··· + 453 + 466
L7-1.4Copyright © Albert R. Meyer, 2002.
Sum for Children
Nine-year old Gauss saw30 numbers each 13 greater
than the previous one.(So the story goes.)
L7-1.5Copyright © Albert R. Meyer, 2002.
Sum for Children
1st + 30th = 89+466 = 5552nd + 29th =
(1st+13) + (30th−13) = 5553rd + 28th =
(2nd+13) + (29th−13) = 555
L7-1.6Copyright © Albert R. Meyer, 2002.
· #termsfirst + last2
Sum for ChildrenSum of kth term and (30−k)th termis invariant!Total = 555 ⋅ 15
= (1st + last) ⋅ (# terms/2) =
Average
2
L7-1.7Copyright © Albert R. Meyer, 2002.
Sum for Children
Example:
1 + 2 + … + (n−1) + n =
(1 + n)n2
L7-1.8Copyright © Albert R. Meyer, 2002.
Geometric Series
nn xxxxG +++++= −12 ...1::12 ... +++++= nn xxxxxG
L7-1.9Copyright © Albert R. Meyer, 2002.
Geometric Series
112 ... +− +++++= nnn xxxxxxG1 − xn+1G−xG=
nn xxxxG +++++= −12 ...1::
L7-1.10Copyright © Albert R. Meyer, 2002.
Geometric Series
xxG
−−=
11 n+1
G−xG=1− xn+1
nn xxxxG +++++= −12 ...1::112 ... +− +++++= nnn xxxxxxG
L7-1.11Copyright © Albert R. Meyer, 2002.
Annuities
The future value of $$.I will promise to pay you $100in exactly one year,if you will pay me $X now.
L7-1.12Copyright © Albert R. Meyer, 2002.
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.
3
L7-1.13Copyright © Albert R. Meyer, 2002.
AnnuitiesI can’t lose if you pay me:
X ≥ $100/1.03 ≈ $97.09
L7-1.14Copyright © Albert R. Meyer, 2002.
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.
L7-1.15Copyright © Albert R. Meyer, 2002.
Annuities
$n in two years is worth $nr2 today$n in k years is worth $nrk today
L7-1.16Copyright © Albert R. Meyer, 2002.
AnnuitiesI will pay you $100/year for 10 yearsIf you will pay me $Y now.I can’t lose if you pay me100r +100r2 +100r3 + … +100r10
=100r(1+ r + … + r9)= 100r(1−r10)/(1−r) = $853.02
L7-1.17Copyright © Albert R. Meyer, 2002.
Class Problems
Problems 1 & 2
October 16, 2002 L7-1.18Copyright © Albert R. Meyer, 2002. All rights reserved.
Book Stacking
RosenRosen
RosenRosen
RosenRosen
table
4
October 16, 2002 L7-1.19Copyright © Albert R. Meyer, 2002. All rights reserved.
Book Stacking
How far out?
?
October 16, 2002 L7-1.20Copyright © Albert R. Meyer, 2002. All rights reserved.
Book Stacking
center of mass of book
12
One book
October 16, 2002 L7-1.21Copyright © Albert R. Meyer, 2002. All rights reserved.
center of mass of bookOne book
Book Stacking
October 16, 2002 L7-1.22Copyright © Albert R. Meyer, 2002. All rights reserved.
center of mass of bookOne book
Book Stacking
October 16, 2002 L7-1.23Copyright © Albert R. Meyer, 2002. All rights reserved.
n books
October 16, 2002 L7-1.24Copyright © Albert R. Meyer, 2002. All rights reserved.
n books
center of mass
5
October 16, 2002 L7-1.25Copyright © Albert R. Meyer, 2002. All rights reserved.
n books
Need center of mass
over table
October 16, 2002 L7-1.26Copyright © Albert R. Meyer, 2002. All rights reserved.
n books
center of mass of the whole stack
overhang
October 16, 2002 L7-1.27Copyright © Albert R. Meyer, 2002. All rights reserved.
n+1 books
center of mass of all n+1 booksat table edge
center of mass of top n booksat edge of bookn+1
∆overhang}
L7-1.28Copyright © Albert R. Meyer, 2002.
∆ overhang ::=Horizontal distance fromn-book to n+1-bookcenters-of-mass
L7-1.29Copyright © Albert R. Meyer, 2002.
Choose origin so center of n-stack at x = 0.
Now center of n+1st book is at x = 1/2, socenter of n+1-stack is at
)1(21
12/110
+=
+⋅+⋅=
nnnx
October 16, 2002 L7-1.30Copyright © Albert R. Meyer, 2002. All rights reserved.
n+1 books
center of mass of all n+1 booksat table edge
center of mass of top n booksat edge of bookn+1}
)1(21+n
6
L7-1.31Copyright © Albert R. Meyer, 2002.
Bn ::= overhang of n booksB1 = 1/2Bn+1 = Bn +
Bn =
12( 1)n +
Book stacking summary
1 1 1 112 2 3 n + + + +
L7-1.32Copyright © Albert R. Meyer, 2002.
1 1 1H :: 12 3n n
= + + + +
nth Harmonic numberBn = Hn/2
L7-1.33Copyright © Albert R. Meyer, 2002.
0 1 2 3 4 5 6 7 8
1
1x+11
213
12
1 13
Estimate Hn :
Integral Method
L7-1.34Copyright © Albert R. Meyer, 2002.
∫ ++++≤+
n
ndx
x0
1...31
21 1
11
1
1
1 Hn
ndxx
+
≤∫ln( 1) Hnn + ≤
L7-1.35Copyright © Albert R. Meyer, 2002.
Book stacking
So Hn → ∞ as n→ ∞, andoverhang can be any desired size.
L7-1.36Copyright © Albert R. Meyer, 2002.
Book stackingOverhang 3: need Bn ≥ 3
Hn ≥ 6Integral bound: ln (n+1) ≥ 6So can do with n ≥ e6−1 = 403 booksActually calculate Hn :
227 books are enough.
7
L7-1.37Copyright © Albert R. Meyer, 2002.
Crossing a Desert
Gasdepot
truck
How big a desert can the truck cross?L7-1.38Copyright © Albert R. Meyer, 2002.
Dn ::= max distance on n tank
L7-1.39Copyright © Albert R. Meyer, 2002.
1 Tank of Gas
D1::= max distance on 1 tank = 1
1 tank
L7-1.40Copyright © Albert R. Meyer, 2002.
x
1−2x
1 −2x
1−x
1−2x
n
n+1 Tanks of Gas
L7-1.42Copyright © Albert R. Meyer, 2002. L7-1.41pyright © Albert R. Meyer, 2002.
(1-2x)n+ (1-�x)
n+1 Tanks of Gas
So have:
If depot at xis n tanks,can continuewith n tankTravel.
If (1−2x)n + (1−x) = n,
then using n tank strategyfrom position x, gives
Dn+1 = Dn + x
8
L7-1.43Copyright © Albert R. Meyer, 2002.
(1−2x)n + (1−x) = n1
2n+1x =
Dn+1 = Dn + 12n+1
L7-1.44Copyright © Albert R. Meyer, 2002.
1 1 1D 13 5 2 1n n
= + + + +−
0
1 D2( 1) 1
n
ndxx
≤+ −∫ln(2 1) D
2 nn + ≤
Can cross any desert!
L7-1.45Copyright © Albert R. Meyer, 2002.
Class Problem
Problem 3