Gen Phys 2, Spring '11

Homework 10

Two "projects", both of which involve random numbers on Excel:

1. The one-dimensional random walk: flip a coin N times, taking a step to the right for each heads and a step to the left for each tails. (Equivalently, flip N coins all at once, assign +1 to each heads and -1 to each tails, add up all the numbers, and take that many steps to the right.) Simulate this, either using coins or random numbers on the computer. The question is: what is your final position after N steps? Call this "Z" (and note that it could be either positive or negative). Now do this over and over again "a bunch" of times, and compute the average value of (i) Z, and (ii) Z^2. Please also make a *histogram* of your data -- i.e., a plot showing the number of times you got the various possible values of Z.

2. Suppose that the x-component of the velocity of a certain molecule is equally likely to be any value between (say) -1 and 1 (in some units). And suppose the same thing is true of the y-component and the z-component. Make an excel sheet with three columns for the x, y, and z components of the velocity and have it randomly assign values in the appropriate way. Now add more rows and do the same thing for "a bunch" of particles. Now add a new column in which you compute, for each particle, its *speed*. Make a histogram of the speeds. Think about why it has the shape it has.