\documentclass[11pt]{article}
\usepackage{calc}
\usepackage{url}
\usepackage[margin=1.2in]{geometry}
\usepackage{setspace}
\usepackage{lmodern}
\usepackage{amsmath,amsthm,amssymb,fancybox,ifthen,float}
\usepackage{bm}
\usepackage{color}
\usepackage{parskip}
\usepackage{comment}
\usepackage{isomath}
\usepackage{lastpage}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{\small \bfseries \sffamily Spring 2020 MA-UY 4424}
\fancyhead[C]{\small \bfseries \sffamily NYU Tandon}
\fancyhead[R]{\small \bfseries \sffamily Prof. M. O'Neil}
\fancyfoot[C]{\thepage\ of \pageref{LastPage}}
\usepackage{parskip}
%%%%\onehalfspacing
\newcommand{\matlab}{\textsc{Matlab}}
\newcommand{\vct}[1]{\bm{\mathsf{#1}}}
\newcommand{\pvct}[1]{\bm{#1}}
\newcommand{\mtx}[1]{\bm{\mathsf{#1}}}
\newcommand{\entry}[1]{{\mathsf{#1}}}
\newcommand{\mtb}[1]{\bm{\mathcal{#1}}}
\newcommand\horline{\begin{center}\line(1,0){250}\end{center}}
\begin{document}
%\noindent
\begin{center}
{\Large \bfseries \sffamily Homework 2}\\
\vspace{\baselineskip}
{\normalsize Due: Friday 1:30pm, February 28, 2020,
\textbf{\color{red} in recitation}}
\end{center}
\horline
{\small
Notes on the first (and all subsequent) assignments:
\textbf{\sffamily Submission}: Homework assignments must be submitted in the
class on the due date. If you cannot attend the class, please send
your solution per email as a single PDF before class. Please hand in
cleanly handwritten or typed (preferably with LaTeX) homework. Feel
free to use original homework LaTeX document to write-up your homework. If
you are required to hand in code or code listings, this will
explicitly be stated on that homework assignment.
\textbf{\sffamily Collaboration}: NYU’s integrity policies will be enforced. You
are encouraged to discuss the problems with other students.
However, you must write (i.e. type) every line of
code yourself and also write up your solutions independently. Copying
of any portion of someone else’s solution/code or allowing others to
copy your solution/code is considered cheating.
\textbf{\sffamily Plotting and formatting}: Plot figures carefully and think
about what you want to illustrate with a plot. Choose proper ranges
and scales (e.g. semilogx, semilogy, loglog), always label axes, and give
meaningful titles. Sometimes, using a table can be useful, but never
submit pages of numbers. Discuss what we can observe in, and learn from,
a plot. If you do print numbers, in MATLAB for example, use
\texttt{fprintf} to format the output nicely. Use \texttt{format
compact} and other format commands to control how MATLAB prints
things. When you create figures using MATLAB (or Python or Julia),
please try to export them in a vector graphics format (.eps, .pdf,
.dxf) rather than raster graphics or bitmaps (.jpg, .png, .gif,
.tif). Vector graphics-based plots avoid pixelation and thus look much
cleaner.
\textbf{\sffamily Programming}: This is an essential part of this
class. We will use MATLAB for demonstration purposes in class, but you
are free to use other languages. The TA will give an introduction to
MATLAB in the first few recitation classes. Please use meaningful
variable names, try to write clean, concise and easy-to-read code. As
detailed in the syllabus, in order to receive full credit, your code
must be thoroughly commented.
}
\horline
\normalsize
\begin{enumerate}
\item Newton's method can be extended to
\emph{matrix-functions} as well. For example, given a square matrix
$\mtx{A}$
and real number $t$,
the \emph{matrix-exponential} $e^{t\mtx{A}}$ is defined via the Taylor
series for the exponential function:
\begin{equation}
e^{t\mtx{A}} = 1 + t\mtx{A} + \frac{(t\mtx{A})^2}{2!}
+ \frac{(t\mtx{A})^3}{3!} + + \frac{(t\mtx{A})^4}{4!} + \ldots
\end{equation}
Obviously, the matrix $\mtx{A}$ must be square.
\begin{enumerate}
\item \textbf{[4pts]}
Derive Newton's method for finding the root of an arbitrary
matrix-valued function $f = f(\mtx{X})$,
where by \emph{root} we mean
that $\mtx{X}$ is a root of $f$ if
$f(\mtx{X}) = \mtx{0}$,
where~$\mtx{0}$ is the matrix of all zeros. Assume that the matrix
argument of $f$ is square and invertible.
\item \textbf{[3pts]}
The square root of a matrix $\mtx A$ is a matrix $\mtx{X}$
such that $\mtx{X}^T \mtx{X} = \mtx{A}$. For a symmetric
positive-definite matrix $\mtx{A}$, derive the Newton iteration for
finding $\mtx{X} = \sqrt{\mtx{A}}$.
\item \textbf{[3pts]}
Write a program using the Newton iteration that you derived above
to find the square root of the matrix
\begin{equation}
\mtx{A} =
\begin{pmatrix}
8 & 4 & 2 & 1\\
4 & 8 & 4 & 2\\
2 & 4 & 8 & 4\\
1 & 2 & 4 & 8\\
\end{pmatrix}.
\end{equation}
The stopping criterion for your Newton iteration should be when the absolute
difference between elements of successive iterations is at most $10^{-10}$.
Submit your code, as well as a \textit{cleanly formatted} printout
of the square root of the above matrix, displaying elements to 2
decimal places.
\end{enumerate}
\vspace{\baselineskip}
\item \textbf{[10pts]}
For a yearly interest rate $0j, \\
A_{in} &= 1, & &\text{for all } i, \\
A_{ij} &= 0, & &\text{otherwise}.
\end{aligned}
\]
For example, when $n = 5$, the matrix $\mtx{A}$ is given by
\[
\mtx{A} = \begin{pmatrix}
1 & 0 & 0 & 0 & 1 \\
-1 & 1 & 0 & 0 & 1 \\
-1 & -1 & 1 & 0 & 1 \\
-1 & -1 & -1 & 1 & 1 \\
-1 & -1 & -1 & -1 & 1 \\
\end{pmatrix}.
\]
\begin{enumerate}
\item \textbf{[3pts]} Using induction, show that $\mtx{A}$ is
invertible for all $n>0$.
\item \textbf{[2pts]} In the case where $n=5$ and $\vct{b} =
\left( 1 \, \frac{1}{4} \, \frac{1}{9} \, \frac{1}{16} \, \frac{1}{25}
\right)^T$, solve $\mtx{A} \vct{x} = \vct{b}$ using Gaussian
elimination.
\item \textbf{[2pts]} For an arbitrary $n$, find the entries
$L_{ij}$ and $U_{ij}$ of the $\mtx{LU}$-factorization of $\mtx{A}$.
What is $\max_{ij}|U_{ij}|$?
\item \textbf{[2pts]} For large values of $n$, for example $n =
2000$, what problems can you see with trying to solve $\mtx{A}
\vct{x} = \vct{b}$ on a computer using double precision floating
point arithmetic? Explain your reasoning.
\end{enumerate}
\vspace{\baselineskip}
\end{enumerate}
\end{document}