Numerical Analysis I, Fall 2011 (http://www.math.nthu.edu.tw/˜ wangwc/)

Homework Assignment for Week 02

1. Section 1.3: Problems 3, 4, 7, 14, 15.

2. Another express of π is given by the Wallis formula

\frac{π}{2} = ∏_{n=1}^{∞} (\frac{(2n)^{2}}{(2n − 1)(2n + 1)}) .

There are two ways of computing the N-term approximation, namely

\frac{π_{N}}{2} = (\frac{2 · 2}{1 · 3}) (\frac{4 · 4}{3 · 5}) (\frac{6 · 6}{5 · 7}) ⋯ (\frac{2N · 2N}{(2N − 1) · (2N + 1)}) or \frac{4^{N}(N!)^{2}}{( ∏_{n=1}^{N}(2n − 1)) · ( ∏_{n=1}^{N}(2n + 1))}

Which one is better in terms of the overflow issue? What is the rate of convergence?

Hint: The rate of convergence can be analyzed analytically, which may be easier for you. But if time permits, you should also explore numerically by plotting |π − π_{N}| as a function of N. For example, the two methods in problem 4 of section 1.3 give algebraic rate (N^{−k}) and exponential rate (q^{−N}), respectively. The difference can easily be observed by plotting the results. The former appears as a straight line in the ‘loglog’ plot on matlab and the latter appears as a straight line in ’semilogy’ plot.

3. Consider the following recursive relation

x_{1} = a, x_{2} = \frac{a}{2}, x_{n} = \frac{5}{2}x_{n−1} − x_{n−2}

(a) What is the exact solution?

(b) With a = 1/3, is it stable? How fast does the relative error grow/decay in n as n gets larger? Analyze it and verify your answer numerically.

(c) Do the same for a = 1 and explain your observation.

4. Derive a finite difference approximation for f′(x) and f′′(x) respectively from f(x−h), f(x) and f(x+2h). This is another demonstration why (symmetric) centered difference works better in terms of accuracy.