Mathematics for Computer Science MIT 6 042 J18

  • Slides: 52
Download presentation
Mathematics for Computer Science MIT 6. 042 J/18. 062 J Sums, Products & Asymptotics

Mathematics for Computer Science MIT 6. 042 J/18. 062 J Sums, Products & Asymptotics Copyright © Albert Meyer, 2002. Prof. Albert Meyer & Dr. Radhika Nagpal March 13, 2002 L 6 -2. 1

C. F. Gauss Picture source: http: //www-groups. dcs. st-and. ac. uk/~history/Pict. Display/Gauss. html March

C. F. Gauss Picture source: http: //www-groups. dcs. st-and. ac. uk/~history/Pict. Display/Gauss. html March 13, 2002 L 6 -2. 2

Sum for children 89 + 102 + 115 + 128 + 141 + 154

Sum for children 89 + 102 + 115 + 128 + 141 + 154 + ··· 193 + ··· 232 + ··· 323 + ··· + 401 March 13, 2002 L 6 -2. 3

Sum for children • Nine-year old Gauss (so the story goes) saw that each

Sum for children • Nine-year old Gauss (so the story goes) saw that each number was 13 greater than the previous one. March 13, 2002 L 6 -2. 4

Sum for children A : : = 89 + (89+13) + (89+2· 13) +

Sum for children A : : = 89 + (89+13) + (89+2· 13) + … + (89+24· 13) A = (89+24· 13) + (89+23· 13) + … + (89+13) + 89 2 A = 89+(89+24· 13) + … + 89+(89+24· 13) March 13, 2002 L 6 -2. 5

Sum for children 2 A = [89+ (89+24· 13)]· 25 first last #terms first

Sum for children 2 A = [89+ (89+24· 13)]· 25 first last #terms first + last A= · #terms 2 March 13, 2002 L 6 -2. 6

Sum for children 2 A = [89+ (89+24· 13)]· 25 first A= last #terms

Sum for children 2 A = [89+ (89+24· 13)]· 25 first A= last #terms Average · #terms March 13, 2002 L 6 -2. 7

Sum for children Example: 1 + 2 + … + (n-1) + n =

Sum for children Example: 1 + 2 + … + (n-1) + n = March 13, 2002 L 6 -2. 8

Geometric Series March 13, 2002 L 6 -2. 9

Geometric Series March 13, 2002 L 6 -2. 9

Geometric Series March 13, 2002 L 6 -2. 10

Geometric Series March 13, 2002 L 6 -2. 10

Geometric Series G-x. G= 1 - xn+1 March 13, 2002 L 6 -2. 11

Geometric Series G-x. G= 1 - xn+1 March 13, 2002 L 6 -2. 11

Geometric Series G-x. G= 1 - xn+1 March 13, 2002 L 6 -2. 12

Geometric Series G-x. G= 1 - xn+1 March 13, 2002 L 6 -2. 12

Geometric Series G-x. G= 1 - xn+1 March 13, 2002 L 6 -2. 13

Geometric Series G-x. G= 1 - xn+1 March 13, 2002 L 6 -2. 13

Annuities The future value of $$. I will promise to pay you $100 in

Annuities The future value of $$. I will promise to pay you $100 in exactly one year, if you will pay me $X now. March 13, 2002 L 6 -2. 14

Annuities My bank will pay me 3% interest. If I deposit your $X for

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. March 13, 2002 L 6 -2. 15

Annuities I can’t lose if you pay me: X = $100/1. 03 ≈ $97.

Annuities I can’t lose if you pay me: X = $100/1. 03 ≈ $97. 09 March 13, 2002 L 6 -2. 16

Annuities • 97. 09¢ today is worth $1. 00 in a year • $1.

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. March 13, 2002 L 6 -2. 17

Annuities $n in two years is worth $nr 2 today $n in k years

Annuities $n in two years is worth $nr 2 today $n in k years is worth $nr k today March 13, 2002 L 6 -2. 18

Annuities I will pay you $100/year for 10 years If you will pay me

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 100 r + 100 r 2 + 100 r 3 + … + 100 r 10 =100 r(1+ r + … + r 9) = 100 r(1 -r 10)/(1 -r) = $853. 02 March 13, 2002 L 6 -2. 19

In-Class Problems 1 & 2 March 13, 2002 L 6 -2. 20

In-Class Problems 1 & 2 March 13, 2002 L 6 -2. 20

Book Stacking Rosen Rosen table March 13, 2002 L 6 -2. 21

Book Stacking Rosen Rosen table March 13, 2002 L 6 -2. 21

Book Stacking How far out? ? March 13, 2002 L 6 -2. 22

Book Stacking How far out? ? March 13, 2002 L 6 -2. 22

Book Stacking One book center of mass of book 1 2 March 13, 2002

Book Stacking One book center of mass of book 1 2 March 13, 2002 L 6 -2. 23

Book Stacking One book center of mass of book March 13, 2002 L 6

Book Stacking One book center of mass of book March 13, 2002 L 6 -2. 24

Book Stacking One book center of mass of book March 13, 2002 L 6

Book Stacking One book center of mass of book March 13, 2002 L 6 -2. 25

n books March 13, 2002 L 6 -2. 26

n books March 13, 2002 L 6 -2. 26

n books center of mass March 13, 2002 L 6 -2. 27

n books center of mass March 13, 2002 L 6 -2. 27

n books Need center of mass over table March 13, 2002 L 6 -2.

n books Need center of mass over table March 13, 2002 L 6 -2. 28

n books center of mass of the whole stack overhang March 13, 2002 L

n books center of mass of the whole stack overhang March 13, 2002 L 6 -2. 29

n+1 books center of mass of all n+1 books at table edge ∆overhang center

n+1 books center of mass of all n+1 books at table edge ∆overhang center of mass of top n books at edge of book n+1 March 13, 2002 L 6 -2. 30

 overhang = Horizontal distance from n-book to n+1 -book centers-of-mass March 13, 2002

overhang = Horizontal distance from n-book to n+1 -book centers-of-mass March 13, 2002 L 6 -2. 31

Choose origin so center of n-stack at x = 0. Now center of n+1

Choose origin so center of n-stack at x = 0. Now center of n+1 st book is at x = 1/2, and x-coordinate for center of n+1 -stack is: March 13, 2002 L 6 -2. 32

n+1 books center of mass of all n+1 books at table edge center of

n+1 books center of mass of all n+1 books at table edge center of mass of top n books at edge of book n+1 March 13, 2002 L 6 -2. 33

Book stacking summary Bn : : = overhang of n books B 1 =

Book stacking summary Bn : : = overhang of n books B 1 = 1/2 Bn+1 = Bn + 1/2(n+1) Bn = 1/2(1 + 1/2 + … + 1/n) March 13, 2002 L 6 -2. 34

th n Harmonic number Bn = Hn/2 March 13, 2002 L 6 -2. 35

th n Harmonic number Bn = Hn/2 March 13, 2002 L 6 -2. 35

Estimate Hn : 1 Integral Method 1 x+1 1 2 1 3 1 2

Estimate Hn : 1 Integral Method 1 x+1 1 2 1 3 1 2 1 0 1 1 3 2 3 4 5 6 7 8 March 13, 2002 L 6 -2. 36

March 13, 2002 L 6 -2. 37

March 13, 2002 L 6 -2. 37

Book stacking So Hn as n , and overhang can be any desired size.

Book stacking So Hn as n , and overhang can be any desired size. March 13, 2002 L 6 -2. 38

Book stacking Bn 3 Hn 6 Integral bound: ln (n+1) 6 So can do

Book stacking Bn 3 Hn 6 Integral bound: ln (n+1) 6 So can do with n e 6 -1 = 403 books Actually calculate Hn : 227 books are enough. Overhang 3: need March 13, 2002 L 6 -2. 39

Crossing a Desert Gas depot truck How big a desert can the truck cross?

Crossing a Desert Gas depot truck How big a desert can the truck cross? March 13, 2002 L 6 -2. 40

Dn : : = max distance on n tank March 13, 2002 L 6

Dn : : = max distance on n tank March 13, 2002 L 6 -2. 41

1 tank truck D 1= max distance on 1 tank = 1 March 13,

1 tank truck D 1= max distance on 1 tank = 1 March 13, 2002 L 6 -2. 42

n+1 tanks x 1 -2 x truck 1 -2 x 1 -x March 13,

n+1 tanks x 1 -2 x truck 1 -2 x 1 -x March 13, 2002 L 6 -2. 43

n+1 tanks x 1 -2 x n 1 -2 x 1 -x March 13,

n+1 tanks x 1 -2 x n 1 -2 x 1 -x March 13, 2002 L 6 -2. 44

n+1 tanks x (1 -2 x)n + (1 -x) March 13, 2002 L 6

n+1 tanks x (1 -2 x)n + (1 -x) March 13, 2002 L 6 -2. 45

(1 -2 x)n + (1 -x) March 13, 2002 L 6 -2. 46

(1 -2 x)n + (1 -x) March 13, 2002 L 6 -2. 46

(1 -2 x)n + (1 -x) If (1 -2 x)n + (1 -x) =

(1 -2 x)n + (1 -x) If (1 -2 x)n + (1 -x) = n, March 13, 2002 L 6 -2. 47

(1 -2 x)n + (1 -x) If (1 -2 x)n + (1 -x) =

(1 -2 x)n + (1 -x) If (1 -2 x)n + (1 -x) = n, then use n tank strategy from position x. March 13, 2002 L 6 -2. 48

(1 -2 x)n + (1 -x) If (1 -2 x)n + (1 -x) =

(1 -2 x)n + (1 -x) If (1 -2 x)n + (1 -x) = n, then use n tank strategy from position x. Dn+1 = Dn + x March 13, 2002 L 6 -2. 49

(1 -2 x)n + (1 -x) = n x= 1 2 n+1 1 Dn+1

(1 -2 x)n + (1 -x) = n x= 1 2 n+1 1 Dn+1 = Dn + 2 n+1 March 13, 2002 L 6 -2. 50

Can cross any desert! March 13, 2002 L 6 -2. 51

Can cross any desert! March 13, 2002 L 6 -2. 51

In-Class Problem 3 March 13, 2002 L 6 -2. 52

In-Class Problem 3 March 13, 2002 L 6 -2. 52