# Numerical Methods Qualification Exam Problems and Solutions (University of Maryland)/August 2007
## Problem 1

* A set of functions $\{g_{1},\ldots ,g_{n}\}\subset C[a,b]\!\,$ is a Chebyshev system if
* (i) The set is linearly independent.
* (ii) If $g\!\,$ is a linear combination of $\{g_{1},\ldots ,g_{n}\}\!\,$ which is not identically zero, $g\!\,$ has at most $n-1\!\,$ distinct zeros in $[a,b]\!\,$.

## Problem 1a

* Show that $\{g_{1},\ldots ,g_{n}\}\!\,$ is a Chebyshev system if and only if for any $n\!\,$ distinct points $x_{1},\ldots ,x_{n}\in [a,b]\!\,$ the matrix $A\!\,$ with $a_{i,j}=g_{j}(x_{i}),1\leq i,j\leq n\!\,$ is non-singular.

## Solution 1a
### Forward Direction

We want to prove the following statement:
If $\{g_{1},\ldots ,g_{n}\}\!\,$ is a Chebyshev system, then for any $n\!\,$ distinct points $x_{1},\ldots ,x_{n}\in [a,b]\!\,$ the matrix $A\!\,$ with $a_{i,j}=g_{j}(x_{i}),1\leq i,j\leq n\!\,$ is non-singular.
Writing out the matrix $A\!\,$ yields:
$A={\begin{pmatrix}g_{1}(x_{1})&g_{2}(x_{1})&\cdots &g_{n}(x_{1})\\g_{1}(x_{2})&g_{2}(x_{2})&\cdots &g_{n}(x_{2})\\\vdots &\vdots &\ddots &\vdots \\g_{1}(x_{n})&g_{2}(x_{n})&\cdots &g_{n}(x_{n})\end{pmatrix}}$
Since the set $\{g_{1},\ldots ,g_{n}\}\!\,$ is linearly independent, there does not exist any non-zero sets of constants of $\alpha _{i}\!\,$ such that $\sum _{i=1}^{n}\alpha _{i}g_{i}(x)=0\!\,$ for any $x\in [a,b]\!\,$. Hence, the columns of the matrix $A\!\,$ are linearly independent which implies that $A\!\,$ is non-singular.

### Reverse Direction
#### Proof of (i)

Assume $A\!\,$ is non-singular.
This implies the columns of
    $A={\begin{pmatrix}g_{1}(x_{1})&g_{2}(x_{1})&\cdots &g_{n}(x_{1})\\g_{1}(x_{2})&g_{2}(x_{2})&\cdots &g_{n}(x_{2})\\\vdots &\vdots &\ddots &\vdots \\g_{1}(x_{n})&g_{2}(x_{n})&\cdots &g_{n}(x_{n})\end{pmatrix}}$
are linearly independent. Since $A\!\,$ is non-singular for any choice of $\{x_{1},x_{2},\ldots ,x_{n}\}\!\,$, $\{g_{1},g_{2},\dots ,g_{n}\}\!\,$ is a linearly independent set and we have shown $(i)\!\,$.

#### Proof of (ii)

By hypothesis, $g(x)\!\,$ is a linear combination of $\{g_{1},g_{2},\dots ,g_{n}\}\!\,$ i.e.
    $g(x)=\alpha _{1}g_{1}(x)+\alpha _{2}g_{2}(x)+\cdots +\alpha _{n}g_{n}(x)\!\,$
for $\alpha _{i}\!\,$ not all zero.
Assume for the sake of contradiction that $g(x)\!\,$ has $n\!\,$ zeros at ${\hat {x_{1}}},{\hat {x_{2}}},\ldots ,{\hat {x_{n}}}\!\,$
This implies the following $n\!\,$ equations:
${\begin{aligned}g({\hat {x_{1}}})&=0=\alpha _{1}g_{1}({\hat {x_{1}}})+\alpha _{2}g_{2}({\hat {x_{1}}})+\cdots +\alpha _{n}g_{n}({\hat {x_{1}}})\\g({\hat {x_{2}}})&=0=\alpha _{1}g_{1}({\hat {x_{2}}})+\alpha _{2}g_{2}({\hat {x_{2}}})+\cdots +\alpha _{n}g_{n}({\hat {x_{2}}})\\&\vdots \\g({\hat {x_{n}}})&=0=\alpha _{1}g_{1}({\hat {x_{n}}})+\alpha _{2}g_{2}({\hat {x_{n}}})+\cdots +\alpha _{n}g_{n}({\hat {x_{n}}})\end{aligned}}$
Rewriting the equations in matrix form yields
${\begin{pmatrix}g_{1}({\hat {x_{1}}})&g_{2}({\hat {x_{1}}})&\cdots &g_{n}({\hat {x_{1}}})\\g_{1}({\hat {x_{2}}})&g_{2}({\hat {x_{2}}})&\cdots &g_{n}({\hat {x_{2}}})\\\vdots &\vdots &\ddots &\vdots \\g_{1}({\hat {x_{n}}})&g_{2}({\hat {x_{n}}})&\cdots &g_{n}({\hat {x_{n}}})\end{pmatrix}}{\begin{pmatrix}\alpha _{1}\\\alpha _{2}\\\vdots \\\alpha _{n}\end{pmatrix}}={\begin{pmatrix}0\\0\\\vdots \\0\end{pmatrix}}$
Since $\alpha _{i}\!\,$ are not all zero, this implies that the columns of $A\!\,$, $\{g_{1},g_{2},\ldots ,g_{n}\}$, are linearly dependent, a contradiction.
Hence, $g\!\,$ has at most $n-1\!\,$ zeros, and we have shown $(ii)\!\,$.

## Problem 1b

* Let $f\in C^{m+1}[a,b]\!\,$ be such that $f^{(m+1)}(x)\neq 0\!\,$ for all $x\in [a,b]\!\,$. Let $g_{j}(x)=x^{j-1},j=1,\ldots ,m+1\!\,$. Show that $\{g_{1},\ldots ,g_{m+1},f\}\!\,$ is a Chebyshev system. For this, you may use results from polynomial interpolation without proof.

## Solution 1b

We have to prove:
(i) $\{1,x,x^{2},\dots ,f\}\!\,$ is a linearly independent set
(ii)any linear combination of this set has at most $m\!\,$ zeros.

### Proof of (i)

If we evaluate $g_{1},g_{2},\dots ,g_{m+1}\!\,$ at $m+1\!\,$ distinct points, $\{x_{1},x_{2},\ldots ,x_{m+1}\}$, we have the following Van Der Monde matrix whose determinant is non-zero.
${\begin{pmatrix}1&1&\cdots &1\\x_{1}&x_{1}^{2}&\cdots &x_{1}^{m}\\\vdots &\vdots &\ddots &\vdots \\x_{m+1}&\cdots &\cdots &x_{m+1}^{m}\end{pmatrix}}$
Hence, $g_{1},g_{2},\dots ,g_{m+1}\!\,$ are linearly independent.
Assume for the sake of contradiction that $f\!\,$ is a linear combination of $g_{1},g_{2},\dots ,g_{m+1}\!\,$, that is
${\begin{aligned}f(x)&=\beta _{0}g_{1}(x)+\beta _{1}g_{2}(x)+\dots +\beta _{m}g_{m+1}(x)\\&=\beta _{0}\cdot 1+\beta _{1}x+\beta _{2}x^{2}+\dots +\beta _{m}x^{m}\end{aligned}}$.
Hence, $f(x)\!\,$ is a polynomial of degree $m\!\,$. Taking $m+1\!\,$ derivatives of $f(x)\!\,$ yields
    $f^{(m+1)}(x)=0\!\,$
which contradicts the hypothesis. Therefore $\{1,x,x^{2},\dots ,f\}\!\,$ is a linearly independent set.

### Proof of (ii)

Let $h(x)=\beta _{0}g_{1}(x)+\beta _{1}g_{2}(x)+\dots +\beta _{m}g_{m+1}(x)+\beta _{m+1}f(x)\!\,$.
Suppose $h\!\,$ has $m+2\!\,$ (or more) zeros in $[a,b]\!\,$. By Rolle's Theorem, the (n+1)st derivative of f vanishes on the given interval, a contradiction.
(i) and (ii) show that $\{1,x,x^{2},\dots ,f\}\!\,$ is a Chebyshev system.

## Problem 2

* Let
* $I_{n}(f)=\sum _{k=1}^{n}w_{n,k}f(x_{n},k),\quad \quad a\leq x_{n,k}\leq b\quad \quad (0)$
* be a sequence of integration rules.

## Problem 2a

* Suppose
* $\lim _{n\rightarrow \infty }I_{n}(x^{k})=\int _{a}^{b}x^{k}dx,\quad \quad k=0,1,\ldots \quad \quad (1)$
* and
* $\sum _{k=1}^{n}|w_{n,k}|\leq M,\quad \quad n=1,2,\ldots \quad \quad (2)$
* for some constant $M\!\,$. Show that
* $\lim _{n\rightarrow \infty }I_{n}(f)=\int _{a}^{b}f(x)dx$
* for all $f\in C[a,b]\!\,$

## Solution 2a

By the Weierstrass Approximation Theorem, given $\epsilon >0\!\,$, there exists a polynomial $p(x)\!\,$ such that
    $\max _{a\leq x\leq b}|f(x)-p(x)|\leq \min\{{\frac {\epsilon }{2}}\cdot {\frac {1}{M}},{\frac {\epsilon }{2}}\cdot {\frac {1}{b-a}}\}\quad \quad (3)$
Let
    $I(f)=\int _{a}^{b}f(x)dx$
Adding and subtracting $I(p)\!\,$ and $I_{n}(p)\!\,$, yields,
    $I(f)-I_{n}(f)=[I(f)-I(p)]+[I(p)-I_{n}(p)]+[I_{n}(p)-I_{n}(f)]\!\,$
By the triangle inequality and equation (2) and (3),
${\begin{aligned}|I(f)-I_{n}(f)|&\leq |I(f-p)|+|I(p)-I_{n}(p)|+|I_{n}(p-f)|\\&\leq \int _{a}^{b}|f(x)-p(x)|dx+|I(p)-I_{n}(p)|+\sum _{k=1}^{n}|w_{n,k}||f(x_{n},k)-p(x_{n},k)|\\&\leq {\frac {\epsilon }{2(b-a)}}\int _{a}^{b}dx+|I(p)-I_{n}(p)|+{\frac {\epsilon }{2M}}\sum _{k=1}^{n}|w_{n,k}|\\&\leq {\frac {\epsilon }{2(b-a)}}(b-a)+|I(p)-I_{n}(p)|+{\frac {\epsilon }{2M}}M\\&=\epsilon +|I(p)-I_{n}(p)|\end{aligned}}$
By equation (1), when $n\rightarrow \infty \!\,$ ,
    $|I(p)-I_{n}(p)|=0\!\,$
Hence for arbitrary small $\epsilon >0\!\,$ as $n\rightarrow \infty \!\,$,
    $|I(f)-I_{n}(f)|\leq \epsilon$
i.e.
    $I(f)=\lim _{n\rightarrow \infty }I_{n}(f)\!\,$

## Problem 2b

* Show that if all $w_{n,k}>0\!\,$ then (1) implies (2).

## Solution 2b

For $k=0\!\,$, equation (1) yields,
${\begin{aligned}\lim _{n\rightarrow \infty }I_{n}(x^{0})&=\int _{a}^{b}x^{0}dx\\\lim _{n\rightarrow \infty }I_{n}(1)&=\int _{a}^{b}1\cdot dx\\&=(b-a)\end{aligned}}$
Letting $f(x)\!\,$ in equation (0) yields,
    $I_{n}(1)=\sum _{k=1}^{n}w_{n,k}\cdot 1=\sum _{k=1}^{n}w_{n,k}$
Combining the two above results yields,
${\begin{aligned}\lim _{n\rightarrow \infty }I_{n}(1)&=\lim _{n\rightarrow \infty }\sum _{k=1}^{n}w_{n,k}\\&=(b-a)\\&\leq M\end{aligned}}$
Since $(b-a)\!\,$ is finite, there exists some number $M\!\,$ such that $(b-a)\leq M$.
Since $w_{n,k}>0\!\,$,
    $\lim _{n\rightarrow \infty }\sum _{k=1}^{n}|w_{n,k}|\leq M$
i.e. equation (2).

## Problem 3

* Consider the real system of linear equations
* $Ax=b\quad \quad (1)\,\!$
* where $A\,\!$ is non singular and satisfies
* $(v,Av)>0\,\!$
* for all real $v\,\!$, where the Euclidean inner product is used here.

## Problem 3a

* Show that $(v,Av)=(v,Mv)\,\!$ for all real $v\,\!$ where $M={\frac {1}{2}}(A+A^{T})\,\!$ is the symmetric part of $A\,\!$.

## Solution 3a

Substituting for $M\!\,$ in $(v,Mv)\!\,$ and expanding the inner product we have,
${\begin{aligned}(v,Mv)&=(v,{\frac {1}{2}}(A+A^{T})v)\\&=(v,{\frac {1}{2}}Av+{\frac {1}{2}}A^{T}v)\\&=(v,{\frac {1}{2}}Av)+(v,{\frac {1}{2}}A^{T}v)\\&={\frac {1}{2}}(v,Av)+{\frac {1}{2}}(v,A^{T}v)\end{aligned}}$
From properties of inner products we have,
    $(v,A^{T}v)=(Av,v)=(v,Av)\!\,$
Hence,
${\begin{aligned}(v,Mv)&={\frac {1}{2}}(v,Av)+{\frac {1}{2}}(v,A^{T}v)\\&={\frac {1}{2}}(v,Av)+{\frac {1}{2}}(v,Av)\\&=(v,Av)\end{aligned}}$

## Problem 3b

* Prove that
* ${\frac {(v,Av)}{(v,v)}}\geq \lambda _{\min }(M)>0\,\!$
* where $\lambda _{\min }(M)\,\!$ is the minimum eigenvalue of $M\,\!$.

## Solution 3b
### First Inequality

    ${\frac {(v,Av)}{(v,v)}}={\frac {(v,Mv)}{(v,v)}}={\frac {v^{T}Mv}{v^{T}v}}$
Since $M\,\!$ is symmetric, it has a eigenvalue decomposition
    $M=Q^{T}\Lambda Q\!\,$
where $Q\,\!$ is orthogonal and $\Lambda \,\!$ is a diagonal matrix containing all the eigenvalues.
Substitution yields,
    ${\frac {(v,Av)}{(v,v)}}={\frac {v^{T}Q^{T}\Lambda Qv}{v^{T}v}}$
Let
    $Qv=x\!\,$
This implies the following three relationships:
    ${\begin{aligned}v&=Q^{T}x\\v^{T}Q^{T}&=x^{T}\\v^{T}&=x^{T}Q\end{aligned}}$
Substituting,
    ${\begin{aligned}{\frac {v^{T}Q^{T}\Lambda Qv}{v^{T}v}}&={\frac {x^{T}\Lambda x}{x^{T}QQ^{T}x}}\\&={\frac {x^{T}\Lambda x}{x^{T}x}}\end{aligned}}$
Expanding the numerator we have,
${\begin{aligned}x^{T}\Lambda x&={\begin{bmatrix}x_{1}x_{2}\ldots x_{n}\end{bmatrix}}{\begin{bmatrix}\lambda _{1}&&&\\&\lambda _{2}&&\\&&\ddots &\\&&&\lambda _{n}\end{bmatrix}}{\begin{bmatrix}x_{1}\\x_{2}\\\vdots \\x_{n}\end{bmatrix}}\\&={\begin{bmatrix}x_{1}x_{2}\ldots x_{n}\end{bmatrix}}{\begin{bmatrix}\lambda _{1}x_{1}\\\lambda _{2}x_{2}\\\vdots \\\lambda _{n}x_{n}\\\end{bmatrix}}\\&=\lambda _{1}x_{1}^{2}+\lambda _{2}x^{2}+\ldots +\lambda _{n}^{2}x_{n}^{2}\\&=\sum _{i=1}^{n}\lambda _{i}x_{i}^{2}\end{aligned}}$
Expanding the denominator yield
    $x^{T}x=\sum _{i=1}^{n}x_{i}^{2}$
Substituting,
    ${\begin{aligned}{\frac {x^{T}\Lambda x}{x^{T}x}}&={\frac {\sum _{i=1}^{n}\lambda _{i}x_{i}^{2}}{\sum _{i=1}^{n}x_{i}^{2}}}\\&\geq \lambda _{\min }(M){\frac {\sum _{i=1}^{n}x_{i}^{2}}{\sum _{i=1}^{n}x_{i}^{2}}}\\&=\lambda _{\min }(M)\end{aligned}}$

### Second Inequality

From part(a)
    $(v,Av)=(v,Mv)>0\!\,$
for all real $v\!\,$.
Therefore $M\!\,$ is positive definite which implies all its eigenvalues are positive. In particular,
    $\lambda _{\min }(M)>0\!\,$

## Problem 3c

* Now consider the iteration for computing a series of approximate solutions to (1),
* $x_{k+1}=x_{k}+\alpha r_{k}\!\,$
* where $r_{k}=b-Ax_{k}\!\,$ and $\alpha \!\,$ is chosen to minimize $\|r_{k+1}\|_{2}\!\,$ as a function of $\alpha \!\,$. Prove that
* ${\frac {\|r_{k+1}\|_{2}}{\|r_{k}\|_{2}}}\leq \left(1-{\frac {\lambda _{\min }(M)^{2}}{\lambda _{\max }(A^{T}A)}}\right)^{\frac {1}{2}}\!\,$

## Solution 3c

First, we want to write $\|r_{k+1}\|^{2}$ as a function of $\alpha \!\,$ i.e.
    $f(\alpha )=\|r_{k+1}\|^{2}\!\,$
Changing the indices of equation $r_{k}\!\,$ from $k\!\,$ to $k+1\!\,$,substituting for $b-Ax_{k}\!\,$, and applying the definition of norm yields,
${\begin{aligned}\|r_{k+1}\|^{2}&=\|b-Ax_{k+1}\|^{2}\\&=\|b-Ax_{k}-\alpha Ar_{k}\|^{2}\\&=\|r_{k}-\alpha Ar_{k}\|^{2}\\&=(r_{k}-\alpha Ar_{k},r_{k}-\alpha Ar_{k})\\&=(r_{k},r_{k})-\alpha (Ar_{k},r_{k})-\alpha (r_{k},Ar_{k})+\alpha ^{2}(Ar_{k},Ar_{k})\end{aligned}}$
From a property of inner products and since $A\!\,$ is symmetric,
    $(r_{k},Ar_{k})=(A^{T}r_{k},r_{k})=(Ar_{k},r_{k})\!\,$
Hence,
    $f(\alpha )=\|r_{k+1}\|^{2}=(r_{k},r_{k})-2\alpha (Ar_{k},r_{k})+\alpha ^{2}(Ar_{k},Ar_{k})\!\,$
Next we want to minimize $f(\alpha )\!\,$ as a function of $\alpha \!\,$. Taking its derivative with respect to $\alpha \!\,$ yields,
    $f^{\prime }(\alpha )=-2(Ar_{k},r_{k})+2\alpha (Ar_{k},Ar_{k})\!\,$
Setting $f^{\prime }(\alpha )=0$ and solving for $\alpha \!\,$ gives
${\begin{aligned}0&=-2(Ar_{k},r_{k})+2\alpha (Ar_{k},Ar_{k})\\0&=-(Ar_{k},r_{k})+\alpha (Ar_{k},Ar_{k})\\(Ar_{k},r_{k})&=\alpha (Ar_{k},Ar_{k})\\\alpha &={\frac {(Ar_{k},r_{k})}{(Ar_{k},Ar_{k})}}\end{aligned}}$
Substituting for $\alpha \!\,$ into $\|r_{k+1}\|^{2}\!\,$ gives,
${\begin{aligned}\|r_{k+1}\|^{2}&=(r_{k},r_{k})-2\alpha (Ar_{k},r_{k})+\alpha ^{2}(Ar_{k},Ar_{k})\\&=(r_{k},r_{k})-2{\frac {(Ar_{k},r_{k})}{(Ar_{k},Ar_{k})}}(Ar_{k},r_{k})+{\frac {(Ar_{k},r_{k})^{2}}{(Ar_{k},Ar_{k})^{2}}}(Ar_{k},Ar_{k})\\&=(r_{k},r_{k})-2{\frac {(Ar_{k},r_{k})^{2}}{(Ar_{k},Ar_{k})}}+{\frac {(Ar_{k},r_{k})^{2}}{(Ar_{k},Ar_{k})}}\\&=(r_{k},r_{k})-{\frac {(Ar_{k},r_{k})^{2}}{(Ar_{k},Ar_{k})}}\end{aligned}}$
By definition of norm,
    $\|r_{k}\|^{2}=(r_{k},r_{k})\!\,$
Hence
    ${\frac {\|r_{k+1}\|^{2}}{\|r_{k}\|^{2}}}=1-{\frac {(Ar_{k},r_{k})^{2}}{(r_{k},r_{k})(Ar_{k},Ar_{k})}}\!\,$
Multiplying and dividing the second term on the right hand side of the above equation by $(r_{k},r_{k})\!\,$ and applying a property of inner product yields,
    ${\frac {\|r_{k+1}\|^{2}}{\|r_{k}\|^{2}}}=1-{\frac {(Ar_{k},r_{k})^{2}(r_{k},r_{k})}{(r_{k},r_{k})^{2}(r_{k},A^{T}Ar_{k})}}\!\,$
From the result of part (b), we have our desired result:
    ${\frac {\|r_{k+1}\|_{2}}{\|r_{k}\|_{2}}}\leq \left(1-{\frac {\lambda _{\min }(M)^{2}}{\lambda _{\max }(A^{T}A)}}\right)^{\frac {1}{2}}\!\,$