\documentclass{article}

\input{~/projects/latex/dist/full.tex}

\usepackage{lmodern}
\usepackage{pgfplots}
\setFontType{sans}

\renewcommand{\authorTitle}{Robin Bacher, Janis Hutz\\\url{https://github.com/janishutz/eth-summaries}}
\renewcommand{\authorHeaders}{Robin Bacher, Janis Hutz}
\setLang{de}

\setup{Numerical Methods for Computer Science}
\newcommand{\innumpy}{\fhlc{Cyan}{In \texttt{numpy}}\smallhspace}

\begin{document}
\startDocument
\usetcolorboxes
\setNumberingStyle{3}
\setSubsectionNumbering{1}

%          ╭────────────────────────────────────────────────╮
%          │                   Title page                   │
%          ╰────────────────────────────────────────────────╯
\vspace{2cm}
\begin{center}
    \begin{tikzpicture}
        \begin{axis}[
                legend pos=outer north east,
                axis lines = box,
                xlabel = size $n$,
                ylabel = Time ($s$),
                variable = t,
                trig format plots = rad,
            ]
            \addplot [
                domain=1:10,
                samples=100,
                color=blue,
            ]
            {x^2};
            \addlegendentry{$t = n^2$}
            \addplot [
                domain=1:10,
                samples=100,
                color=green,
            ]
            {5 * x};
            \addlegendentry{$t = 5n$}
            \addplot [
                domain=1:10,
                samples=100,
                color=red,
            ]
            {2^x};
            \addlegendentry{$t = 2^n$}
        \end{axis}
    \end{tikzpicture}
\end{center}



\vspace{3cm}
\begin{center}
    \begin{Large}
        \quote{Wenn ich keine Lust habe, das zu berechnen, dann wende ich einfach Gewalt an}
    \end{Large}

    \hspace{3cm} - Prof. Dr. Vasile Gradinaru, 2025
\end{center}

\vspace{2cm}
\begin{center}
    HS2025, ETHZ\\[0.2cm]
    \begin{Large}
        Summary of the Script and Lectures
    \end{Large}\\[0.2cm]
\end{center}


% ────────────────────────────────────────────────────────────────────

%          ╭────────────────────────────────────────────────╮
%          │               Table of Contents                │
%          ╰────────────────────────────────────────────────╯
\newpage
\printtoc{ForestGreen}


% ────────────────────────────────────────────────────────────────────

%          ╭────────────────────────────────────────────────╮
%          │                  Introduction                  │
%          ╰────────────────────────────────────────────────╯
\newpage
\setcounter{section}{-1}
\section{Introduction}
This summary is intended to give you a broad overview of the topics relevant for the exam.
While it aims to serve as a full on replacement for the script, please do not fully rely on it, as there may be mistakes, inaccuracies and missing details as compared to the script.
Furthermore, you will only have access to the script during the exam, so getting familiar with the script is a good idea.
We have decided to write it in German, as is the new script and for some of the topics that are poorly explained in the script, we have added further explanations.

The numbering should match the script's numbering exactly (apart from the cases where two definitions were combined due to being closely related and short),
making it easier for you to look up the relevant definitions, theorems, etc in context in the script.

Many of the figures in this summary were taken directly from the Script or Lecture notes created by Professor Vasile Gradinaru.

We have also taken some explanations and code examples from the slides of our TA, Nils Müller, whose slides can be found
\hlhref{https://n.ethz.ch/~muellerni/courses/numcs25.php}{here}. (Link will be updated if we are to get a new website link from him, as n.ethz.ch is down now)
% TODO: Update this when n.ethz is taken offline completely

A few things to be familiar with for the exam to be quicker at solving exercises:
\begin{itemize}
    \item The script. You do not have to know basically anything by heart, so knowing where to find things in the script quickly (and knowing quirks of naming in the script)
          will make you much quicker. When searching, always use as short of a keyword as possible while not having hundreds of results.
    \item Be aware that some things might not be called the same way they are in the script in the exercises.
          If you don't find it immediately, go to the appropriate section in the script (using the index in the PDF reader (that is likely PDF.js, Firefox's PDF reader))
          and manually search for it there.
    \item Get familiar with the concepts that \texttt{NumPy} uses (i.e. how to do slicing, etc). See section \ref{sec:python} for an overview over some of the concepts.
    \item Learn the basics of \texttt{Sympy}, as that will spare you having to do integrals. See section \ref{sec:sympy} for an introduction to \texttt{Sympy}.
\end{itemize}

\fhlc{Cyan}{Code Examples}

We tried to add short and easily understandable code examples wherever possible.\\
Complete code (with many visualisations), also for topics not covered in this summary, can be found \hlhref{https://github.com/RobinB27/numcs25}{here}.

% ────────────────────────────────────────────────────────────────────

%          ╭────────────────────────────────────────────────╮
%          │                  Main content                  │
%          ╰────────────────────────────────────────────────╯

% ── Introduction ────────────────────────────────────────────────────
\newsection
\section{Einführung}
\input{parts/00_introduction/00_rounding-errors.tex}
\input{parts/00_introduction/01_time-complexity.tex}
\input{parts/00_introduction/02_matrix-multiplication.tex}

% ── polynomial interpolation ────────────────────────────────────────
\newsection
\section{Polynominterpolation}
\input{parts/01_interpolation/00_polynomial/00_intro.tex}
\input{parts/01_interpolation/00_polynomial/01_monome.tex}
\input{parts/01_interpolation/00_polynomial/02_newton-basis.tex}
\input{parts/01_interpolation/00_polynomial/03_lagrange-and-barzycentric-formula.tex}
\input{parts/01_interpolation/00_polynomial/04_chebyshev-interpolation.tex}

% ── trigonometric interpolation ─────────────────────────────────────
\newsection
\section{Trigonometrische Interpolation}
\input{parts/01_interpolation/01_trigonometric/00_fourier.tex}
\input{parts/01_interpolation/01_trigonometric/01_dft/00_intro.tex}
\input{parts/01_interpolation/01_trigonometric/01_dft/01_construction.tex}
\input{parts/01_interpolation/01_trigonometric/01_dft/02_fftshift.tex}
\input{parts/01_interpolation/01_trigonometric/01_dft/03_linalg.tex}
\input{parts/01_interpolation/01_trigonometric/02_fft.tex}
\input{parts/01_interpolation/01_trigonometric/03_interpolation/00_intro.tex}
\input{parts/01_interpolation/01_trigonometric/03_interpolation/01_zero-padding.tex}
\input{parts/01_interpolation/01_trigonometric/04_error-estimation.tex}
\input{parts/01_interpolation/01_trigonometric/05_dft-chebyshev.tex}

% ── piece-wise interpolation ────────────────────────────────────────
\newsection
\section{Stückweise Polynomiale Interpolation}
\input{parts/01_interpolation/02_piece-wise/00_intro.tex}
\input{parts/01_interpolation/02_piece-wise/01_hermite-interpolation.tex}
\input{parts/01_interpolation/02_piece-wise/02_splines.tex}


% ── quadrature ──────────────────────────────────────────────────────
\newsection
\section{Numerische Quadratur}
\input{parts/02_quadrature/00_introduction.tex}
\input{parts/02_quadrature/01_equidistant-nodes/00_intro.tex}
\input{parts/02_quadrature/01_equidistant-nodes/01_summed.tex}
\input{parts/02_quadrature/01_equidistant-nodes/02_romberg-scheme.tex}
\input{parts/02_quadrature/02_non-equidistant/00_gauss.tex}
\input{parts/02_quadrature/02_non-equidistant/01_clenshaw-curtis.tex}
\input{parts/02_quadrature/03_adaptive.tex}
\input{parts/02_quadrature/04_in-rd.tex}
\input{parts/02_quadrature/05_monte-carlo.tex}
\input{parts/02_quadrature/06_reduction-of-variance.tex}


% ── zeros ───────────────────────────────────────────────────────────
\newsection
\section{Nullstellensuche}
\input{parts/03_zeros/00_intro.tex}
\input{parts/03_zeros/01_termination-criteria.tex}
\input{parts/03_zeros/02_fix-point-iteration.tex}
\input{parts/03_zeros/03_bisection-method.tex}
\input{parts/03_zeros/04_newton-one-d.tex}
\input{parts/03_zeros/05_sectant-method.tex}
\input{parts/03_zeros/06_newton-nd.tex}
\input{parts/03_zeros/07_damped-newton.tex}
\input{parts/03_zeros/08_quasi-newton.tex}

\newsection
\section{Intermezzo: Lineare Algebra}
\input{parts/04_linalg/00_intro.tex}
\input{parts/04_linalg/01_LU.tex}
\input{parts/04_linalg/02_qr.tex}
\input{parts/04_linalg/03_svd.tex}

\newsection
\section{Ausgleichsrechnung}
\input{parts/05_curve-fitting/00_intro.tex}
\input{parts/05_curve-fitting/01_linear/00_intro.tex}
\input{parts/05_curve-fitting/01_linear/01_normal-equations.tex}
\input{parts/05_curve-fitting/01_linear/02_orthogonal-transforms.tex}
\input{parts/05_curve-fitting/01_linear/03_total-curve-fitting.tex}
\input{parts/05_curve-fitting/02_non-linear/00_intro.tex}
\input{parts/05_curve-fitting/02_non-linear/01_newton-method-in-rn.tex}
\input{parts/05_curve-fitting/02_non-linear/02_gauss-newton.tex}
\input{parts/05_curve-fitting/02_non-linear/03_further-methods.tex}

\newsection
\section{Introduction to Python}
\label{sec:python}
\input{parts/06_python/00_intro.tex}
\input{parts/06_python/01_numpy.tex}
\input{parts/06_python/02_scipy.tex}
\input{parts/06_python/03_sympy.tex}

\newsection
\section{Notes on the exam}
\input{parts/07_exam/00_intro.tex}

\end{document}
