2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00

merged Martins branch with mine

K2A2 did not have my solution. i added it again.
mergeconflict with the pdf files for K2 and K3. just compiled them again
with the new tasks tex files.
This commit is contained in:
NeevoLima 2013-09-20 10:09:17 +02:00
commit 2b59bb24b6
15 changed files with 396 additions and 25 deletions

View file

@ -1,6 +1,35 @@
\section*{Aufgabe 1}
\subsection*{Teilaufgabe a)}
\textbf{Gegeben:}
\[A := \begin{pmatrix}
4 & 2 & 8\\
2 & 5 & 8\\
8 & 8 & 29
\end{pmatrix}\]
\textbf{Aufgabe:} Cholesky-Zerlegung $A = L \cdot L^T$ berechnen
\textbf{Rechenweg:}
\begin{algorithm}[H]
\begin{algorithmic}
\Function{Cholesky}{$A \in \mathbb{R}^{n \times n}$}
\State $L = \Set{0} \in \mathbb{R}^{n \times n}$ \Comment{Initialisiere $L$}
\For{($k=1$; $\;k \leq n$; $\;k$++)}
\State $L_{k,k} = \sqrt{A_{k,k} - \sum_{i=1}^{k-1} L_{k,i}^2}$
\For{($i=k+1$; $\;i \leq n$; $\;i$++)}
\State $L_{i,k} = \frac{A_{i,k} - \sum_{j=1}^{k-1} L_{i,j} \cdot L_{k,j}}{L_{k,k}}$
\EndFor
\EndFor
\State \Return $L$
\EndFunction
\end{algorithmic}
\caption{Cholesky-Zerlegung}
\label{alg:seq1}
\end{algorithm}
\textbf{Lösung:}
$
L =
\begin{pmatrix}
@ -14,22 +43,36 @@ $
\subsection*{Teilaufgabe b)}
\textbf{Gesucht}: $\det(A)$
Sei $P \cdot L = L \cdot R$, die gewohnte LR-Zerlegung.
Sei $P \cdot A = L \cdot R$, die gewohnte LR-Zerlegung.
Dann gilt:
\[\det(A) = \det(L) \cdot \det(R) / \det(P)\]
\[\det(A) = \frac{\det(L) \cdot \det(R)}{\det(P)}\]
$\det(L) = 1$, da alle Diagonalelemente 1 sind und es sich um eine untere Dreiecksmatrix handelt.
$\det(L) = 1$, da alle Diagonalelemente 1 sind und es sich um eine strikte untere Dreiecksmatrix handelt.
$\det(R) = r_{11} \cdot \ldots \cdot r_{nn} $ da es sich um eine obere Dreiecksmatrix handelt.
$\det(R) = r_{11} \cdot \ldots \cdot r_{nn}$, da es sich um eine obere Dreiecksmatrix handelt.
$\det(P) = 1$ oder $-1$
$\det(P) \in \Set{1, -1}$
Das Verfahren ist also:
\begin{enumerate}
\item Berechne Restmatrix R mit dem Gaußverfahren.
\item \label{manker} Multipliziere die Diagonalelemente von R
\item falls die Anzahl an Zeilenvertauschungen ungerade ist negiere das Produkt aus \ref{manker} (eine Zeilenvertauschung verändert lediglich das Vorzeichen und P ist durch Zeilenvertauschungen aus der Einheitsmatrix hervorgegangen)
\end{enumerate}
\begin{algorithm}[H]
\begin{algorithmic}
\Require $A \in \mathbb{R}^{n \times n}$
\State $P, L, R \gets \Call{LRZerl}{A}$
\State $x \gets 1$
\For{$i$ in $1..n$}
\State $x \gets x \cdot r_{ii}$
\State $x \gets x \cdot p_{ii}$
\EndFor
\end{algorithmic}
\caption{Determinante berechnen}
\label{alg:seq1}
\end{algorithm}
Alternativ kann man auch in einer angepassten LR-Zerlegung direkt die
Anzahl an Zeilenvertauschungen zählen. Dann benötigt man $P$ nicht mehr.
Ist die Anzahl der Zeilenvertauschungen ungerade, muss das Produkt
der $r_ii$ negiert werden.

View file

@ -1,5 +1,75 @@
\section*{Aufgabe 2}
\subsection*{Teilaufgabe a)}
\subsection*{Lösungsalternative 1:}
\textbf{Voraussetzung:}
Gegeben sei eine Funktion $F$:
\begin{align*}
F: \mathbb{R} &\rightarrow [-1, 1]\\
F(x) &:= \cos(x)
\end{align*}
sowie eine Folge $(x)_k$ mit $x_{k+1} := F(x_k)$.
\textbf{Behauptung:} $\displaystyle \exists! x^*: \forall x \in \mathbb{R}: \lim_{k \rightarrow \infty} x_k = x^*$
\paragraph{Beweis:} über den Banachschen Fixpunktsatz.
Teil 1: Es gibt genau einen Fixpunkt und dieser ist in $(0,1)$
\begin{proof}
Sei $ x \in \mathbb{R}$, so gilt:
\begin{align*}
-1 \leq \cos(x) \leq 1
\end{align*}
Also genügt es $x \in [-1, 1]$ zu betrachten.
Sei nun $x \in [-1, 0)$. Dann gilt: $\cos(x) > 0$. Da $x <0$ aber $F(x) > 0$,
kann kein Fixpunkt in $[-1, 0)$ sein. Es genügt also sogar,
nur $[0, 1]$ zu betrachten.
Offensichtlich ist $F(0) \neq 0$ und $F(1) \neq 1$, also ist der
Fixpunkt - falls vorhanden - in $(0,1)$. $F$ ist in $(0,1)$ stetig
und streng monoton fallend. Da auch $-x$ in $(0,1)$ streng monoton
fallend ist, folgt, dass $\cos(x) - x$ in $(0,1)$ streng monoton
fallend ist.
$x=0 \Rightarrow \cos(x) - x = \cos(0) - 0 = 1$
$x=45^\circ = \frac{1}{4} \pi < 1 \Rightarrow \cos(45^\circ) - \frac{\pi}{4} = \frac{\sqrt{2}}{2} - \frac{\pi}{4} <0$, da
\begin{align}
8 &< 9 < \pi^2\\
\Rightarrow \sqrt{8} &< \pi\\
\Leftrightarrow 2 \sqrt{2} &< \pi\\
\Leftrightarrow \frac{\sqrt{2}}{2} &< \frac{\pi}{4}
\end{align}
$\stackrel{\text{Zwischenwertsatz}}{\Rightarrow} \exists x^*: \cos(x^*) - x^* = 0 \Leftrightarrow \exists x^*: \cos(x^*) = x^*$.
Dieses $x^*$ ist eindeutig, da $\cos(x)-x$ \emph{streng} monoton fallend ist.
\end{proof}
Teil 2: Jeder Startwert $x \in \mathbb{R}$ konvergiert gegen $x^*$.
\begin{proof}
Er genügt zu zeigen, dass $F$ auf $[0,1]$ eine Kontraktion ist, da
bereits in Teil 1 gezeigt wurde, dass man bereits $x_2 = \cos(\cos(x)) \in (0,1)$ ist.
Sei $0 \leq x < y \leq 1$. Dann folgt:
\begin{align}
\stackrel{\text{Mittelwertsatz}}{\Rightarrow} \exists L \in (x,y): \frac{\cos(y) - \cos(x)}{y-x} &= f'(L)\\
\Rightarrow \exists L \in [0,1]: \| \cos y - \cos x \| &= \| - \sin(L) \cdot (y-x)\| \\
&= \underbrace{\sin(L)}_{[0,1)} (y-x)\\
\Rightarrow F \text{ ist Kontraktion auf [0,1]}
\end{align}
Da $F|_{[0,1]}$ eine Selbstabbildung und eine Kontraktion ist und
offensichtlich $[0,1]$ abgeschlossen ist, greift der
Banachsche Fixpunktsatz. Es folgt direkt, dass auch für alle $x \in [0,1]$
die Folge $(x)_k$ gegen den einzigen Fixpunkt $x^*$ konvergiert.
\end{proof}
\subsection*{Lösungsalternative 2:}
\textbf{Behauptung:} Für $x \in \mathbb{R}$ gilt, dass $cos(x_k) = x_{k+1}$ gegen den einzigen Fixpunkt $x^{*} = cos(x^{*})$ konvergiert.
@ -27,4 +97,4 @@ Damit ist gezeigt, dass $cos(x) : D \rightarrow D$ Kontraktion auf $D$.
Damit sind alle Voraussetzung des Banachschen Fixpunktsatzes erfüllt.
Nach dem Banachschen Fixpunktsatz folgt die Aussage.
Nach dem Banachschen Fixpunktsatz folgt die Aussage.

View file

@ -1,17 +1,36 @@
\section*{Aufgabe 3}
\textbf{Gegeben:}
\begin{table}[h!]
\begin{tabular}{l||l|l|l|l}
$f_i$ & 7 & 1 & -1 & 7 \\\hline
$x_i$ & -1 & 0 & 1 & 2 \\
\end{tabular}
\end{table}
\subsection*{Teilaufgabe a)}
Allgemein lauten Lagrange-Polynome:
\[L_i = \frac{\overbrace{\prod_{j=0, j \neq i}^n (x-x_j)}^\text{Produkt der Nullstellen}}{\underbrace{\prod_{j=0, j \neq i}^n (x_i - x_j)}_\text{Normalisierungsfaktor}}\]
Im speziellen:
\begin{align}
L_0(x) &= - \frac{1}{6} \cdot (x^3 - 3 x^2 + 2x)\\
L_1(x) &= \frac{1}{2} \cdot (x^3 - 2x^2 - x + 2)\\
L_2(x) &= - \frac{1}{2} \cdot (x^3 - x^2 - 2x)\\
L_3(x) &= \frac{1}{6} \cdot (x^3 - x)
L_0(x) &= \frac{(x-0)(x-1)(x-2)}{(-1-0)(-1-1)(-1-2)} &&=-\frac{1}{6} \cdot (x^3 - 3 x^2 + 2x)\\
L_1(x) &= \frac{(x+1)(x-1)(x-2)}{(0+1)(0-1)(0-2)} &&= \frac{1}{2} \cdot (x^3 - 2x^2 - x + 2)\\
L_2(x) &= \frac{(x+1)x(x-2)}{(1+1)(1-0)(1-2)} &&=-\frac{1}{2} \cdot (x^3 - x^2 - 2x)\\
L_3(x) &= \frac{(x+1)(x-0)(x-1)}{(2+1)(2-0)(2-1)} &&= \frac{1}{6} \cdot (x^3 - x)
\end{align}
Damit ergibt sich:
Durch die Interpolationsformel von Lagrange
\[p(x) = \sum_{i=0}^n f_i L_i(x)\]
ergibt sich
\begin{align}
p(x) &= x^3 + 2x^2 - 5x + 1
\end{align}
Anmerkung: Es ist in der Klausur allerdings nicht notwendig die Monomdarstellung zu berechnen außer es wird explizit verlangt. (Das spart viel Zeit) % Anmerkung hinzugefügt von Felix Benz-Baldas
Anmerkung: Es ist nicht notwendig die Monomdarstellung zu berechnen.
In diesem Fall hat es jedoch das Endergebnis stark vereinfacht.
\subsection*{Teilaufgabe b)}
Zunächst die dividierten Differenzen berechnen:

View file

@ -17,6 +17,7 @@
\usepackage{algorithm,algpseudocode}
\usepackage{parskip}
\usepackage{lastpage}
\usepackage{amsthm}
\allowdisplaybreaks
\newcommand{\cmark}{\ding{51}}%
@ -26,7 +27,7 @@
\makeatletter
\AtBeginDocument{
\hypersetup{
pdfauthor = {Felix Benz-Baldas, Martin Thoma, Peter},
pdfauthor = {Felix Benz-Baldas, Martin Thoma, Peter Merkert},
pdfkeywords = {Numerik, KIT, Klausur},
pdftitle = {\@title}
}
@ -39,6 +40,23 @@
\usepackage{fancyhdr}
\fancyfoot[C]{}
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax
\list{}{\leftmargin=4em
\rightmargin=\leftmargin
\settowidth{\itemindent}{\itshape#1}%
\labelwidth=\itemindent}
\item[\hskip\labelsep
\itshape
#1\@addpunct{.}]\ignorespaces
}{%
\popQED\endlist\@endpefalse
}
\makeatother
\begin{document}
\include{Aufgabe1}
\include{Aufgabe2}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB