Aufgabe2.tex 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. \section*{Aufgabe 2}
  2. \subsection*{Teilaufgabe a}
  3. \textbf{Aufgabe}
  4. Formulieren Sie einen Algorithmus in Pseudocode zum Lösen des Gleichungssystems
  5. \[Ly = b,\]
  6. wobei $L$ eine invertierbare, untere Dreiecksmatrix ist.
  7. Geben Sie die Formel zur Berechnung von $y_i$ an.
  8. \textbf{Lösung:} TODO! %TODO!
  9. \begin{algorithm}[H]
  10. \begin{algorithmic}
  11. \Require $p \in \mathbb{P}, a \in \mathbb{Z}, p \geq 3$
  12. \Procedure{CalculateLegendre}{$a$, $p$}
  13. \If{$a \geq p$ or $a < 0$}\Comment{rule (III)}
  14. \State \Return $\Call{CalculateLegendre}{a \mod p, p}$ \Comment{now: $a \in [0, \dots, p-1]$}
  15. \ElsIf{$a == 0$ or $a == 1$}
  16. \State \Return $a$ \Comment{now: $a \in [2, \dots, p-1]$}
  17. \ElsIf{$a == 2$} \Comment{rule (VII)}
  18. \If{$p \equiv \pm 1 \mod 8$}
  19. \State \Return 1
  20. \Else
  21. \State \Return -1
  22. \EndIf \Comment{now: $a \in [3, \dots, p-1]$}
  23. \ElsIf{$a == p-1$} \Comment{rule (VI)}
  24. \If{$p \equiv 1 \mod 4$}
  25. \State \Return 1
  26. \Else
  27. \State \Return -1
  28. \EndIf \Comment{now: $a \in [3, \dots, p-2]$}
  29. \ElsIf{!$\Call{isPrime}{a}$} \Comment{rule (II)}
  30. \State $p_1, p_2, \dots, p_n \gets \Call{Factorize}{a}$
  31. \State \Return $\prod_{i=1}^n \Call{CalculateLegendre}{p_i, p}$
  32. \Else \Comment{now: $a \in \mathbb{P}, \sqrt{p-2} \geq a \geq 3$}
  33. \If{$\frac{p-1}{2} \equiv 0 \mod 2$ or $\frac{a-1}{2} \equiv 0 \mod 2$}
  34. \State \Return $\Call{CalculateLegendre}{p, a}$
  35. \Else
  36. \State \Return $(-1) \cdot \Call{CalculateLegendre}{p, a}$
  37. \EndIf
  38. \EndIf
  39. \EndProcedure
  40. \end{algorithmic}
  41. \caption{Calculate Legendre symbol}
  42. \label{alg:calculateLegendreSymbol}
  43. \end{algorithm}
  44. \subsection*{Teilaufgabe b}
  45. \subsection*{Teilaufgabe c}