Math notebook for 29 March 2012

Series

This week we are reminding you of the sequences and series you learned about in math class.
The basic game is to define some a[k] and then sum them up.
For example:

a[k_] = k^2/(k^4+1)

s[n_] := Sum[a[k],{k,1,n}]

ListPlot[Table[s[n],{n,1,50}]]

This one seems to converge (as one can show e.g. by the integral test below).
Sometimes Mathematica even knows something about these sums:

Limit[s[n],n->Infinity]
N[%]

YOUR JOB:  go back and replace a[k] by something else, maybe 1/n or 1/n^2, and re-evalulate the cells above

One of the most important series is the geometric series, such as this one:

a[k_] = (1/2)^k;
ListPlot[Table[s[n],{n,1,10}]]

Limit[s[n],n->Infinity]

Or more generally with a variable x instead of (1/2):

Sum[x^n,{n,0,Infinity}]

Or in terms of good old Taylor series:

Series[1/(1-x),{x,0,10}]

Notice this series convergences when x<1, and diverges when x>1.
Comparing a given series a[k] with this one then gives the ratio test, which says
the series converges if this ratio is less than one:

Limit[a[k+1]/a[k],k->Infinity]

Sometimes (often, even!) this limit is 1, and then we move on to the integral test, illustrated here:

a[k_]= 1/k;
Show[Plot[a[x],{x,0,10}],Plot[a[Floor[x]],{x,1,10},Filling->True]]
Show[Plot[a[x],{x,0,10}],Plot[a[Floor[x]+1],{x,1,10},Filling->True]]
Integrate[a[x],{x,1,Infinity}]

YOUR JOBS:
 (a) Explain to your neighbor what the above cells just demonstrated.
 (b) Repeat with various a[k]’s from the homework e.g. 1/k and 1/(k*Log[k])
 (c) Discuss the Morin relativity problems with your neighbor, possibly using the cells just below.

Morin 11.30

A train of length L0 = 15 light-seconds moves at v=(3/5) c.
How long does it take to pass according to a person on the ground?

L0= 15 c Second
v= (3/5) c
γ = 1/Sqrt[1-(v/c)^2]
Δt = (L0/γ)/v

Now repeat in the train frame.  How do they explain the reading on the ground-person’s clock,
given that the transit time is “really” (i.e. per train-base clocks)

Δtprime = L0/v

Morin 11.32

A train of proper length L moves at our favorite v=(3/5)c, entering a tunnel of proper length L.
(Note the train deems the tunnel to be shortened by Lorentz contraction, and the tunnel deems
the train to be contracted.)  As the train enters the tunnel, everyone synchronizes clocks as best
they can, and a person starts walking from the front of the train to the rear, arriving just as the
train exits the tunnel.
(a) How much time elapses on the ground based clocks?  Leading question: how far has the back of the train moved,
    considering that the train length is contracted to L/γ?  And how long does it take to move that far at the given speed?
(b) Per the ground frame, what is the velocity of the walker, call it say vW?  Leading question: how long did it
    take for the walker to cover that length L of the tunnel?
(c) How much time elapses on the walker’s watch?  Leading question: what is the γ factor for the walker’s vW?

(Optional) Mathematicaism of the day: *deferred* assignment (:=)

You are familiar with ordinary assignment which just gives a value to a variable, e.g.

y=3
x = y
?x
x

Deferred assigment waits until you actually use the variable to make the final assigment of value:

y=3
x := y
x
y=π
?x

x

This can be useful e.g. to define the Fibonacci numbers by recursion.  Without the deferral, watch what happens as Mathematica does its best to “simplify” the righthand side:

f[n_]  = f[n-1]+f[n-2]

Instead, use deferred evaluation as follows:

f[n_]  := f[n-1]+f[n-2]

We of course need to specifiy the starting values:

f[0]=0
f[1] = 1

And then we can use our Fibonacci function:

Table[f[n],{n,0,10}]

OK but now ask e.g. for f[50].  (Again, Alt-. will abort the calculation when you get impatient.)
This should be easy to get, and it is one we tell Mathematica to store the numbers as they are computed:

f[n_]  := f[n]=f[n-1]+f[n-2]

?f

f[6]

?f

f[100]

Why do we mention this today?  Only because if you want lots of terms in a series it might be worth defining

s[n_] := s[n]=s[n-1]+a[n]

s[0]=0

f[x_] := a[Floor[x]+1]

f[3.4]

Show[Plot[f[x],{x,0,10},Filling->Bottom],Plot[a[x],{x,1,10}]]

q