\documentclass[12pt, letterpaper]{article}

\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{setspace}

\title{Homework 6}
\author{Menyoung Lee}
\geometry{margin=1in}
%\doublespacing

\begin{document}
\maketitle

\subsection*{2.4 P7}
\[ \begin{pmatrix}
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
1 & 0 & 0 & 0
\end{pmatrix}
\begin{pmatrix}
1 & 2 & 3 & 4 \\
3 & 4 & 5 & 6 \\
5 & 6 & 7 & 8 \\
7 & 8 & 9 & 0
\end{pmatrix}
=
\begin{pmatrix}
5 & 6 & 7 & 8 \\
3 & 4 & 5 & 6 \\
7 & 8 & 9 & 0 \\
1 & 2 & 3 & 4
\end{pmatrix} \]

\subsection*{2.4 P8}
\[ \begin{pmatrix}
1 & 0 & 0 \\
0 & 0 & 1 \\
0 & 1 & 0
\end{pmatrix}
\begin{pmatrix}
10 & 20 & 1 \\
1 & 1.99 & 6 \\
0 & 50 & 1
\end{pmatrix}
=
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0.1 & -0.0002 & 1
\end{pmatrix}
\begin{pmatrix}
10 & 20 & 1 \\
1 & 50 & 1 \\
0 & 0 & 5.9002
\end{pmatrix} \]
0.1 is the largest needed multiplier.

\subsection*{2.5 CP1}
\[ \begin{pmatrix}
3 & -1 & & & \\
-1 & 3 & -1 & & \\
 & \ddots & \ddots & \ddots & \\
 & & -1 & 3 & 1 \\
 & & & -1 & 3
\end{pmatrix}
\begin{pmatrix}
x_1 \\ \\ \vdots \\ \\ x_n
\end{pmatrix}
=
\begin{pmatrix}
2 \\ 1 \\ \vdots \\ 1 \\ 2
\end{pmatrix} \]
\begin{verbatim}
>> norm(jacobi(A, b, 25)-1,inf)

ans =

     1.446714834152374e-06

>> norm(jacobi(A, b, 26)-1,inf)

ans =

     9.498632749238567e-07
\end{verbatim}

It required 26 iterations to gain 6 digits of precision, and the backward error was $9.50\times 10^{-7}$.

\end{document}


