437/537 Homework 9

437/537 Homework 9 Due Thursday Dec 6.

X1. [5pts] In the chalkboard photos on the website, there is one picture missing
from the material to be covered in Test 3. 5 points if you can tell me exactly where
it should be, and describe what the content is. (Email me your answer
and I'll fix it, so only you get the 5 points of extra credit!)

5.4

Ex. 1(a) [5 pts] (Adaptive quadrature with trap rule.)

5.5

Ex. 1(c) [4 pts] (2-point Gaussian quadrature and its error)
You may use Octave or Matlab to do the arithmetic.

X2. (a) [2pts] Derive or find out (give source) the Legendre polynomial p3(x) on [-1,1].
(b) [1pt] Compute the 3 roots of the polynomial in (a). You may of course use Octave or Matlab, but you must show how you did it.
(c) [3pts] Compute the coefficients in the 3-point Gauss quadrature rule. Again feel free to use Octave or Matlab, but show how you did it. Check your answers against Table 5.1.

Ch 9.

X3.
(a) [5pts] Adapt the Octave/Matlab code shown in class on 11/29 to make a log-log plot of the error in the Monte Carlo estimate of the area enclosed by a circle of radius 1.
(b) [2pts] Carefully explain whether your results support or contradict my assertion in class about how the error scales with the number of points used.

X4. (a) [4pts] Determine how to generate random numbers v that are distributed in [0,2] with density %rho(v) = 1 - v/2.
(b) [5pts] Generate at least several thousand numbers using your formula and make a frequency histogram of them using the built-in function hist(vector_of_vs,number_of_bins).