Exercise Sheets : Sheet1 Sheet2 Sheet3 Sheet 4

Notes : A set of notes is available here.

Random Walk Simulation : If you would like to run the Random Walk simulations that I will demonstrate in Week 1 you will

need to download the Statistical Software called R from the following website

http://www.r-project.org/

To run the simulations start R and then cut and paste the R code from the file

http://www.stats.ox.ac.uk/~marchini/mods_prob/ran_walk.txt

into the R command window. The main function has the form

simRW(num, k, n, p)

where

num = number of simulations to carryout and plot at once

k = starting point of random walk

N = upper absorbing barrier of random walk

p = P(x->x+1) (q = 1 - p = P(x->x-1))

For example, enter the command

simRW(num = 10, k = 16, N = 20, p = 0.4)

to simulate 10 random walks, with a start point of 16, upper absorbing barrier of 20 and probability of upward move of 0.4.

You should get something like this