Harmonic Sum Integral Method How far out? table

advertisement
Book Stacking
Mathematics for Computer Science
MIT 6.042J/18.062J
Harmonic Sum
Integral Method
table
Albert R Meyer,
April 5, 2010
lec 9M.1
Book Stacking
Albert R Meyer,
Copyright © Albert R. Meyer, 2007. All rights reserved.
April 5, 2010
lec 9M.10
Book Stacking
How far out?
One book
book center
of mass
?
overhang
Albert R Meyer,
Copyright © Albert R. Meyer, 2007. All rights reserved.
April 5, 2010
lec 9M.11
Book Stacking
One book
Albert R Meyer,
Copyright © Albert R. Meyer, 2007. All rights reserved.
April 5, 2010
lec 9M.12
Book Stacking
balances if
Oneofbook
center
mass
over table
book center
of mass
book center
of mass
1
2
Albert R Meyer,
Copyright © Albert R. Meyer, 2007. All rights reserved.
April 5, 2010
lec 9M.13
Albert R Meyer,
Copyright © Albert R. Meyer, 2007. All rights reserved.
April 5, 2010
lec 9M.14
1
n books
n books
1
1
2
2
n
n
Albert R Meyer,
Copyright © Albert R. Meyer, 2007. All rights reserved.
April 5, 2010
lec 9M.15
Albert R Meyer,
Copyright © Albert R. Meyer, 2007. All rights reserved.
n books
April 5, 2010
lec 9M.16
n books
1
1
2
2
center of mass
of the whole stack
n
n
Albert R Meyer,
Copyright © Albert R. Meyer, 2007. All rights reserved.
center
of mass
April 5, 2010
lec 9M.17
balances if
center of mass
over table
Albert R Meyer,
Copyright © Albert R. Meyer, 2007. All rights reserved.
April 5, 2010
lec 9M.18
n+1 books
1
2
center of mass
of all n+1 books
at table edge
n
n+1
center of mass of
top n books at
edge of book n+1
-overhang ::=
horizontal distance from
n-book to (n+1)-book
centers of mass
overhang
Albert R Meyer,
Copyright © Albert R. Meyer, 2007. All rights reserved.
April 5, 2010
lec 9M.19
Albert R Meyer,
April 5, 2010
lec 9M.20
2
n+1 books
-overhang
1
2
n
center of mass
of all n+1 books
1
1/2
1
n
n+1
1
= 2 =
n + 1 2(n + 1)
Albert R Meyer,
April 5, 2010
Albert R Meyer,
lec 9M.21
Book stacking summary
center of mass of
top n books
April 5, 2010
lec 9M.23
Harmonic Sums
Bn ::= overhang of n books
B1 = 1/2
Bn+1 = Bn +
nth Harmonic number
Bn = Hn/2
Bn =
Albert R Meyer,
April 5, 2010
Albert R Meyer,
lec 9M.24
Integral estimate for Hn
Hn = area of rectangles
> area under 1/(x+1) =
1
x+1
0
1
n
1
x + 1 dx =
0
n+1
1
1
dx = ln(n + 1)
x
1
3
1
2
1
lec 9M.25
Integral estimate for Hn
1
1
2
1
3
April 5, 2010
2
3
Albert R Meyer,
4
5
6
April 5, 2010
7
8
lec 9M.26
Albert R Meyer,
April 5, 2010
lec 9M.27
3
Book stacking
Book stacking
for overhang 3, need Bn 3
Hn 6
integral bound: ln(n+1) 6
so ok with n e6-1 = 403 books
actually calculate Hn:
227 books are enough.
Albert R Meyer,
April 5, 2010
Hn as n,
so overhang can be
as big as desired!
Albert R Meyer,
lec 9M.30
April 5, 2010
lec 9M.31
Upper bound for Hn
CD cases over the edge
1
1
2
1
3
1
2
1
43 cases high --top 4 cases completely
off the table --1.8 or 1.9 case-lengths
Albert R Meyer,
April 5, 2010
lec 9M.33
Upper bound for Hn
0
1
1
3
2
3
Albert R Meyer,
4
5
6
7
8
April 5, 2010
lec 9M.37
Asymptotic bound for Hn
ln(n+1) < Hn < 1+ ln(n)
Hn ln(n)
Albert R Meyer,
April 5, 2010
lec 9M.38
Albert R Meyer,
April 5, 2010
il
lec 9M.39
4
Asymptotic Equivalence ~
Asymptotic Equivalence
Example:
Def: f(n) ~ g(n)
(n2 + n) ~ n2
pf:
Albert R Meyer,
April 5, 2010
lec 9M.40
Albert R Meyer,
April 5, 2010
lec 9M.41
Team Problems
Problems
13
Albert R Meyer,
April 5, 2010
lec 9M.43
5
MIT OpenCourseWare
http://ocw.mit.edu
6.042J / 18.062J Mathematics for Computer Science
Spring 2010
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
Download