mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
43 lines
1.1 KiB
TeX
43 lines
1.1 KiB
TeX
\section*{Aufgabe 2}
|
|
\subsection*{Teilaufgabe a)}
|
|
Formel: $y_i = \frac{b_i - \sum_{j=1}^{i-1} y_j \cdot l_{ij}}{l_{ii}} $
|
|
|
|
Anmerkung: $l_{ii}$ kann nicht $0$ sein, da L dann nicht mehr invertierbar wäre.
|
|
|
|
Algorithmus:
|
|
|
|
\begin{algorithm}[H]
|
|
\begin{algorithmic}
|
|
\For{$i=1$ to $i=n$}
|
|
\State $sum \gets 0$
|
|
\For{$j = 1$ to $j = i-1$}
|
|
\State $sum \gets sum + y_i \cdot l_{ij}$
|
|
\EndFor
|
|
\State $y_i \gets \frac{b_i - sum}{l_{ii}}$
|
|
\EndFor
|
|
\end{algorithmic}
|
|
\caption{TODO}
|
|
\end{algorithm}
|
|
|
|
\subsubsection*{(b)}
|
|
\begin{algorithm}[H]
|
|
\begin{algorithmic}
|
|
\Require Matrix $A$, Vektor $b$
|
|
\Procedure{LoeseLGS}{$A$, $b$}
|
|
\State $P, L, R \gets \Call{LRZer}{A}$
|
|
\State $b^* \gets P \cdot b$
|
|
\State $c \gets \Call{VorSub}{L, b^*}$
|
|
\State $x \gets \Call{RueckSub}{R, c}$
|
|
\State \Return $x$
|
|
\EndProcedure
|
|
\end{algorithmic}
|
|
\caption{Löse ein LGS $Ax = b$}
|
|
\end{algorithm}
|
|
|
|
\subsection*{Teilaufgabe c)}
|
|
Aufwand:
|
|
\begin{itemize}
|
|
\item Vorwärts-/Rückwärtssubstitution: jeweils $\frac{1}{2} \cdot n^2$
|
|
\item LR-Zerlegung: $\frac{1}{3}n^3$
|
|
\item gesamt: $\frac{1}{3}n^3+n^2$
|
|
\end{itemize}
|