Submitted by Nicholas C. Darnton (inactive) on Tuesday, 3/24/2015, at 1:23 PM

Reading

Schroeder through the end of Chapter 3.

Questions

  1. From the textbook:
    1. 3.21
    2. 3.22.  The scaling in N is nontrivial (that's problem 3.23) so just plot it for a particular value of N (say, N=100).
    3. 3.24.  Pretty straightforward in Mathematica; other programs may not be able to hand the large factorials.  Mathematica can do non-integral extensions of factorials, so you can actually do the numerical derivatives with smaller spacing than delta = 1; this gives a smooth curve where you'd otherwise get artifacts.
    4. 3.25.  If you're having trouble with the series expansion in the last part, you can spot-check a particular term using Mathematica: this is one of the few things Mathematica is really good at.
    5. 3.27.
    6. 3.28.
    7. 3.33.
    8. 3.37.
  2. Stock market
       We recently had a colloquium speaker who talked about analyzing the stock market as a random walk.  Let's look at whether that's a reasonable approach.  For simplicity, treat the data as if they were consecutive in time rather than by business day, and ignore inflation.
    1. Download this text file of daily closing Dow Jones averages (call them DOW(i)).
    2. Calculate a set of returns over an n-day period by simple subtraction: Δ(n) = DOW(i+n)- DOW(i).  Plot histograms of the return for 1, 10, 100 and 1000 days.  The distribution doesn't look very Gaussian to me (so the Dow does not perform a simple random walk), but at least the distribution is spreading pretty uniformly in time.
    3. Average over all the Δ(n) to get the mean return over n days, and plot it over a decade or so.  It increases kind of linearly – this is the source of the "buy and hold" recommendation for making money in the stock market.  The median return increases more slowly, which is an indication that the mean performance of the DOW is driven by a minority of outlying data points. 
    4. Plot the standard deviation of Δ(n) vs n1/2.  This looks kind of linear, or at least not grossly nonlinear for time lags shorter than a couple of years.  
    5. From the previous two graphs, calculate the velocity and diffusion coefficient of the Dow Jones average (in appropriate units) for medium-short times (less than a couple of years).
    6. Using the numbers from the previous part, if you invest in the Dow basket of stocks for one year, calculate the probability of (1) losing money, (2) making more than 10%.  Note that you are implicitly assuming that the Dow return is well-described by a Gaussian distribution, whereas you actually know (from part 2) that real returns do not look Gaussian.  The whole art of financial risk management is accounting for the non-Gaussian tails in the returns; this is what failed so spectacularly when the stock market collapsed two years ago. 
    7. The most important characteristic of a random walk is that its next step is independent of its history (i.e. of its past steps).  This is most simply calculated as a correlation function: C(m) = <Δ(n) Δ(n+m)>.  Positive values of C indicate correlations; negative C are anticorrelations, and zero is no correlation at all.  An ideal walk has completely independent steps, so C(m) = δ(m) (Kronecker delta function); more realistic random walks may have short-term correlations like C(m) = em, or possibly more complicated power-law correlations.
      1. Plot the correlation function C(m) for the Dow, including uncertainty, for time lags from days to years; for the 'experimental' uncertainty on C(m) take the standard deviation of the mean.  You should find that the correlation function is zero (within uncertainty) over all time scales.  This is why it is so hard to time the stock market: it has essentially no momentum over short time scales.  You've probably taken more economics courses than I have: is there some efficient-market hypothesis that guarantees this?  For this small set of data, it's not so bad to calculate the correlation function in real time; for larger data sets, it's faster to do in Fourier space.
      2. Since the market does go up consistently over long times, there must be a very small residual positive correlation in there.  What value do you expect C(m) to have (for large m)?  Is your plot of C(m) consistent with this?  
  3. 2D random walk on a lattice.
       In class we calculated the multiplicity for a 1D random walk (N steps of length l, each to the left or right): Ω(N,nR,nL) = N!/(nR! nL!).  We then changed variables to Δ=(nR-nL) and found an approximate expression for Ω(N,Δ) for small Δ.
    1. Find the multiplicity Ω(N,nR,nL) for a 2D random walk: an N-step walk where each step is either left, right, forward or backward.  Note that this is not the same as two 1D N-step random walks. 
    2. Change variables to the net displacement, Δ = (nR-nL), and the number of left-right steps, n = nR+nL, and rewrite the multiplicity as Ω(N,Δ,n).
    3. We usually only care about the net displacement Δ, not the details of how we arrived at Δ.  For instance, we don't care what n isThis is equivalent to saying that the multiplicity of the macrostate Ω(N,Δ) is the sum of all the microstates Ω(N,Δ,n).  Plot Ω(100,Δ,n) as a function of (allowable) n, for Δ=0, Δ=5, and Δ=25.  You need to sum over all these terms to calculate Ω(N,Δ); usually only one of the terms dominates, but it isn't obvious to me that we can neglect any of the terms in the sum – at least, not for all Δ; try plotting Ω(N,Δ,n) for Δ=80 –  so ...
    4. Do the sum numerically (in Mathematica or something similar) and plot its logarithm ln Ω(100,Δ) as a function of Δ.  With a factor of k, this is the entropy.
    5. Reinterpret this as the entropy of a non-interacting spin-1/2 paramagnet that can point left, right, up and down.  You apply an external field B in the left-right direction; B interacts with the magnetization M = μ Δ with an interaction energy U = - B M.
      1. Write an expression for the free energy G(B,N) in terms of B, N, Δ and the multiplicity function (and kT, of course).
      2. G / kT should be a simple function that depends only on the nondimensional parameter α ≡ μB/kT, Δ, and Ω(N,Δ).  Plot G/kT as a function of Δ for α=0.5, 1, and 2, and locate its minimum for each value of α.  This is the thermodynamically stable magnetization (if you multiply it by μ) that results from applying the field B to the paramagnet.  You can check your solutions against the exact analytic solution Δmin = N sinh α / (1 + cosh α).
  4. 3D random walk on a lattice.
       Repeat the previous question for a 3D random walk: an N-step walk where each step is either left, right, forward, backward, up or down.  This should be a very minor modification of the previous question: only one number will change in your formulation of the problem.  For comparison, the analytic solution is Δmin = N sinh α / (2 + cosh α).  (See how similar it is?).  When we develop partition functions you'll be able to solve these problems analytically in 3 lines.