\documentclass[12pt]{article}
\usepackage{fullpage,amsmath,amsfonts}

\newcommand{\x}{\boldsymbol{x}}
\renewcommand{\v}{\boldsymbol{v}}
\newcommand{\w}{\boldsymbol{w}}
\renewcommand{\a}{\boldsymbol{a}}
\renewcommand{\b}{\boldsymbol{b}}
\renewcommand{\c}{\boldsymbol{c}}
\newcommand{\e}{\boldsymbol{e}}
\renewcommand{\Re}{\operatorname{Re}}
\renewcommand{\Im}{\operatorname{Im}}
\newcommand{\Range}{\operatorname{Range}}
\newcommand{\Ker}{\operatorname{Ker}}
\newcommand{\Span}{\operatorname{Span}}
\renewcommand{\dim}{\operatorname{dim}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}


\begin{document}

\title{Numerical Methods I}
\author{Lab Session 4}
\date{October 9, 2003}
\maketitle

\noindent

\begin{enumerate}

\item For given $n$, e.g.\ $n=10$, construct the $n\times n$ matrix
\[
  A =
  \begin{pmatrix}
  2 & -1 & 0 & & \cdots & & 0 & -\beta \\
  -1 & 2 & \ddots & \ddots & & & & 0 \\
  0 & \ddots & \ddots \\
  & \ddots& & & & & &\vdots \\
  \vdots & &&& & & \ddots \\
  & & & && \ddots & \ddots & 0 \\
  0 & & && \ddots & \ddots & 2 & -1 \\
  -\beta & 0 & &\cdots& & 0 & -1 & 2 
  \end{pmatrix}
\]
and the vectors $\b, \c \in \R^n$ with
\begin{gather*}
  b_j = 1 \,, \\
  c_j = \sin \frac{2 \pi j}n 
\end{gather*}
where $j=1,\dots,n$.

\item Use your code from Homework~4 to solve $A\x=\b$ and $A\x=\c$ for
$\beta=1/2$ and $\beta=1$ via $LU$ decomposition.

\item Use the Gauss--Seidel iterative scheme to solve both problems.
Does the solution converge?

\item Can you explain why things go wrong when $\beta=1$?  What can
you do to get a sensible answer?

\end{enumerate}
\end{document}

