This exercise is to be handed in (questions 1 and 2) and emailed or placed on a webpage (question 1) to Dr Adler by 18:00 on the evening of the day of the 5th pair of lectures. Late exercises will be penalised at 2(/10) points per day. Descriptions may be placed on a website or printed or handwritten in English or Hebrew, if handwritten must be clearly written. No points will be deducted for mistakes in English and I probably wouldn't notice any in Hebrew. Note that for question 1 you can use any computer and language; for question 2 you must use the fortran programs but can use any computer, although I recommend phelafel, phclasses or aluf.
1. Exact Enumeration Write a program that enumerates
NW(x,N), the total number of random walks of N
steps that reach the point
for all x for N=4,5,6,7 and 8.
(Hint: use the results NW(0,4)=NW(+/-1,3) and
NW(+/-2,4)=NW(+/-1,3)+NW(+/-3,3) that were discussed in class.)
You can use any language or computer for this.
Describe your results in words on paper (printed or handwritten
as you prefer)
and email (or place on a webpage) your
program to Dr Adler at firstname.lastname@example.org
Both the program by email and the description on paper
are needed for a correct answer.
This is the last time I am asking you to email homework - from here on its all printed on either real paper or the web.
2. Simulation Use the programs rwalk1.f and cplot.f to draw graphs of PN(x), the probability that after N steps a walker has nett displacement x, for N=8,16,32 and 64. (The programs are on the http site.) Discover the effect of changing the seed and number of walkers on the form of these graphs. You will need to run a large number of seeds and different numbers of walkers to observe this well. Hand in a summary of these effects and one printed graph, the discussion handwritten or printed as you prefer. There is no need to hand in any programs for question 2. On some computers you can prepare a gif file by selecting the driver /gif in cplot.f to create a file that will be called pgplot.gif and then print thru a browser. On some computers the graph can be printed on a postscript printer by selecting the driver /ps in cplot.f to create a postcript file that will be called pgplot.ps and then by using the correct printer command for your printer. You can also use the linux command ps2pdf to convert a ps file to a pdf file and then print from acrobat.
3. Optional question for 5 point bonus. We will reach parallel programming later in the semester, but if you already know how to do it, you may take this optional 5 point bonus question any time before we start learning parallel coding together. The targil is to simulate the random walk process for 100 walkers with a walk of 1000 steps each and present results for the mean square displacement of the whole system. 5 points will be given for a truly parallel code where the walkers are divided between processors using MPI commands. You can get help at: here.
If you have access to another parallel machine great; if not you will need an account on TAMNUN and need to learn to use TAMNUN, see Dr Adler to arrange this.
Back to the index page