% Stand 03.04.2000, Matthias Bollhoefer
% Modified by Marine Froidevaux on 10.8.2019
% new LaTeX 2e
\documentclass[12pt,a4paper]{report}
\usepackage{latexsym,amssymb,german,a4wide,verbatim,xr}
\usepackage{fancyhdr} 
%\usepackage{pgffor}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{verbatim}
\usepackage{mathtools}

% use labels from a different document
%\usepackage{xr}
% optional \externaldocument[blablbla]{...} to avoid multiple labels \ref{blablablaLABEL}
% is used to get the correct references from the external document
%\externaldocument{../vorles/vorles}

% include graphical environment
%\usepackage{graphics}

% include self defined matrix symbols
%\usepackage{matrix}

%\newcommand*{\pathToExercises}{../../Material_NumerikI_Matthias}
% use selfdefined commands
%\input{\pathToExercises/vorles/meinstil.def}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Layout
%\addtolength{\topmargin}{-15ex}
%\addtolength{\textheight}{20ex}
\pagestyle{fancy}
\setlength{\headheight}{28pt}
\lhead{Technische Universität Berlin\\Numerische Mathematik I - WS 2019/2020}
\rhead{Prof.~V.~Mehrmann\\M.~Froidevaux}
\cfoot{}
\fancypagestyle{AbgabeDatum}{\fancyfoot[C]{Diese Aufgaben müßen spätestens am 24.10.19 in der Vorlesung abgegeben werden.}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\CurrentWeekNb}{3}
\newcounter{taskNb}
\stepcounter{taskNb}

\begin{document}
%\thispagestyle{AbgabeDatum}
\begin{center}
%{\LARGE Numerische Mathematik}\\[1.5ex]
%%{\large \CurrentWeekNb. \"Ubungsblatt}\\ 
{\Large Exercise sheet for the \CurrentWeekNb. tutorial}\\ 
{Week 4.11.-8.11.19}\\
%\\{Diese Aufgaben müßen spätestens am 24.10.19 in der Vorlesung abgegeben werden.}
%{Abgabe:} Spätestens am 24.10.19 in der Vorlesung\\[0.5cm]
\end{center}
%\hfill {Abgabe: Spätestens am 24.10.19 in der Vorlesung}\\[0.5cm]
%
%%\def\exerciseList{001, 002, 003}
%\begin{enumerate}
%


\begin{enumerate}
%
\item Consider the machine numbers $\mathbb{M}(2,4,2)$. What are in this case \texttt{eps}, \texttt{xmin} and \texttt{xmax}?

\emph{Bonus question:} what are the general formulae for $\mathbb{M}(p,m,e)$?
%
\item The machine operation $\oplus$ can be put in relation with the usual addition through
\[x\oplus y= (x+y)(1 +\varepsilon) \]
Here $\varepsilon$ indicates the relative rounding error.
Commercially available processors ensure that this relative rounding error $\varepsilon$ is bounded independently of $x$ and $y$.
There is then an $\varepsilon^*>0$ such that the bound $|\varepsilon|\leq\varepsilon^*$ is always satisfied.
We now want to sum $n$ numbers. Consider for that machine numbers $x_1,\ldots,x_n$ and let
\[\tilde{s}_1=x_1, \quad \tilde{s}_n= \tilde{s}_{n-1}\oplus x_n\]
define an algorithm for the calculation of the sum $s_n=\sum^n_{i=1} x_i$.
In this exercise we want to bound the error exactly.
For that reason, $\varepsilon^2$ should not be truncated, and the $\mathcal{O}$-notation should be avoided.
\begin{enumerate}
\item Calculate the absolute error $e_n\coloneqq\tilde{s}_n-s_n$ for $n=1,\ldots,4$.
\item Show that the absolute error satisfies
\[|e_n|\leq [(1+\varepsilon^*)^n-1]\sum_{i=1}^n |x_i|.\] 
Discuss the relative error of $\tilde{s}_n$.
\emph{Hint:} induction.
\item In this task we want to show that the computed solution is the same as the exact solution of the same problem with slightly perturbed input data $x_i(1+\delta_i)$. Show that
\[
\tilde{s}_n=\sum^n_{i=1} x_i(1+\delta_i) \quad \text{ with } \quad (1-\varepsilon^*)^n-1\leq \delta_i\leq(1 +\varepsilon^*)^n-1
\] 
and that if $n\varepsilon^*<1$, then the bound
\[
|\delta_i|\leq \frac{n\varepsilon^*}{1-n\varepsilon^*}, \quad  i= 1,\ldots,n
\]
holds.
\emph{Hint:} induction.
\end{enumerate}
%\begin{enumerate}
%\item ..
%\item ..
%\end{enumerate}
%\item .
%\begin{enumerate}
%\item ..
%\item ..
%\item ..
%\end{enumerate}
\end{enumerate}
\end{document}


