COMPUTER PROBLEMS 9.3

\(\def\ds{\displaystyle} \) 1 (a) Each random walk starts at zero and increases or decreases by one at each step. For example, one can generate a uniform random number \(x\) in \([0,1]\), increasing the random walk if \(x<0.5\) and decreasing otherwise. After each step, test to see if the random walk has reached either boundary of the interval \([-b,a]\), in which case the walk is terminated. Example results after repeating \(10^4\) times using the minimal standard LCG with seed \(x_0=1\) are that the top \(5\) was reached before the bottom \(-2\) a total of \(2907\) times. We calculate the probability as \(0.2907\), which compares with the theoretical answer of \(2/7\approx 0.2857\). The error is \(= 0.0050\).

1 (b) Similar to (a), for interval \([-5,3]\). Monte-Carlo approximation of probability of reaching the top is \(0.6323\) with error \( 0.0073\).

1 (c) Similar to (a), for interval \([-8,3]\). Monte-Carlo approximation of probability of reaching the top is \(0.7322\) with error \( 0.0049\).


3 (a) The same program can be used as in Computer Problem 1, but the random walk should increase if the uniform random number \(x\) in \([0,1]\) satisfies \(x< p\), and decrease otherwise. Using the Minimal Standard Generator, the probability of reaching \(5\) before \(-2\) using bias \(p=0.7\) is estimated to be \(0.8199 \), with error \(=0.0014\) when compared with the theoretical value \([((1-p)/p)^b-1]/[((1-p)/p)^{a+b}-1]\).

3 (b) Similar to (a), on the interval \([-5,3]\). Monte-Carlo estimate of probability of reaching \(3\) is \(0.9871 \) with error \(=0.0004\).

3 (c) Similar to (a), on the interval \([-8,3]\). Monte-Carlo estimate of probability of reaching \(3\) is \(0.9984 \) with error \(=0.0006 \).


5 (a) The code in the text can be used to generate Brownian motion. Starting at zero, using step size \(\Delta t=0.01\), the probability of reaching \(5\) before \(-2\) is \(0.297\), with error \(= 0.011\) when compared with the theoretical value \(b/(a+b)=2/7\).

5 (b) Similar to (a). Estimated probability of reaching \(\pi\) before \(-2\) is \(0.394\), with error \(= 0.005\) when compared with the theoretical value \(2/(2+\pi)\).

5 (c) Similar to (a). Estimated probability of reaching \(3\) before \(-8/3\) is \(0.460\), with error \(= 0.011\) when compared with the theoretical value \(8/17\).


7 (a) Create Brownian motion simulations \(B_t\) with step size \(\Delta t=0.01\). Beginning with time \(t_1\), after each time step, calculate the product of the two previous steps \(B_t\) and \(B_{t-1}\). If negative, the path has crossed zero. Estimate the probability that at least one crossing occurs between \(t_1\) and \(t_2\) as a Type 2 Monte Carlo simulation with \(10^4\) realizations. For \(t_1=3, t_2=5\), an example simulation yielded the estimated probability as \(0.5848\), with error \(= 0.0207\) when compared with the theoretical value \((2/\pi)\arcsin\sqrt{3/5}\).

7 (b) Similar to (a). Estimated probability is \(0.3106\), error \(= 0.0154\).

7 (c) Similar to (a). Estimated probability is \(0.7155\), error \(= 0.0107\).