diff options
author | Andreas Müller <andreas.mueller@ost.ch> | 2021-04-15 11:13:29 +0200 |
---|---|---|
committer | Andreas Müller <andreas.mueller@ost.ch> | 2021-04-15 11:13:29 +0200 |
commit | c8a276fee03f789becc6b412d29e2358903152a2 (patch) | |
tree | dbbe998a5d72640d9cdf147471d515f4a9ba05c6 /vorlesungen/slides | |
parent | typos (diff) | |
download | SeminarMatrizen-c8a276fee03f789becc6b412d29e2358903152a2.tar.gz SeminarMatrizen-c8a276fee03f789becc6b412d29e2358903152a2.zip |
add devide and conquor slides
Diffstat (limited to 'vorlesungen/slides')
-rw-r--r-- | vorlesungen/slides/Makefile.inc | 3 | ||||
-rw-r--r-- | vorlesungen/slides/a/Makefile.inc | 12 | ||||
-rw-r--r-- | vorlesungen/slides/a/chapter.tex | 11 | ||||
-rw-r--r-- | vorlesungen/slides/a/dc/beispiel.tex | 54 | ||||
-rw-r--r-- | vorlesungen/slides/a/dc/effizient.tex | 65 | ||||
-rw-r--r-- | vorlesungen/slides/a/dc/naiv.txt | 2 | ||||
-rw-r--r-- | vorlesungen/slides/a/dc/prinzip.tex | 86 | ||||
-rw-r--r-- | vorlesungen/slides/test.tex | 41 |
8 files changed, 243 insertions, 31 deletions
diff --git a/vorlesungen/slides/Makefile.inc b/vorlesungen/slides/Makefile.inc index e2271b8..0f5fa8c 100644 --- a/vorlesungen/slides/Makefile.inc +++ b/vorlesungen/slides/Makefile.inc @@ -12,7 +12,8 @@ include ../slides/5/Makefile.inc include ../slides/7/Makefile.inc include ../slides/8/Makefile.inc include ../slides/9/Makefile.inc +include ../slides/a/Makefile.inc slides = \ $(chapter0) $(chapter1) $(chapter2) $(chapter3) $(chapter4) \ - $(chapter5) $(chapter7) $(chapter8) $(chapter9) + $(chapter5) $(chapter7) $(chapter8) $(chapter9) $(chaptera) diff --git a/vorlesungen/slides/a/Makefile.inc b/vorlesungen/slides/a/Makefile.inc new file mode 100644 index 0000000..9b88c8f --- /dev/null +++ b/vorlesungen/slides/a/Makefile.inc @@ -0,0 +1,12 @@ + +# +# Makefile.inc -- additional depencencies +# +# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +# +chaptera = \ + ../slides/a/dc/prinzip.tex \ + ../slides/a/dc/effizient.tex \ + ../slides/a/dc/beispiel.tex \ + ../slides/a/chapter.tex + diff --git a/vorlesungen/slides/a/chapter.tex b/vorlesungen/slides/a/chapter.tex new file mode 100644 index 0000000..f03ca19 --- /dev/null +++ b/vorlesungen/slides/a/chapter.tex @@ -0,0 +1,11 @@ +% +% chapter.tex +% +% (c) 2021 Prof Dr Andreas Müller, Hochschule Rapperswi +% + +\folie{a/dc/prinzip.tex} +\folie{a/dc/effizient.tex} +\folie{a/dc/beispiel.tex} + + diff --git a/vorlesungen/slides/a/dc/beispiel.tex b/vorlesungen/slides/a/dc/beispiel.tex new file mode 100644 index 0000000..4c99e9e --- /dev/null +++ b/vorlesungen/slides/a/dc/beispiel.tex @@ -0,0 +1,54 @@ +% +% beispiel.tex -- slide template +% +% (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +% +\bgroup +\def\u#1#2{\uncover<#1->{#2}} +\begin{frame}[t] +\setlength{\abovedisplayskip}{5pt} +\setlength{\belowdisplayskip}{5pt} +\frametitle{Beispiel} +\vspace{-20pt} +\begin{columns}[t,onlytextwidth] +\begin{column}{0.48\textwidth} +\begin{block}{Aufgabe} +Berechne $1291^{17}\in\mathbb{F}_{2027}$ +\end{block} +\uncover<2->{% +\begin{block}{Exponent} +\vspace{-10pt} +\[ +17 = 2^4 + 1 += +\texttt{10001}_2 += +\texttt{0x11} +\] +\end{block}} +\end{column} +\begin{column}{0.48\textwidth} +\uncover<3->{% +\begin{block}{Divide-and-Conquor} +\begin{center} +\begin{tabular}{|>{$}r<{$}>{$}r<{$}|>{$}r<{$}|>{$}r<{$}|>{$}r<{$}|>{$}r<{$}|} +\hline +i&2^i& a^{2^i} & n & n_i & m \\ +\hline +0& 1& 1291 & 17 & \u{4}{1}&\u{5}{ 1291}\\ +1& 2& \u{6}{ 487}& \u{7}{8}& \u{8}{0}& \u{9}{\color{gray}1291}\\ +2& 4&\u{10}{ 10}&\u{11}{4}&\u{12}{0}&\u{13}{\color{gray}1291}\\ +3& 8&\u{14}{ 100}&\u{15}{2}&\u{16}{0}&\u{17}{\color{gray}1291}\\ +4& 16&\u{18}{1892}&\u{19}{1}&\u{20}{1}&\u{21}{ 37}\\ +\hline +\end{tabular} +\end{center} +\end{block}} +\uncover<22->{% +\begin{block}{Resultat} +\(1291^{17} \equiv 37\mod 2027\) +\end{block}} +\end{column} +\end{columns} +\end{frame} +\egroup diff --git a/vorlesungen/slides/a/dc/effizient.tex b/vorlesungen/slides/a/dc/effizient.tex new file mode 100644 index 0000000..327ee7e --- /dev/null +++ b/vorlesungen/slides/a/dc/effizient.tex @@ -0,0 +1,65 @@ +% +% effizient.tex -- Effiziente Berechnung der Potenz +% +% (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +% +\bgroup +\definecolor{darkgreen}{rgb}{0,0.6,0} +\begin{frame}[t] +\setlength{\abovedisplayskip}{5pt} +\setlength{\belowdisplayskip}{5pt} +\frametitle{Effiziente Berechnung} +\vspace{-20pt} +\begin{columns}[t,onlytextwidth] +\begin{column}{0.48\textwidth} +\begin{block}{Prinzip} +\begin{enumerate} +\item<3-> {\color{red}Bits mit Shift isolieren} +\item<4-> {\color{blue}Laufend reduzieren} +\item<5-> {\color{darkgreen}effizient quadrieren} +\end{enumerate} +\end{block} +\end{column} +\begin{column}{0.48\textwidth} +\begin{block}{Algorithmus} +\begin{center} +\begin{tikzpicture}[>=latex,thick] +\uncover<3->{ +\fill[color=red!20] (2.3,-2.44) rectangle (3.8,-1.98); +\fill[color=red!20] (1.45,-3.88) rectangle (3.2,-3.42); +} +\uncover<4->{ +\fill[color=blue!20] (2.15,-2.94) rectangle (3.7,-2.48); +} +\uncover<5->{ +\fill[color=darkgreen!20] (1.45,-4.37) rectangle (3.8,-3.91); +} +\node at (0,0) [below right] {\begin{minipage}{6cm}\obeylines +{\tt int potenz(int $a$, int $n$) \{}\\ +\hspace*{0.7cm}{\tt int m = 1;}\\ +\hspace*{0.7cm}{\tt int q = $a$;}\\ +\uncover<2->{% +\hspace*{0.7cm}{\tt while ($n$ > 0) \{}\\ +\uncover<3->{% +\hspace*{1.4cm}{\tt if (0x1 \& $n$) \{}\\ +\uncover<4->{% +\hspace*{2.1cm}{\tt m *= q;}\\ +}% +\hspace*{1.4cm}{\tt \}}\\ +\hspace*{1.4cm}{\tt $n$ >{}>= 1;}\\ +}% +\uncover<5->{% +\hspace*{1.4cm}{\tt q = sqr(q);}\\ +}% +\hspace*{0.7cm}{\tt \}}\\ +}% +\hspace*{0.7cm}{\tt return m;}\\ +{\tt \}} +\end{minipage}}; +\end{tikzpicture} +\end{center} +\end{block} +\end{column} +\end{columns} +\end{frame} +\egroup diff --git a/vorlesungen/slides/a/dc/naiv.txt b/vorlesungen/slides/a/dc/naiv.txt new file mode 100644 index 0000000..bf5569d --- /dev/null +++ b/vorlesungen/slides/a/dc/naiv.txt @@ -0,0 +1,2 @@ +int m = 1, i = 0; +while (i++ < n) { m *= a; } diff --git a/vorlesungen/slides/a/dc/prinzip.tex b/vorlesungen/slides/a/dc/prinzip.tex new file mode 100644 index 0000000..c75af61 --- /dev/null +++ b/vorlesungen/slides/a/dc/prinzip.tex @@ -0,0 +1,86 @@ +% +% prinzip.tex -- slide template +% +% (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +% +\bgroup +\begin{frame}[t] +\setlength{\abovedisplayskip}{5pt} +\setlength{\belowdisplayskip}{5pt} +\frametitle{Potenzieren $\mod p$} +\vspace{-20pt} +\begin{columns}[t,onlytextwidth] +\begin{column}{0.48\textwidth} +\begin{block}{Aufgabe} +Berechne $a^n\in\mathbb{F}_p$ für grosses $n$ +\end{block} +\uncover<2->{% +\begin{block}{Mengengerüst} +\( +\log_2 n > 2000 +\) +\\ +\uncover<3->{% +RSA mit $N=pq$: Exponenten sind $e,d$, $e$ klein, aber +\( +ed\equiv 1 \mod \varphi(N) +\)} +\end{block}} +\uncover<4->{% +\begin{block}{Naive Idee} +\verbatiminput{../slides/a/dc/naiv.txt} +Laufzeit: $O(n) \uncover<5->{= O(2^{\log_2n})}$% +\uncover<5->{, d.~h.~exponentiell in der Bitlänge von $n$} +\end{block}} +\end{column} +\begin{column}{0.48\textwidth} +\uncover<6->{% +\begin{block}{Idee 1: Exponent binär schreiben} +\vspace{-12pt} +\[ +n = n_k2^k + n_{k-1}2^{k-1} + \dots +n_12^1 + n_02^0 +\] +\end{block}} +\vspace{-5pt} +\uncover<7->{% +\begin{block}{Idee 2: Potenzgesetze} +\vspace{-12pt} +\[ +a^n += +a^{n_k2^k} +a^{n_{k-1}2^k} +\dots +a^{n_12^1} +a^{n_02^0} +\uncover<8->{= +\prod_{n_i = 1} +a^{2^i}} +\] +\end{block}} +\vspace{-15pt} +\uncover<9->{% +\begin{block}{Idee 3: Quadrieren} +\vspace{-10pt} +\begin{align*} +a^{2^i} +&= +a^{2\cdot 2^{i-1}} +\uncover<10->{= +(a^{2^{i-1}})^2} +\\ +&\uncover<11->{= +(\dots(a\underbrace{\mathstrut^2)^2\dots)^2}_{\displaystyle i}} +\end{align*} +\end{block}} +\vspace{-18pt} +\uncover<12->{% +\begin{block}{Laufzeit} +Multiplikationen: $\le 2 \cdot(\log_2(n) - 1)$ +\\ +\uncover<13->{Worst case Laufzeit: $O(\log_2 n)$} +\end{block}} +\end{column} +\end{columns} +\end{frame} +\egroup diff --git a/vorlesungen/slides/test.tex b/vorlesungen/slides/test.tex index 4673f76..ffd492c 100644 --- a/vorlesungen/slides/test.tex +++ b/vorlesungen/slides/test.tex @@ -4,36 +4,17 @@ % (c) 2021 Prof Dr Andreas Müller, Hochschule Rapperswil % -\section{Matrizen-Gruppen} -% Was sind Symmetrien -%\folie{7/symmetrien.tex} -% Algebraische Bedingungen für Matrixgruppen -%\folie{7/algebraisch.tex} -% Parametrisierung, Beispiel SO(3) -%\folie{7/parameter.tex} -% Mannigfaltigkeiten -%\folie{7/mannigfaltigkeit.tex} -% Weitere Beispiele -% SL_2(R) -%\folie{7/sl2.tex} -\folie{7/drehung.tex} -%\folie{7/drehanim.tex} -% Semidirekte Produkte SO(2) x R^2, R^+ x R -%\folie{7/semi.tex} +\folie{a/dc/prinzip.tex} +\folie{a/dc/effizient.tex} +\folie{a/dc/beispiel.tex} -\section{Ableitungen} -% Kurven in einer Gruppe -%\folie{7/kurven.tex} -% Einparameter-Gruppen -%\folie{7/einparameter.tex} -% Ableitung einer Einparameter-Gruppe -%\folie{7/ableitung.tex} -% Lie-Algebra -%\folie{7/liealgebra.tex} -% Kommutator -%\folie{7/kommutator.tex} +%\folie{a/ecc/gruppendh.tex} +%\folie{a/ecc/kurve.tex} +%\folie{a/ecc/operation.tex} +%\folie{a/ecc/quadrieren.tex} -\section{Exponentialabbildung} -% Differentialgleichung für die Exponentialabbildung -%\folie{7/dg.tex} +%\folie{a/aes/bytes.tex} +%\folie{a/aes/blockes.tex} +%\folie{a/aes/kays.tex} +%\folie{a/aes/runden.tex} |