Exercises (6)

Assigned: Feb 26, 2013
Due: March 12, 2013

Rolling Dice (in-class)

What is the probability of throwing 8 or less with three dice, each with six sides numbered 1 through 6? Write a Mathematica simulation (with at least 1000 trial dice rolls) to numerically estimate the probability. (Can you estimate the probability analytically?)

Langevin Equations for Brownian Motion (in-class)

The Langevin equation for Brownian motion can be written as a sequence of random steps. Each time step, random motion of molecules cause particles to change their velocities. Friction with the surroundings cause the velocity to slow back towards zero. This is a model for the random motion of fine dust particles on the surface of liquid, for example.

The Langevin equation describes the trajectory of an object with a random force, s, and a frictional damping, γ. In differential form, the Langevin equation is
	(∂_t) v = - γ v + s
	(∂_t) x = v
The Langevin equation can be written in finite-difference form as a two-dimensional map:
	(Subscript[v, n]) = (1 – γ Δt) (Subscript[v, n-1]) + (Subscript[s, n])
	(Subscript[x, n]) = (Subscript[x, n-1]) + Δt (Subscript[v, n-1])
This map has a similar form to the deterministic equations for planetary orbits and pendulums. The big difference here is that the change in velocity cause by (Subscript[s, n])is random!

A trajectory following the Langevin equations can be found from the map below, where γ = 0.1, Δt = 1, and where (Subscript[s, n])= ± 1.

langevin[{x_,v_}]:={x+v,0.9` v+(2 RandomInteger[]-1)}

langevin[langevin[{0, 10}]]

Part a:
Construct a simulation using langevin[…] and NestList[...] beginning with {(Subscript[x, 0]), (Subscript[v, 0])} = {0, 10} for about 50 steps and for about 1000 "walkers".

Part b:
What is the evolution of the average position and average velocity?

Part c:
Plot the mean-squared position and velocity of the walkers. Does the velocity and position diffuse? If so, can you estimate the diffusion coefficient?

The Game of Craps

Create a simulation and estimate the probability that you will win in a "game of craps."

The game of craps is a game played by rolling two dice (numbered 1 to 6). If you roll 2, 3, or 12 on the first try, you lose. If you roll 7 or 11 on the first try, you win. If you roll anything else (i.e. 4, 5, 6, 8, 9, 10), to win you must roll that number again before you roll 7. If you roll 7 first, then you lose. You can roll as many times as you need until you either win or lose.

Two-Dimensional Random Walk

For the two-dimensional random walk, particles make unit steps in one of four orthogonal directions: up, down, right, or left. A simple 2D walker function is

step2D[]:={{0,1},{1,0},{0,-1},{-1,0}}[[RandomInteger[{1,4}]]]

Table[step2D[], {5}]

If a walker starts at the origin {x, y} == {0, 0}, then the following command generates a trajectory with n steps.

walk2D[n_] := NestList[(# + step2D[])&, {0,0}, n]

walk2D[5]

Question: what is the mean distance of a two-dimensional random walk as a function of n? (Hint, define a function radius[{x_, y_}] that returns the radius from the origin, and Map[...] this function to every coordinate-pair of each walker's trajectory.) You should find that the mean radius increases in proportion to (Sqrt[n]).