Aufgabe1.tex 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. \section*{Aufgabe 1}
  2. \subsection*{Teilaufgabe a)}
  3. \textbf{Gegeben:}
  4. \[A := \begin{pmatrix}
  5. 4 & 2 & 8\\
  6. 2 & 5 & 8\\
  7. 8 & 8 & 29
  8. \end{pmatrix}\]
  9. \textbf{Aufgabe:} Cholesky-Zerlegung $A = L \cdot L^T$ berechnen
  10. \textbf{Rechenweg:}
  11. \begin{algorithm}[H]
  12. \begin{algorithmic}
  13. \Function{Cholesky}{$A \in \mathbb{R}^{n \times n}$}
  14. \State $L = \Set{0} \in \mathbb{R}^{n \times n}$ \Comment{Initialisiere $L$}
  15. \For{($k=1$; $\;k \leq n$; $\;k$++)}
  16. \State $L_{k,k} = \sqrt{A_{k,k} - \sum_{i=1}^{k-1} L_{k,i}^2}$
  17. \For{($i=k+1$; $\;i \leq n$; $\;i$++)}
  18. \State $L_{i,k} = \frac{A_{i,k} - \sum_{j=1}^{k-1} L_{i,j} \cdot L_{k,j}}{L_{k,k}}$
  19. \EndFor
  20. \EndFor
  21. \State \Return $L$
  22. \EndFunction
  23. \end{algorithmic}
  24. \caption{Cholesky-Zerlegung}
  25. \label{alg:seq1}
  26. \end{algorithm}
  27. \textbf{Lösung:}
  28. $
  29. L =
  30. \begin{pmatrix}
  31. 2 & 0 & 0 \\
  32. 1 & 2 & 0 \\
  33. 4 & 2 & 3 \\
  34. \end{pmatrix}
  35. $
  36. \subsection*{Teilaufgabe b)}
  37. \textbf{Gesucht}: $\det(A)$
  38. Sei $P \cdot A = L \cdot R$, die gewohnte LR-Zerlegung.
  39. Dann gilt:
  40. \[\det(A) = \frac{\det(L) \cdot \det(R)}{\det(P)}\]
  41. $\det(L) = 1$, da alle Diagonalelemente 1 sind und es sich um eine strikte untere Dreiecksmatrix handelt.
  42. $\det(R) = r_{11} \cdot \ldots \cdot r_{nn}$, da es sich um eine obere Dreiecksmatrix handelt.
  43. $\det(P) \in \Set{1, -1}$
  44. Das Verfahren ist also:
  45. \begin{algorithm}[H]
  46. \begin{algorithmic}
  47. \Require $A \in \mathbb{R}^{n \times n}$
  48. \State $P, L, R \gets \Call{LRZerl}{A}$
  49. \State $x \gets 1$
  50. \For{$i$ in $1..n$}
  51. \State $x \gets x \cdot r_{ii}$
  52. \State $x \gets x \cdot p_{ii}$
  53. \EndFor
  54. \end{algorithmic}
  55. \caption{Determinante berechnen}
  56. \label{alg:seq1}
  57. \end{algorithm}
  58. Alternativ kann man auch in einer angepassten LR-Zerlegung direkt die
  59. Anzahl an Zeilenvertauschungen zählen. Dann benötigt man $P$ nicht mehr.
  60. Ist die Anzahl der Zeilenvertauschungen ungerade, muss das Produkt
  61. der $r_ii$ negiert werden.