COMPUTER PROBLEMS 9.2

\(\def\ds{\displaystyle} \) 1 (a) \(1/3\)

1 (b) Similar to Computer Problem 9.1.3(b), but using the Halton sequence of quasi-random numbers to do the Type 1 Monte-Carlo approximation. Results are shown below.

1 (c) Similar to Computer Problem 9.1.3(c), but using halton(2,n) and halton(3,n) for the \(x\) and \(y\) coordinates. \[ \text{(b)}\ \ \ \ \begin{array}{ccc} n&\text{Type 1 estimate}&\text{error}\\ 10^{2}& 0.335414& 0.002080\\ 10^{3}& 0.333514& 0.000181\\ 10^{4}& 0.333339& 0.000006\\ 10^{5}& 0.333334& 0.000001\\ \end{array}\ \ \text{(c)}\ \ \ \ \begin{array}{ccc} n&\text{Type 2 estimate}&\text{error}\\ 10^{2}& 0.35& 0.016667\\ 10^{3}& 0.333& 0.000333\\ 10^{4}& 0.3339& 0.000567\\ 10^{5}& 0.33338& 0.000047\\ \end{array}\ \ \ \]


3 Similar to Computer Problem 9.1.5, but with quasi-random numbers from a Halton sequence. Results are: \[ \text{(a)}\ \ \ \ \begin{array}{ccc} n&\text{Type 2 estimate}&\text{error}\\ 10^{4}& 0.5232& 0.000399\\ 10^{5}& 0.52396& 0.000361\\ \end{array}\ \ \text{(b)}\ \ \ \ \begin{array}{ccc} n&\text{Type 2 estimate}&\text{error}\\ 10^{4}& 0.1743& 0.000233\\ 10^{5}& 0.17455& 0.000017\\ \end{array}\ \ \ \]
5 Generate 4-tuples \((x,y,z,w)\) of uniform random numbers in the four-dimensional cube \([-1,1]^4\). Since the cube has volume \(2^4\), the volume of the four-dimensional ball can be approximated by multiplying the proportion of 4-tuples that satisfy \(x^2+y^2+z^2+w^2<1\) by \(16\). Comparing with the correct volume \(\pi^2/2\), typical results are: Monte-Carlo estimate \(4.9656\), error \( = 0.030798\); quasi-Monte-Carlo estimate \(4.92928\), error \( = 0.005522\).
7 (a) For every matrix \(\displaystyle\left[\begin{array}{cc} a&b\\c&d\\ \end{array}\right]\) there is a matrix \(\displaystyle\left[\begin{array}{cc} b&a\\d&c\\ \end{array}\right]\) whose determinant has opposite sign. The probability is \(0.5\) that the determinant is positive. An example pseudo-Monte-Carlo estimate with \(n=10^6\) matrices gives \(0.500313\).

7 (b) The determinant of the symmetric matrix with non-negative entries \(\displaystyle\left[\begin{array}{cc} x&z\\z&y\\ \end{array}\right]\) is \(xy-z^2\), which is positive if \(z<\sqrt{xy}\). If \(x,y,z\) are uniform in \([0,1]\), this corresponds to the volume in the cube \([0,1]^3\) lying under the surface \(z=\sqrt{xy}\), or \[\int_0^1\int_0^1\sqrt{x}\sqrt{y}\ dy\ dx = \int_0^1 \frac{2}{3}\sqrt{x} \ dx=\frac{4}{9}.\] An example Monte-Carlo estimate with \(n=10^6\) matrices gives \(0.444486\).


9 The exact answer is \(\displaystyle \frac{1}{4}\frac{1}{3}\frac{1}{2} = \frac{1}{24}\approx 4.167\) percent. A Monte-Carlo simulation can be done by loading matrices with uniform random numbers from \([0,1]\) and calculating the PA=LU factorization. The proportion of times that \(P\) is the identity matrix is the desired quantity.