1
0
mirror of https://github.com/2martens/uni.git synced 2026-05-06 19:36:26 +02:00

106 Commits

Author SHA1 Message Date
da05933c8d MK: Feedback hinzugefügt. 2013-12-09 16:41:41 +01:00
4cbbe10194 SE3-6: Zusätzlichen MoniMonitor zum Weihnachtsbild hinzugefügt. 2013-12-07 13:09:57 +01:00
99ca499a0a GDB-4: Aufgabe 3 und 4 bearbeitet. 2013-12-07 12:01:42 +01:00
4d8389eba9 GDB-4: Blatt 4 Aufgaben 1 und 2 bearbeitet. 2013-12-05 20:19:27 +01:00
a6ed748153 GDB: vsis-gdb.sty angepasst. 2013-12-05 18:42:41 +01:00
758f40ea1f SE3-6: Blatt 6 bearbeitet.
* Weihnachtsbild muss eventuell noch verbessert werden.
2013-12-05 17:52:41 +01:00
26fda0ddb4 Readme angepasst. 2013-12-05 11:57:07 +01:00
347f0584a0 README aufgrund eines aktuellen Anlasses angepasst. 2013-12-05 11:55:09 +01:00
240dd113ab SE3-5: Aufgabe 2 anhand der Rückmeldungen verbessert. 2013-12-04 21:07:48 +01:00
7fb91df76f MATH2-Inf-8: Aufgabenblatt komplett bearbeitet. 2013-12-04 16:54:04 +01:00
542da545e2 fixed 4a 2013-12-03 23:11:19 +01:00
8743f36082 AD-4: Absätze korrigiert. 2013-12-03 14:16:09 +01:00
02da1f0144 added 3d, 3e and 4a 2013-12-03 12:10:46 +01:00
44ab3e4e0b AD-4: Algorithmus 2b ii korrigiert. 2013-12-03 10:51:17 +01:00
7913205597 MK: Vortrag fertig ausgearbeitet. 2013-12-03 10:13:27 +01:00
1f552564c9 Prosem: Grundstruktur Vortrag hinzugefügt. 2013-12-02 21:11:53 +01:00
b3df21b7d1 MK: Vortragsausarbeitung begonnen. Unnötiger Seitenumbruch in Paper entfernt. 2013-12-02 21:11:15 +01:00
66ba6adf3c AD-4: Aufgabe 4b und c bearbeitet. 2013-12-02 13:19:22 +01:00
034d351d48 SE3-5: Aufgabe 2 bearbeitet. 2013-12-01 13:27:23 +01:00
7782f3bce6 AD-4: Beweisidee Fall 3 in Zusatzaufgabe korrigiert. 2013-12-01 12:26:59 +01:00
891d29e8db AD-4: Aufgaben 2b (ii), 2c (iii) und 3a-c und f bearbeitet.
Zusatzaufgabe: Trivialer Fall und einfacher Fall bewiesen. Komplexer Fall: Beweisidee aufgeschrieben.
2013-12-01 12:10:43 +01:00
f0ede8a917 SE3-5: Aufgabe 1 bearbeitet. 2013-11-28 16:08:07 +01:00
6944116e41 AD-4: Aufgabe 2 teilweise bearbeitet. 2013-11-28 13:26:31 +01:00
4814d034eb SE3-4: Aufgabe 1 korrigiert. 2013-11-28 08:05:27 +01:00
18beb0ed80 AD-4: Trailing whitespace removed. 2013-11-27 16:13:08 +01:00
470120c41a AD-4: Aufgabe 1 bearbeitet. 2013-11-27 15:50:56 +01:00
6781c5ac6b KBS: Link zu Symfony-Dokumentation ergänzt. 2013-11-27 14:26:01 +01:00
32ee17cb3d MATH2-Inf-7: Blatt 7 komplett bearbeitet. 2013-11-27 14:25:37 +01:00
7f9d6991ad AD-4: Grundstruktur erstellt. 2013-11-26 13:33:13 +01:00
5496fc3dd5 GDB-3: Aufgabe 3 bearbeitet. 2013-11-26 13:28:55 +01:00
d71f895dad MK: Selbstbezeichnung in dritter Person entfernt. Abstract angepasst. 2013-11-24 11:25:43 +01:00
11002283c7 SE3-4: Aufgabe 3 bearbeitet. 2013-11-23 12:30:54 +01:00
ba8e658c6b Prosem: Conclusion finished. Introduction finished. Abstract finished. 2013-11-23 11:53:13 +01:00
53c2f20454 KBS: ORM Langform korrigiert. 2013-11-23 09:44:02 +01:00
8c9345ae82 KBS Lightning Talk 2013-12-03 hinzugefügt. 2013-11-23 09:43:14 +01:00
c1e7081efc GDB-3: Blatt 3 Aufgaben 1 und 2 bearbeitet. 2013-11-21 16:37:24 +01:00
605f14d18f GDB: sty modifiziert. 2013-11-21 16:36:50 +01:00
d47a755fdf Blatt 4 Aufgaben 1 und 2 bearbeitet. 2013-11-21 14:07:40 +01:00
2b4c538135 Datenstruktur korrigiert und vereinfacht. 2013-11-21 14:07:22 +01:00
5d3323e75e Kritische Diskussion weiter ausformuliert. 2013-11-20 17:59:40 +01:00
a0e3026bc9 MATH2-Inf-4: Aufgabe 1b korrigiert. 2013-11-20 17:39:38 +01:00
25a84b38e7 MATH2-Inf-6: Blatt 6 komplett bearbeitet. 2013-11-20 17:25:26 +01:00
3f2ea0d05e AD-3: Zeilenumbruch korrigiert. 2013-11-19 14:02:23 +01:00
3793c2fe70 Aufgabe 4b bearbeitet 2013-11-19 13:44:59 +01:00
0e667caf71 AD-3: 4a bearbeitet. 2013-11-18 13:19:29 +01:00
6e9021cb82 AD-3: 1c und d bearbeitet. 2 bearbeitet. 2013-11-18 12:32:04 +01:00
39e6a1de52 Beide buchstabiere Funktionen funktionieren nun auch mit kleinen Buchstaben. 2013-11-17 15:50:14 +01:00
9f32168252 Paper angefangen auszuformulieren. 2013-11-17 15:49:47 +01:00
bfd88c5a98 SE3-3: Aufgabenblatt 3 komplett bearbeitet. 2013-11-14 17:47:27 +01:00
8c5b3e7485 AD-3: 3a mithilfe des Mastertheorems angepasst. 2013-11-14 15:53:25 +01:00
fe728b5d7c AD-3: Blatt erstellt und 1a und b, 3a und b, 5a und b bearbeitet. 2013-11-14 15:34:28 +01:00
46a63b2cc5 GDB-2: Aufgabe 1b verbessert. 2013-11-14 15:30:58 +01:00
2e78256790 ProSem: Outline, Bib-Datei und Ausgangsversion Paper hinzugefügt. 2013-11-13 17:50:20 +01:00
1fe6f198e6 MK: Urversion des Papers und Bib-Datei hinzugefügt. 2013-11-13 17:49:07 +01:00
7873e5e913 MATH2-Inf-5: Aufgabenblatt 5 bearbeitet. 2013-11-13 17:47:18 +01:00
6a2abf691e GDB-2: Aufgabe 2 verbessert. 2013-11-12 11:16:49 +01:00
cda788a5db MATH2-Inf-3: Aufgabe 2a korrigiert. 2013-11-12 10:53:12 +01:00
f6bf670444 GDB-2: Aufgabe 3 bearbeit. 2013-11-11 15:22:43 +01:00
d24ad6e22a GDB-2: Aufgabe 2 gelöst. 2013-11-11 14:35:02 +01:00
64dcf05240 SE3-2: Kommentare ergänzt. 2013-11-10 10:27:25 +01:00
fd41c3f1f0 SE3-2: Begründungen bei 3 hinzugefügt. 2013-11-10 10:08:41 +01:00
1874d83e1d GDB-2: 1b bearbeitet. 2013-11-07 16:24:20 +01:00
0230f3f734 GDB-2: 1a bearbeitet. 2013-11-07 16:12:54 +01:00
3d0479ad69 SE3-2: Blatt 2 komplett bearbeitet. 2013-11-07 13:19:20 +01:00
b676b39db5 MATH2-Inf-4: Blatt 4 gelöst. 2013-11-06 19:54:31 +01:00
0fe8ecf413 AD-2: Reinhards Matr.nummer finalisiert. 2013-11-05 20:24:00 +01:00
4da752beb0 MATH2-Inf-3: 2a korrigiert. 2013-11-04 14:53:17 +01:00
4211ad6c4d MATH2-Inf-3: falsche Gerade aus Zeichnung entfernt. 2013-11-04 13:04:08 +01:00
9db6bbb2eb AD-2: Listings-Paket gegen algorithm und algorithmic ausgetauscht. 2013-11-02 19:26:28 +01:00
3162e632f7 AD-2: 5a und b bearbeitet. 2013-11-02 19:25:50 +01:00
8823050a6f AD-2: Listings-Paket eingebunden. 2013-11-02 18:43:26 +01:00
9ecd5f7110 AD-2: Aufgabe 3 komplett gelöst. 2013-11-02 18:42:10 +01:00
99da603ffe AD-2: 2a und b gelöst. 2013-11-02 18:41:38 +01:00
ad55ee1a2b AD-2: Absätze werden nun als solche dargestellt. 2013-11-02 18:41:11 +01:00
ebd1d8c61f AD-2: 3b gelöst. 2013-11-02 17:30:10 +01:00
b0400eb4f0 AD-2: Matr.Nummer von Tronje finalisiert. 2013-11-01 20:22:24 +01:00
5ffb5b5e2b 2c-e gelöst. 2a unvollständig. 2013-10-31 14:36:00 +01:00
0d6a5bd77b AD-1: Removed trailing whitespace. 2013-10-31 14:35:26 +01:00
3c69d2443e SE3-1: Namen vervollständigt. 2013-10-31 12:56:49 +01:00
307a188688 Modified gitignore and added *~ files. 2013-10-31 12:56:29 +01:00
ffdf909298 AD-2: Fehlende Matr.Nummern nach Gedächtnis ergänzt. Etwaige Fehler müssen noch korrigiert werden. 2013-10-31 12:52:48 +01:00
72d3ced337 AD-2: Blatt umbenannt, um neuem Gruppenmitglied Rechnung zu tragen. 2013-10-31 12:44:06 +01:00
a6f03dd921 GDB-1: Lösung für Transaktionen aktualisiert. 2013-10-30 21:29:31 +01:00
b496c8d048 AD-2: 1 und 4 gelöst. 2013-10-30 20:43:09 +01:00
5f9084db1c AD-2: Blatt 2 Rohversion ohne Inhalt erstellt. 2013-10-30 18:18:42 +01:00
b36ce7c31a AD-Gruppe_8_Krabbe_Martens.tex umbenannt, um verschiedene Blätter zu unterscheiden. 2013-10-30 18:15:03 +01:00
4ba5f6f8f6 Dateinamen und Headervorgaben umgesetzt. 2013-10-30 18:09:11 +01:00
065ae97656 MATH2-Inf-3: 2a,b komplett gelöst; 1a größtenteils und 1b unter Vorbehalt 2013-10-30 17:58:14 +01:00
46bcd93de3 überflüssiges Plus entfernt 2013-10-30 17:57:15 +01:00
b97399d71c MATH2-Inf-1: Nach Erhalt von Lösung korrigiert. 2013-10-28 21:01:18 +01:00
54906bab74 GDB: Converted to unicode. 2013-10-27 18:32:20 +01:00
dc1219fded SE3-1: 2.2 und 2.3 geloest. 2013-10-27 14:48:04 +01:00
6cbe8d1aa9 GDB-1: Aufgaben 1 und 3 ergaenzt. 2013-10-27 11:20:46 +01:00
42ed9aaa89 SE3-1: 4c korrigiert. 2013-10-26 13:23:23 +02:00
ff08346dbd SE3-1: 2.1 geloest (funktioniert). 2013-10-25 13:30:26 +02:00
e52bfa225c GDB-1: 2 und 4 soweit geloest. 2013-10-24 18:40:27 +02:00
8cbf4666d0 GDB-1: Initialversion von Blatt 1 samt Vorlage. 2013-10-24 16:13:10 +02:00
996d99d393 MATH2-Inf-2: 2 geloest. 2013-10-24 15:27:08 +02:00
5e2b1503d4 SE3-1: 2.1 ansatzweise geloest (funzt noch nicht). 2013-10-24 14:22:48 +02:00
1c4d015147 SE3-1: Aufgabe 1 geloest. 2013-10-24 12:56:43 +02:00
ca6fb5942a SE3-1: leere Version Blatt 1 erstellt. 2013-10-24 12:40:31 +02:00
d6862e2a24 Added *.bak to gitignore. 2013-10-24 12:39:59 +02:00
70a3bebaea Added .zip to gitignore. 2013-10-24 12:31:09 +02:00
c251cd044f MATH2-Inf-2: 1b geloest. 2013-10-23 20:56:18 +02:00
f36ff887df MATH2-Inf-2: 1a geloest. 2013-10-23 18:40:42 +02:00
23074dcb68 MATH2-Inf-2: Grundstruktur zweites Blatt erstellt. 2013-10-23 17:14:37 +02:00
37 changed files with 7407 additions and 27 deletions

4
.gitignore vendored
View File

@ -2,6 +2,7 @@
*.acr
*.alg
*.aux
*.bak
*.bbl
*.blg
*.dvi
@ -27,8 +28,9 @@
*.ps
*.snm
*.synctex.gz
*.tex.bak
*.toc
*.vrb
*.xdy
*.tdo
*.zip
*~

View File

@ -1,4 +1,13 @@
uni
===
University stuff
Aus gegebenem Anlass:
Die in diesem Repository zu findenen Latex- und .rkt-Dateien sind Hausaufgaben. Zum Zwecke der Zusammenarbeit innerhalb
**meiner** Gruppe werden auch Dateien hochgeladen, deren Abgabedeadline noch nicht erreicht ist.
Es nutzt anderen Gruppen kein Stück diese noch ausstehenden Abgaben 1:1 zu kopieren, die Namen zu ändern und als ihre
eigene Arbeit auszugeben. Denn dann bekommen beide Gruppen keine Punkte. Da dies so in GDB passiert ist, werden die entsprechenden
Latexdateien für GDB ab sofort erst nach der Abgabedeadline hochgeladen. Es ist bedauerlich, dass einige Personen in dieser
Hinsicht derartig dumm sind. Es spricht nichts dagegen sich die von mir bearbeiteten Abgaben anzusehen und sich Ideen zu holen.
Identische Kopien sind aber in keinem Falle angebracht.

View File

@ -0,0 +1,226 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{bytefield}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage{textcomp}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usepackage{algorithm}
\usepackage{algorithmic}
\usetikzlibrary{matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
\def\thesection{\arabic{section})}
\def\thesubsection{(\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
\begin{document}
\author{Reinhard Köhler (6425686), Tronje Krabbe (6435002), \\
Jim Martens (6420323)}
\title{Hausaufgaben zum 6. November}
\subtitle{Gruppe 8}
\maketitle
\section{} %1
\subsection{} %a
In Level $l$ liegen maximal $k^{l}$ Knoten. Dies ist in einem vollen Baum auf jeder Ebene gegeben.
\subsection{} %b
Ein voller Baum der Tiefe $l$ hat auf der untersten Ebene $k^{l}$ Knoten. Daraus ergibt sich diese Summe:
\[
\sum\limits_{i=0}^{l} k^{i} = k^{l+1} - 1
\]
Dies gilt da in einem vollen Baum die Anzahl Knoten in einer Ebene immer einer Potenz von $k$ entsprechen.
\subsection{} %c
Ein vollständiger Baum der Tiefe $l$ gleicht bis auf die letzte Ebene einem vollen Baum. In der letzten Ebene $l$ kommen maximal $k^{l} - 1$ Knoten vor, damit es ein vollständiger Baum, aber kein voller Baum ist. Daraus ergibt sich diese leicht abgewandelte Formel:
\begin{alignat*}{2}
\sum\limits_{i=0}^{l-1} \left(k^{i}\right) + c &:& 1 \leq c < k^{l}
\end{alignat*}
\subsection{} %d
Jeder Knoten hat genau ein Elternknoten mit dem er über eine Kante verbunden ist. Einzige Ausnahme ist der Wurzelknoten, der kein Elternelement hat und damit auch keine Kante, die mit einem solchen verbunden sein könnte. Daher gibt es genau $n-1$ Kanten.
\section{} %2
\subsection{} %a
Laufzeit von Order1:
\[
T(n) = 2T\left(\frac{n}{2}\right) + n^{0}
\]
Laufzeit von Order2:
\[
T(n) = 2T\left(\frac{n}{2}\right) + n^{0}
\]
Laufzeit von Order3:
\[
T(n) = 2T\left(\frac{n}{2}\right) + n^{0}
\]
\subsection{} %b
Die Laufzeiten von Order1, Order2 und Order3 können im best-case auf $1$ verbessert werden.
\subsection{} %c
Order1: NAOEIFMRLUSGARTH \\
Order2: IEOFARMLNGSAUTRH \\
Order3: IEFORLMAGASTHRUN
\subsection{} %d
T = \begin{bytefield}{10}
\bitbox{1}{T}
\bitbox{1}{E}
\bitbox{1}{E}
\bitbox{1}{O}
\bitbox{1}{Y}
\bitbox{1}{R}
\bitbox{1}{E}
\bitbox{1}{L}
\bitbox{1}{V}
\bitbox{1}{L}
\end{bytefield}
\subsection{} %e
ALGORITHMSAREFUN
\section{} %3
\subsection{} %a
\begin{alignat*}{2}
f(x) &=& x \cdot \frac{\ln(n)}{\ln(x)} \\
&=& \frac{x}{\ln(x)} \cdot \ln(n) \\
f'(x) &=& \left(\frac{x}{\ln(x)} \cdot \ln(n)\right)' \\
&=& \left(\frac{x}{\ln(x)}\right)' \cdot \ln(n) \\
&=& \frac{\ln(x) - 1}{\ln^{2}(x)} \cdot \ln(n) \\
\intertext{Einsetzen von $e$ für $x$}
f'(e) &=& \frac{\ln(e) - 1}{\ln^{2}(e)} \cdot \ln(n) \\
&=& \frac{1 - 1}{1^{2}} \cdot \ln(n) \\
&=& 0 \\
\intertext{Da $f'(x)$ offensichtlich nur eine Nullstelle hat, haben wir hiermit die einzige Extremstelle von $f$ gefunden.}
f(e) &=& \frac{e}{\ln(e)} \cdot \ln(n) \\
&=& e \cdot \ln(n)
\end{alignat*}
Das Ergebnis der letzten Gleichung ist somit das Minima von $f$. Als weitere Absicherung kann das asymptotische Wachstum betrachtet werden. Für einen kleineren Wert als $e$, ist $\ln(x)$ kleiner als $1$. Das Teilen von $x$ durch diesen Wert geringer als $1$ sorgt dafür, dass das Ergebnis größer als $x$ ist. Lässt man $x$ gegen $1$ laufen, läuft der Bruch gegen unendlich. Auf der anderen Seite kann man $x$ gegen unendlich gehen lassen, dann läuft der Bruch auch gegen unendlich, da eine lineare Funktion schneller wächst, als eine logarithmische. Der konstante Faktor am Ende kann dabei außer Acht gelassen werden.
\subsection{} %b
Die beste Wahl für $k^{*}$ ist $3$. Es werden im worst-case bei der Heap-Größe $n=10^{l}$ mit $l \in \{1,...,9\}$ diese Anzahl an Schritten benötigt.
\begin{tabular}{c|c|c}
$l$ & $k = 3$ & $k = 2$ \\
\hline
1 & 7 & 7 \\
2 & 13 & 14 \\
3 & 19 & 20 \\
4 & 26 & 27 \\
5 & 32 & 34 \\
6 & 38 & 40 \\
7 & 45 & 47 \\
8 & 51 & 54 \\
9 & 57 & 60
\end{tabular}
\subsection{} %c
Ein binärer Heap (dementsprechend $k=2$) ist deutlich übersichtlicher als ein ternärer Heap. Außerdem ist ein binärer Heap leichter zu be- bzw. verarbeiten und der Unterschied des Laufzeitaufwandes zwischen einem binären und einem ternären Heap ist nicht sonderlich groß.
\subsection{} %d
Pro Vertauschen werden $k+1$ Schritte benötigt. Ein Schritt wird benötigt, um das Maximum herauszufinden und $k$ Schritte, um den Max-Heap des aktuellen Knoten nach dem Vertauschen wieder zu einem solchen zu machen. Damit werden zwar viele Schritte zum Finden eines Maximums der Kinder eingespart, allerdings an anderer Stelle wieder durch das Aufrufen von Heapify auf den zusätzlichen Max-Heap ausgegeben. Im Endeffekt ergibt sich damit eine Gesamtlaufzeit von $\lceil (k+1)\log_{k}(n) \rceil$.
\subsection{} %e
Anwenden von \textsc{Decrease}$(9 \mapsto 1)$ auf Ergebnis von 3d: 2 Vertauschungen \\
Anwenden von \textsc{Decrease}$(9 \mapsto 1)$ auf Ergebnis von 3f: eine Vertauschung
\subsection{} %f
Ein ternärer Heap hat bei gleicher Anzahl an Knoten maximal gleich viele Level, wodurch dieselbe \textsc{Decrease}-Operation bei einem ternären Heap immer maximal gleich viele Vertauschungen wie bei einem binären Heap erfordert.
\section{} %4
\subsection{} %a
merge (2 2 5 7 9, 1 2 4 8) \\
1 $\circ$ merge (2 2 5 7 9, 2 4 8) \\
1 2 $\circ$ merge (2 5 7 9, 2 4 8) \\
1 2 2 $\circ$ merge (5 7 9, 2 4 8) \\
1 2 2 2 $\circ$ merge (5 7 9, 4 8) \\
1 2 2 2 4 $\circ$ merge (5 7 9, 8) \\
1 2 2 2 4 5 $\circ$ merge (7 9, 8) \\
1 2 2 2 4 5 7 $\circ$ merge (9, 8) \\
1 2 2 2 4 5 7 8 $\circ$ merge (9, []) \\
1 2 2 2 4 5 7 8 9
\subsection{} %b
Input 6 7 8 3 4 2 9 1 \\
Rekursiv in einzelne Ziffern zerlegt und dann zusammengefügt: \\
\begin{tikzpicture}
\tikzset{
position label/.style={
below = 3pt,
text height = 1.5ex,
text depth = 1ex
},
brace/.style={
decoration={brace, mirror},
decorate
}
}
\node [position label] (a1) at (0,0) {$6$};
\node [position label] (a2) at (0.5,0) {$7$};
\node [position label] (a3) at (1,0) {$8$};
\node [position label] (a4) at (1.5,0) {$3$};
\node [position label] (a5) at (2,0) {$4$};
\node [position label] (a6) at (2.5,0) {$2$};
\node [position label] (a7) at (3,0) {$9$};
\node [position label] (a8) at (3.5,0) {$1$};
\draw [brace] (a1.south) -- (a2.south);
\draw [brace] (a3.south) -- (a4.south);
\draw [brace] (a5.south) -- (a6.south);
\draw [brace] (a7.south) -- (a8.south);
\node [position label] (b1) at (0.25,-0.7) {$67$};
\node [position label] (b2) at (1.25,-0.7) {$38$};
\node [position label] (b3) at (2.25,-0.7) {$24$};
\node [position label] (b4) at (3.25,-0.7) {$19$};
\draw [brace,decoration={raise=4ex}] (a1.south) -- (a4.south);
\draw [brace,decoration={raise=4ex}] (a5.south) -- (a8.south);
\node [position label] (c1) at (0.75,-1.4) {$3678$};
\node [position label] (c2) at (2.75,-1.4) {$1249$};
\draw [brace,decoration={raise=8ex}] (a1.south) -- (a8.south);
\node [position label] (d1) at (1.75,-2.1) {$12346789$};
\end{tikzpicture}
\subsection{} %c
Eine Möglichkeit eine absteigende Sortierung zu erreichen, ist das Umkehren von $x[1] \leq y[1]$ zu $x[1] \geq y[1]$.
Eine andere Möglichkeit ist das Vertauschen der Fälle in der \texttt{if}-Abfrage. Dabei bleibt die Bedingung der Abfrage gleich, allerdings wird statt dem ersten Element von $x$ das erste Element von $y$ genommen. Im \texttt{else}-Fall wird dann dementsprechend das erste Element von $x$ genommen.
\section{} %5
\subsection{} %a
Man benutzt einen Stack als Zwischenspeicher und einen Stack als die eigentliche Queue. Soll ein Element in die Queue eingefügt werden, wird jedes Element des Hauptstacks nach und nach entfernt und auf den Speicherstack geschrieben. Dann wird das hinzuzufügende Element in den Hauptstack geschrieben. Danach werden nach und nach alle Elemente aus dem Speicherstack entfernt und auf den Hauptstack geschrieben. So sind in dem Hauptstack die Elemente in der Reihenfolge gespeichert, in der sie ausgelesen werden sollen (FIFO-Prinzip). Soll nun ein Element aus der Queue entfernt werden, wird einfach die pop-Operation an dem Hauptstack aufgerufen, womit das Element, das zuerst eingefügt wurde, entfernt wird, wie es bei einer Queue der Fall ist.
\begin{verbatim}
function ENQUEUE(e):
if Hauptstack.isEmpty():
Hauptstack.push(e);
else:
for element in Hauptstack:
Speicherstack.push(element);
Hauptstack.pop();
end for
Hauptstack.push(e);
for element in Speicherstack:
Hauptstack.push(element);
Speicherstack.pop();
end for
end if
end function
function DEQUEUE():
Hauptstack.pop();
end function
\end{verbatim}
Im worst-case ist die Laufzeit von \textsc{Dequeue} $\theta(1)$. Die worst-case Laufzeit von \textsc{Enqueue} ist bei $k$ Elementen $2k+1$.
\subsection{} %b
Die worst-case Laufzeit von $n$ \textsc{Enqueue}-Operationen beträgt $n \cdot (2n+1) = 2n^{2} + n$. Die amortisierte Laufzeit beträgt dann $\frac{n(2n+1)}{n} = 2n+1$. Dabei muss beachtet werden, dass bei weniger \textsc{Enqueue}- und mehr \textsc{Dequeue}-Operationen dementsprechend auch das Ergebnis weniger groß ausfällt.
\end{document}

View File

@ -0,0 +1,143 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{bytefield}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage{textcomp}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usepackage{algorithm}
\usepackage{algorithmic}
\usetikzlibrary{automata,matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
\def\thesection{\arabic{section})}
\def\thesubsection{(\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
\begin{document}
\author{Reinhard Köhler (6425686), Tronje Krabbe (6435002), \\
Jim Martens (6420323)}
\title{Hausaufgaben zum 20. November}
\subtitle{Gruppe 8}
\maketitle
\section{} %1
\subsection{} %a
$11\mathbb{N}+10$
Auf der letzten Position liegen alle Zahlen, die um 10 größer sind, als die nächstkleinere durch 11 teilbare Zahl. Dies ist offensichtlich bei der gegebenen Hashfunktion.
\subsection{} %b
$11\mathbb{N}+5$
Auf der letzten Position liegen alle Zahlen, die um 5 größer sind, als die nächstkleinere durch 11 teilbare Zahl. Dies ergibt sich aus a) dadurch, dass jetzt $k$ mit 2 multipliziert wird, womit die Wert nur noch um 5 größer sein können.
\subsection{} %c
$\sqrt{11\mathbb{N}}$
Die gegebene Hashfunktion ist nicht eindeutig von dem Bezug des Modulo her. Da es wenig Sinn macht die Bedeutung $k^{2} + (10 \mod 11)$ anzunehmen, sind wir von der Bedeutung $(k^{2} + 10) \mod 11$ ausgegangen. In dieser zweiten Bedeutung muss $k^{2}$ also immer einem Vielfachen von $11$ entsprechen. Ein Vielfaches von $11$ wird mit $11\mathbb{N}$ ausgedrückt. Da jedoch nicht $k$ dort steht, sondern $k^{2}$ ist die Menge aller Keys $\sqrt{11\mathbb{N}}$.
\subsection{} %d
$(\log_{3}11)\mathbb{N} + \log_{3}11$
Die gegebene Hashfunktion ist nicht eindeutig von dem Bezug des Modulo her. Da es wenig Sinn macht die Bedeutung $3^{k}- (1 \mod 11)$ anzunehmen, sind wir von der Bedeutung $(3^{k}-1) \mod 11$ ausgegangen. In dieser zweiten Bedeutung muss $3^{k}$ einem Vielfachen von $11$ entsprechen. Der Schlüssel hierzu ist, was der Exponent von $3$ sein muss, um $11$ zu ergeben. Das Ergebnis ist $\log_{3}11$. Da $\mathbb{N}$ die $0$ mit einschließt, ergibt sich diese Menge aller Keys $(\log_{3}11)\mathbb{N} + \log_{3}11$.
\section{} %2
Zu Beginn wird $n!$ mit $n^{n}$ verglichen.
\[
\frac{n \cdot n \cdot n \cdot \text{...} \cdot n \cdot n}{n \cdot (n-1) \cdot (n-2) \cdot \text{...} \cdot 2 \cdot 1}
\]
Es wird deutlich, dass $n!$ asymptotisch langsamer wächst als $n^{n}$. Anschließend vergleichen wir $n!$ mit $\left(\frac{n}{2}\right)^{\frac{n}{2}}$.
\[
\frac{n \cdot (n-1) \cdot (n-2) \cdot ... \cdot (n- \frac{n}{2}) \cdot (n - \frac{n}{2} - 1) \cdot ... \cdot 2 \cdot 1}{\frac{n}{2} \cdot \frac{n}{2} \cdot \frac{n}{2} \cdot ... \frac{n}{2} \cdot 1 \cdot ... \cdot 1 \cdot 1}
\]
Es wird deutlich, dass $n!$ asymptotisch schneller wächst als $\left(\frac{n}{2}\right)^{\frac{n}{2}}$.
Aufgrund dieser Feststellungen wird nun der Logarithmus von $\left(\frac{n}{2}\right)^{\frac{n}{2}}$ und $n^{n}$ gebildet und mit dem von $n!$ verglichen.
\begin{alignat*}{2}
\log\left(\left(\frac{n}{2}\right)^{\frac{n}{2}}\right) &=& \frac{n}{2} \log\left(\frac{n}{2}\right) \\
&=& \frac{1}{2}n \log\left(\frac{1}{2}n\right) \\
\log(n^{n}) &=& n \log n
\end{alignat*}
Damit ist klar, dass die Logarithmen von $\left(\frac{n}{2}\right)^{\frac{n}{2}}$ und $n^{n}$ beide in $\theta(n \log n)$ sind. Aus unserem obigen Vergleich wissen wir, dass $n!$ schneller als $\left(\frac{n}{2}\right)^{\frac{n}{2}}$ und langsamer als $n^{n}$ wächst. Daraus ergibt sich:
\[
\frac{1}{2}n\log(\frac{1}{2}n) \in \theta(n \log n) \leq \log(n!) \leq n \log n \in \theta(n \log n)
\]
Da $\log(n!)$ asymptotisch sowohl schneller als auch langsamer als $n \log n$ wachsen muss, liegt $\log(n!)$ damit folgerichtig in $\theta(n \log n)$.
\section{} %3
\subsection{} %a
\begin{alignat*}{2}
T(1) &=& 1 \\
T(n) &=& 2T\left(\frac{n}{2}\right) + \mathcal{O}(n^{2})
\end{alignat*}
Anhand des Mastertheorems ergibt sich, dass $\mathcal{O}(n^{2})$ eine scharfe Schranke für die worst-case Laufzeit von dieser Quicksort-Variante ist.
\subsection{} %b
Diese Variante wird in der Praxis meist nicht verwendet, weil die benötigte Zeit zum Finden des Medians die Zeitersparnis beim Aufspalten bei weitem nicht rechtfertigt. Je größer die Eingabe wird und je weiter die einzelnen Zahlen auseinander liegen, desto länger dauert das Ermitteln des Medians.
\subsection{} %c
\section{} %4
\subsection{} %a
\begin{verbatim}
function RANDOM(k):
string bitmask = '';
for (int i = 0; i < k; i++):
bitmask += (string) werfeMuenze();
end for
if bitmask.isEmpty():
return A[0];
endif
int index = stringToBinary(bitmask);
return A[index];
end function
\end{verbatim}
Nach $k$-maligem Werfen einer Münze ergibt sich eine Zahl mit $k$ Bits. Die größte darstellbare Index ist damit $2^{k}$, wodurch alle Elemente des Arrays abgedeckt werden können. Da bei dem Münzwurf die $0$ und die $1$ gleich wahrscheinlich sind, ergibt sich nach $k$-maligem Werfen somit eine Gesamtwahrscheinlichkeit für den Index von $\frac{1}{2^{k}}$. Somit wird jedes Element des Arrays mit der gleichen Wahrscheinlichkeit von der Funktion zurückgegeben. Hat das Array nur ein Element, dann wird auch immer dieses Element zurückgegeben.
Da immer $k$-Mal eine Münze geworfen wird, ist die Anzahl nötiger Münzwürfe auch immer in $\mathcal{O}(\log n)$. Dies ergibt sich so:
\[
\mathcal{O}(\log n) = \mathcal{O}(\log(2^{k})) = \mathcal{O}(k \cdot \log 2) = \mathcal{O}(k)
\]
Da $\log 2$ eine Konstante ist, ist sie bei der Betrachtung der asymptotischen Laufzeit irrelevant. Damit ist nun auch gezeigt, dass die Anzahl nötiger Wünzwürfe $\mathcal{O}(\log n)$ garantiert.
\subsection{} %b
Die Lösung von (a) kann man sich auch als vollen binären Baum vorstellen. Es wird an jedem Knoten eine Münze geworfen, und dann entsprechend entlang des Baumes weitergegangen. Auf Ebene $k$ wurde eine Binärzahl mit Länge $k$, also innerhalb des Intervalls $[0, 2^k]$ generiert.
Ist $n$ keine Zweierpotenz, so kann kein voller Baum mehr benutzt werden, um dieses Problem zu lösen. Es muss also ein vollständiger Baum genügen. Dieser hat immernoch eine maximale Tiefe von $(\log n)$ sowie eine Münzwurfanzahl von $\mathcal{O}(\log n)$, da maximal $\lceil (\log_2 n) \rceil$-mal geworfen werden muss. Für einige Elemente des Arrays wird allerdings ein Münzwurf weniger benötigt.
\subsection{} %c
\section{} %5
\subsection{} %a
\begin{tikzpicture}[shorten >=1pt,node distance=2.8cm,on grid]
\node[state] (bleqc) {$b \leq c$};
\node[state] (aleqb) [below left=2 and 3 of bleqc] {$a \leq b$};
\node[state] (aleqc) [below right=2 and 3 of bleqc] {$a \leq c$};
\node[state] (aleqc2) [below right=of aleqb] {$a \leq c$};
\node[state] (aleqb2) [below right=of aleqc] {$a \leq b$};
\node (res1) [below left=of aleqb] {$a, b, c$};
\node (res2) [below left=of aleqc2] {$b, a, c$};
\node (res3) [below right=of aleqc2] {$b, c, a$};
\node (res4) [below left=of aleqc] {$a, c, b$};
\node (res5) [below left=of aleqb2] {$c, a, b$};
\node (res6) [below right=of aleqb2] {$c, b, a$};
\path[every node/.style={font=\scriptsize}]
(bleqc) edge node [below right=0 and 0.45 of bleqc] {Nein} (aleqc)
(bleqc) edge node [below left=0 and 0.3 of bleqc] {Ja} (aleqb)
(aleqb) edge node [below left=0 and 0.3 of aleqb] {Ja} (res1)
(aleqb) edge node [below right=0 and 0.45 of aleqb] {Nein} (aleqc2)
(aleqc) edge node [below left=0 and 0.3 of aleqc] {Ja} (res4)
(aleqc) edge node [below right=0 and 0.45 of aleqc] {Nein} (aleqb2)
(aleqc2) edge node [below left=0 and 0.3 of aleqc2] {Ja} (res2)
(aleqc2) edge node [below right=0 and 0.45 of aleqc2] {Nein} (res3)
(aleqb2) edge node [below left=0 and 0.3 of aleqb2] {Ja} (res5)
(aleqb2) edge node [below right=0 and 0.45 of aleqb2] {Nein} (res6);
\end{tikzpicture}
\subsection{} %b
Wenn das Eingabearray a, b, c und d enthielte, dann hätte der Baum 24 Blätter, also $4!$. Wenn das Eingabearray alle Buchstaben von a bis z enthielte, dann hätte der Baum $26!$ Blätter.
\end{document}

View File

@ -0,0 +1,334 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{bytefield}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage{textcomp}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usepackage{algorithm}
\usepackage{algorithmic}
\usetikzlibrary{automata,matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
\def\thesection{\arabic{section})}
\def\thesubsection{(\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
\begin{document}
\author{Reinhard Köhler (6425686), Tronje Krabbe (6435002), \\
Jim Martens (6420323)}
\title{Hausaufgaben zum 4. Dezember}
\subtitle{Gruppe 8}
\maketitle
\section{} %1
\subsection{} %a
Der Algorithmus funktioniert nicht mehr. Dies wird anhand dieses Gegenbeispiels deutlich:
\begin{verbatim}
A = [0,1,4,8,10,13]
value = 1
low = 0
high = 5
// erster Schleifendurchlauf 0 < 5, daher Rumpf ausführen
mid = (0 + 5) / 2 = 2
// A[2] = 4 > value
high = 2 - 1 = 1
// zweiter Schleifendurchlauf 0 < 1, daher Rumpf ausführen
mid = (0 + 1) / 2 = 0
// A[0] = 0 < value
low = 0 + 1 = 1
// dritter Schleifendurchlauf 1 = 1, daher Rumpf nicht ausführen
return not_found
\end{verbatim}
Obwohl das Element vorhanden ist, wird zurückgegeben, dass es nicht vorhanden sei. Da es ein Gegenbeispiel gibt, funktioniert der Algorithmus nach der Änderung von \texttt{while (low <= high)} zu \texttt{while (low < high)} nicht mehr.
\subsection{} %b
\begin{verbatim}
BinarySearch(A[0..N-1], value) {
low = N - 1
high = 0
while (high <= low) {
// invariants: value > A[i] for all i < low
value < A[i] for all i > high
mid = (low + high) / 2
if (A[mid] > value)
high = mid + 1
else if (A[mid] < value)
low = mid - 1
else
return mid
}
return not_found
}
\end{verbatim}
\subsection{} %c
\textbf{Formaler Beweis:} Wir müssen beweisen, dass die while-Schleife endet. Angenommen wir befinden uns in Iteration $i$ der while-Schleife.
\begin{itemize}
\item Zu Beginn der while-Schleife haben wir \texttt{high $\leq$ low} (andernfalls hätten wir die while-Schleife nicht betreten).
\item Nach dem Ausdruck \texttt{mid = (low + high) / 2} gilt \texttt{high $\leq$ mid $\leq$ low}.
\item Entweder die Schleife wird durch die Rückgabe von \texttt{mid} beendet, womit wir fertig wären.
\item Oder sie befindet sich in einer der ersten beiden Fälle des if-Statements. Entweder high wird um mindestens eins erhöht oder low wird um mindestens eins verkleinert, wodurch sich in jedem Schleifendurchlauf die Differenz von \texttt{low - high} um mindestens eins verringert.
\item Damit gilt \texttt{low - high < 0} nach maximal $n$ Iterationen der while-Schleife und die Schleife terminiert.
\end{itemize}
\subsection{} %d
\textbf{Beweis der Korrektheit:}
Offensichtlich gibt der Algorithmus ein korrektes Ergebnis zurück, wenn \texttt{mid} zurückgegeben wird, da dann \texttt{A[mid] $=$ value} gilt.
Zu zeigen: Wenn der Algorithmus \texttt{not\_found} zurückgibt, dann kommt \texttt{value} tatsächlich nicht in dem Array vor.
Wir werden dies nun durch die Gegenposition beweisen: Wir müssen zeigen, dass wenn \texttt{value} im Array vorkommt, der Algorithmus \texttt{mid} zurückgibt.
\textbf{Erster Schritt:} Es ist einfach zu sehen, dass die folgenden Invarianten immer gelten:
\begin{itemize}
\item \texttt{value > A[i] for all i < low (strict inequality!)}
\item \texttt{value < A[i] for all i > high (strict inequality!)}
\end{itemize}
\textbf{Zweiter Schritt:} Annahme, dass \texttt{value} im Array vorkommt.
\begin{itemize}
\item Bereits bekannt: Invarianten sind wahr. Das bedeutet zu keinem Zeitpunkt im Algorithmus kann sich das Element, das wir suchen, links von \texttt{high} oder rechts von \texttt{low} befinden.
\item Der einzige Weg, wie wir theoretisch das gesuchte Element "`verpassen"' könnten, wäre, dass \texttt{high = mid + 1} oder \texttt{low = mid - 1} zu der Situation führen, dass \texttt{high > low} gilt bevor wir das gesuchte Element gefunden haben (weil wir dann die Schleife verlassen).
\begin{itemize}
\item Durch die Konstruktion des Algorithmus haben wir immer \texttt{high $\leq$ mid $\leq$ low} nachdem \texttt{mid = (low + high) / 2} ausgeführt wurde.
\item Solange \texttt{low $\geq$ high + 2} gilt, haben wir immer \texttt{high < mid < low}.
In dieser Situation, \texttt{mid - 1 $\geq$ high} und \texttt{mid + 1 $\leq$ low}, haben wir immer noch \texttt{high $\leq$ low} nachdem entweder \texttt{high = mid + 1} oder \texttt{low = mid - 1} ausgeführt wurden, sodass die while-Schleife ein weiteres Mal betreten wird.
Es gibt zwei kritische Fälle, in denen wir die Schleife verlassen könnten:
\begin{itemize}
\item \texttt{low = high}. Aber dann gilt auch \texttt{mid = high}. Nach der Annahme, dass \texttt{value} im Array ist, muss \texttt{A[high] = value} gelten. Durch die Rückgabe von \texttt{mid} wird demnach genau der richtige Index zurückgegeben.
\item \texttt{low = high + 1}. In diesem Fall gilt \texttt{mid = high}. Nun gilt entweder \texttt{A[high] = A[mid] = value}, wodurch durch Rückgabe von \texttt{mid} das richtige Ergebnis zurückgegeben würde, oder es gilt \texttt{A[high] = A[mid] > value}, wodurch \texttt{high} um eins erhöht würde, was beim nächsten Schleifendurchlauf im Fall \texttt{low = high} enden würde. In dem Fall wird das korrekte Ergebnis zurückgegeben, wie bereits gezeigt wurde.
\end{itemize}
\end{itemize}
\item Dies zeigt, dass wenn \texttt{value} im Array vorhanden ist, der Algorithmus immer damit endet \texttt{mid} zurückzugeben.
\end{itemize}
\section{} %2
\subsection{} %a
\subsubsection{} %i
In einem Graph ohne Kanten kann jeder Knoten gleich gefärbt sein. Dies gilt, weil die Bedingung $c_{k}(i= \neq c_{k}(j)$ nur gilt, wenn $i$ und $j$ mit einer Kante verbunden sind, was in solch einem Graphen nicht gegeben ist. Daher ist hier nichts zu zeigen.
\subsubsection{} %ii
Wenn ein Graph k-färbbar ist, dann kann man auch eine weitere Farbe in die Abbildung $c_{k}$ hinzunehmen ohne sie zu benutzen. Dies gilt da $c_{k}$ nicht surjektiv sein muss.
\subsubsection{} %iii
Man nehme einen k-färbbaren Graphen. Nun kann man solange weitere Farben hinzufügen, bis n Farben in der Abbildung vorkommen. Diese müssen jedoch nicht benutzt werden. Daher ist jeder Graph n-färbbar.
\subsection{} %b
\subsubsection{} %i
Wenn ein Graph 2-färbbar ist, dann gibt es keine Zyklen ungerader Länge. Bei einem Zyklus gerader Länge kann jeder zweiter Knoten die gleiche Farbe haben, ohne mit einem Knoten verbunden zu sein, der die gleiche Farbe hat.
Alle Knoten mit einer Farbe kann man als eine Untermenge einer Abbildung eines bipartiten Graphen verstehen.
\subsubsection{} %ii
\begin{verbatim}
IST_2FAERBUNG(G) {
kanten = E(G)
valid = true
farben = new Set()
foreach kante in kanten {
knoten1 = kante.knoten1
knoten2 = kante.knoten2
farben.add(knoten1.farbe)
farben.add(knoten2.farbe)
if (knoten1.farbe == knoten2.farbe) {
valid = false
break
}
}
return (valid && (farben.getAnzahl() == 2))
}
\end{verbatim}
\subsubsection{} %iii
Es gibt 2 verschiedene 2-Färbungen, sofern man unterschiedliche Farben nicht als Unterschied ansieht. Pro 2 Farben gibt es genau 2 verschiedene Färbungen.
\subsection{} %c
Bei einer beliebigen Landkarte werden mindestens vier Farben benötigt, damit direkt benachbarte Länder stets unterschiedliche Farben haben.
\subsubsection{} %i
\begin{tikzpicture}
\node (altona) {A};
\node (eimsbuettel) [above right=of altona] {E};
\node (nord) [right=of eimsbuettel] {N};
\node (wandsbek) [right=of nord] {W};
\node (mitte) [below=of eimsbuettel] {M};
\node (harburg) [below left=of mitte] {H};
\node (bergedorf) [below right=of mitte] {B};
\path[every node/.style={font=\scriptsize}]
(altona) edge (mitte)
(altona) edge (eimsbuettel)
(mitte) edge (harburg)
(mitte) edge (bergedorf)
(mitte) edge (eimsbuettel)
(mitte) edge (nord)
(mitte) edge (wandsbek)
(eimsbuettel) edge (nord)
(nord) edge (wandsbek);
\end{tikzpicture}
\subsubsection{} %ii
\begin{alignat*}{2}
c_{k}(A) &=& gelb \\
c_{k}(E) &=& rot \\
c_{k}(M) &=& blau \\
c_{k}(H) &=& rot \\
c_{k}(B) &=& rot \\
c_{k}(N) &=& gelb \\
c_{k}(W) &=& rot
\end{alignat*}
\subsubsection{} %iii
Die Aussage, dass vier Farben minimal sind, besagt nur, dass man es bei einer beliebigen Landkarte schafft diese mit maximal vier Farben zu färben. Es gibt die Obergrenze der nötigen Farben an. Die Regel besagt hingegen nicht, dass immer mindestens vier Farben benötigt werden. Bei einer Landkarte mit nur zwei aneinandergrenzenden Ländern reichen auch zwei Farben. Bei einer Karte mit nur einer zusammenhängenden Fläche ohne angrenzende Flächen reicht sogar eine Farbe.
\subsubsection{} %iv
\begin{tikzpicture}
\node (sh) {SH};
\node (hh) [below right=of sh] {HH};
\node (meck) [right=of hh] {MP};
\node (bremen) [below left=of hh] {B};
\node (nieder) [below=of hh] {N};
\path[every node/.style={font=\scriptsize}]
(sh) edge (hh)
(sh) edge (meck)
(hh) edge (nieder)
(bremen) edge (nieder)
(sh) edge (nieder)
(bremen) edge (sh)
(bremen) edge (hh);
\end{tikzpicture}
In dieser konstruierten Karte (dargestellt als Graph), müssen mindestens vier Farben verwendet werden.
\section{} %3
\subsection{} %a
\[
G_{1}: 1, 3, 4, 5, 2, 8, 6, 7
\]
\[
G_{2}: 1, 3, 5, 6, 4, 7, 2
\]
\subsection{} %b
\[
G_{1}: 4, 3, 7, 6, 8, 2, 5, 1
\]
\[
G_{2}: 4, 6, 5, 3, 2, 7, 1
\]
\subsection{} %c
\[
G_{1}: 1, 3, 5, 4, 2, 7, 8, 6
\]
\[
G_{2}: 1, 3, 4, 7, 5, 2, 6
\]
\subsection{} %d
Für $G_1$ existiert keine topologische Sortierung, da es sich nicht um einen DAG (Directed acyclic graph) handelt. Dies erkennt man daran, dass beispielsweise ein Zyklus von 1 über 5 über 2 zurück zur 1 existiert. $\square$
Für $G_2$ existieren topologische Sortierungen, z.B.:
\[
1, 3, 5, 6, 4, 7, 2
\]
\subsection{} %e
Wie bereits etabliert, existieren für $G_1$ keine mit ihm konsistenten topologischen Sortierungen. Für $G_2$ allerdings existieren mehrere:
Nach Proposition 5 (Uniqueness of topological Sort) im Skript, Folie 163, ist eine topologische Sortierung nur eindeutig, wenn der dazugehörige Graph einen Hamilton-Kreis enthält. $G_2$ enthält keinen Hamilton-Kreis. Dies ist leicht zu erkennen: es gibt keinen Pfad in dem Graphen, der die Knoten $2$ \textit{und} $3$ besucht. Daher gibt es mehrere topologische Sortierungen.
Eine weitere wäre z.B.:
\[
1, 7, 2, 5, 6, 4, 3
\]
\subsection{} %f
starke Zusammenhangskomponenten von $G_{1}:$
\begin{alignat*}{2}
comp1:&&\; 1, 2, 5, 6, 7, 8 \\
comp2:&&\; 3 \\
comp3:&&\; 4
\end{alignat*}
starke Zusammenhangskomponenten von $G_{2}:$
\begin{alignat*}{1}
comp1: 1 \\
comp2: 2 \\
comp3: 3 \\
comp4: 4 \\
comp5: 5 \\
comp6: 6 \\
comp7: 7
\end{alignat*}
\section{} %4
\subsection{} %a
% Senken finden (alle Senken infiltrieren, dadurch werden alle Module eliminiert)
% Algorithmus aus Vorlesung benutzen
Es müssen alle Module (oder Knoten) ohne eingehende Kanten eliminiert (bzw. markiert) werden, da diese andernfalls nie erreicht werden können. Zu allen anderen Knoten muss es gerichtete Pfade von einem dieser Knoten geben. Ausnahmen können starke Zusammenhangskomponenten bilden. In jeder starken Zusammenhangskomponente wird daher ebenfalls ein Knoten eliminiert.
\newpage
\begin{verbatim}
function eliminiereMCP() {
int zaehler = 0
list infiltrierteKnoten
// füge alle Knoten ohne Vorgänger hinzu:
for-all v in Knotenmenge:
if v.eingehendeKanten == 0:
infiltriere(v)
infiltrierteKnoten.add(v)
end if
end for-all
// füge einen Knoten aus jeder
// starken Zusammenhangskomponente hinzu:
list starkZusammenhaengend = findeStarkeZusammenhangskomponenten()
for-all elemente in starkZusammenhaengend:
for i = 0; i < elemente.length; i++
if infiltrierteKnoten.contains(elemente[i]):
zaehler++
end if
if zaehler == 0:
infiltriere(elemente[0])
infiltrierteKnoten.add(elemente[0])
end if
end for
end for-all
eliminiere(infiltrierteKnoten)
}
\end{verbatim}
\subsection{} %b
Wenn alle Senken infiltriert werden, werden dadurch alle Module eliminiert, da alle Module direkt oder indirekt mit mindestens einer Senke verbunden sind.
\subsection{} %c
Es müssen alle Senken infiltriert werden, da ansonsten einzelne Module nicht eliminiert werden könnten.
\section*{Zusatzaufgabe} %Zusatz
Beweis der Terminierung für beliebige natürliche Zahlen größer $0$.\\
Trivialer Fall: \\
Der Algorithmus terminiert für $n=1$. \\
Zweiter Fall: \\
Der Algorithmus terminiert für $2^{c} = n$. Dies gilt, da damit nach $c$ Rekursionsschritten immer $n=1$ gilt. \\
Dritter Fall: \\
Es ist zu zeigen, dass nach endlich vielen Rekursionsschritten \textsc{Coll} mit einer 2er-Potenz aufgerufen wird.
Dazu lohnt es sich die verbleibenden Zahlen bis 10 anzuschauen.
\begin{alignat*}{2}
3 \rightarrow 10 \rightarrow 5 \rightarrow 16 \\
5 \rightarrow 16 \\
6 \rightarrow 3 \\
7 \rightarrow 22 \rightarrow 11 \rightarrow 34 \rightarrow 17 \rightarrow 52 \rightarrow 26 \rightarrow 13 \rightarrow 40 \rightarrow 20 \rightarrow 10 \rightarrow 5 \rightarrow 16 \\
9 \rightarrow 28 \rightarrow 14 \rightarrow 7 \\
10 \rightarrow 5
\end{alignat*}
Was kann aus dieser Reihe geschlossen werden? Alle Zahlen, die aus dem Produkt einer 2er-Potenz und einer dieser Zahlen entstehen, lassen sich auf eine 2er-Potenz zurückführen. Auf diese Weise könnte man für die ersten $d$ natürlichen Zahlen zeigen, dass sie sich alle auf eine 2er-Potenz zurückführen lassen.
Aufgrund dieser Annahme steigt die Wahrscheinlichkeit bei einem Rekursionsaufruf mit $3n+1$ auf ein solches Vielfaches einer bereits auf eine 2er-Potenz zurückgeführte Zahl zu stoßen.
Da es jedoch unendlich viele Primzahlen gibt, wenngleich sich deren Abstand zueinander immer weiter erhöht, findet man immer Zahlen, die noch nicht auf eine 2er-Potenz zurückgeführt sind. Aufgrund dieser Tatsache kann es keine allgemeingültige Aussage für alle natürlichen Zahlen geben. Allerdings kann dieser Algorithmus selbst als Antwort verstanden werden. Für eine beliebig große Zahl, die nicht ein gerades Vielfaches einer bereits zurückgeführten Zahl ist, muss daher nur der Algorithmus ausgeführt werden bis ein solches Vielfaches erreicht wurde.
Nach endlich vielen Schritten wird dies praktisch der Fall sein, wenngleich die Anzahl dieser Schritte dramatisch zunehmen wird. Es ist jedoch nicht möglich dafür einen theoretischen Beweis zu finden, der ebenjene Tatsache darlegen kann.
\end{document}

View File

@ -27,35 +27,36 @@
\makeatother
\begin{document}
\author{Tronje Krabbe, Jim Martens}
\author{Tronje Krabbe, Jim Martens (6420323)}
\title{Hausaufgaben zum 22. Oktober}
\subtitle{Gruppe 8}
\maketitle
\section{} %1
\subsection{} %a
$\frac{1}{n} \prec 1$, da man immer eine Konstante $c$ finden kann, für die ab einem $n$ alle weiteren Funktionswerte von $\frac{1}{n}$ unter $c \cdot \mathcal{O}(1)$ liegen.
$1 \prec \log\log n$, da der Logarithmus schneller wächst als eine konstante Funktion und jeder Logarithmus langsamer wächst als eine polynomielle Funktion. Der doppelte Logarithmus wächst noch langsamer als der einfache Logarithmus.
$\log\log n \prec \log n$, da der einfache Logarithmus schneller wächst als der doppelte Logarithmus.
$\log n \asymp \log(n^{3})$, da sich die beiden nur um einen konstanten Faktor $3$ unterscheiden.
$\log(n^{3}) \prec \log(n^{\log n})$, da $\frac{\log n \cdot \log n}{3 \cdot \log n}$ gegen unendlich geht.
$\log(n^{\log n}) \prec n^{0.01}$, da jeder Logarithmus langsamer wächst als eine polynomielle Funktion.
$n^{0.01} \prec \sqrt{n}$, da $\frac{n^{0.5}}{n^{0.01}}$ nach dem Kürzen gegen unendlich geht.
$\sqrt{n} \prec n \cdot \log n$, da $\frac{n \cdot \log n}{n^{0.5}}$ nach dem Kürzen gegen unendlich geht.
$n \cdot \log n \prec n^{8}$, da $\frac{n^{8}}{n \cdot \log n}$ nach dem Kürzen gegen unendlich geht, weil jeder Logarithmus langsamer wächst als jede polynomielle Funktion.
$n^{8} \prec 2^{n}$, da jede Exponentialfunktion schneller wächst als jede polynomielle Funktion.
$2^{n} \prec 8^{n}$, da $8 > 2$, womit $8^{n}$ klar ersichtlich schneller wächst als $2^{n}$.
$8^{n} \prec n!$, da $\frac{n \cdot (n-1) \cdot ... \cdot 3 \cdot 2 \cdot 1}{8 \cdot 8 \cdot ... \cdot 8 \cdot 8 \cdot 8}$ ganz offensichtlich gegen unendlich geht.
$n! \prec n^{n}$, da $\frac{n \cdot n \cdot n \cdot ... \cdot n \cdot n}{n \cdot (n-1) \cdot (n-2) \cdot ... \cdot 2 \cdot 1}$ ebenfalls gegen unendlich geht.
\subsection{} %b
\subsubsection{} %i
@ -64,8 +65,8 @@
\subsubsection{} %ii
Behauptung: $f \in \mathcal{O}(g) \Rightarrow g \in \omega (f)$\\
Diese Behauptung gilt nicht. Dies kann mithilfe der Definition der Landau-Symbole erklärt werden. $f \in \mathcal{O}(g)$ besagt, dass $f$ maximal so schnell wie $g$ wächst. Dabei ist auch der Fall enthalten, dass $f$ und $g$ gleich schnell wachsen.
Der zweite Teil der Behauptung erfordert jedoch, dass $g$ in jedem Fall schneller als $f$ wächst. Dies steht aber im Widerspruch zu dem ersten Teil der Behauptung. Damit ist die Behauptung widerlegt.
Der zweite Teil der Behauptung erfordert jedoch, dass $g$ in jedem Fall schneller als $f$ wächst. Dies steht aber im Widerspruch zu dem ersten Teil der Behauptung. Damit ist die Behauptung widerlegt.
\subsubsection{} %iii
Behauptung: $f_{c}(n) \in \theta(n) \Leftrightarrow c = 1$.\\
Dies ist einfach zu zeigen:\\
@ -73,7 +74,7 @@
\sum\limits_{i=0}^{n} 1^{i} &=& 1 + 1 + 1 + ... + 1 = n + 1
\end{alignat*}
Denn für $c=1$ werden einfach $n+1$ Einsen aufsummiert. Die Summe $n+1$ wächst asymptotisch genau so schnell wie $n$, da die Konstante $1$ vernachlässigt werden kann.
\section{} %2
\subsection{} %a
\underline{Behauptung:} $F_{n} \geq 2^{0.5n} : \forall n \geq 6$\\
@ -102,7 +103,7 @@
\end{alignat*}
Damit ist die Behauptung sowohl für den Induktionsanfang als auch für ein beliebiges $n$ gezeigt.
\subsection{} %b
\section{} %3
\subsection{} %a
\underline{Behauptung:} Die Formel
@ -116,7 +117,7 @@
\end{pmatrix}^{n} \cdot \begin{pmatrix}
F_{0} \\
F_{1}
\end{pmatrix}
\end{pmatrix}
\end{alignat*}
gilt für $n \geq 0$.\\
\underline{Induktionsanfang:}\\
@ -144,7 +145,7 @@
\end{pmatrix}
\end{alignat*}\\
\underline{Induktionsannahme:} Die Behauptung gilt für ein beliebig fest gewähltes $n$.\\
\underline{Zu zeigen:}
\underline{Zu zeigen:}
\begin{alignat*}{2}
\begin{pmatrix}
F_{n+1} \\
@ -155,7 +156,7 @@
\end{pmatrix}^{n+1} \cdot \begin{pmatrix}
F_{0} \\
F_{1}
\end{pmatrix}
\end{pmatrix}
\end{alignat*}
\underline{Induktionsschritt:}
\begin{alignat*}{2}
@ -188,7 +189,7 @@
F_{1}
\end{pmatrix}
\end{alignat*}
Nach dem Induktionsprinzip folgt aus dem Induktionsanfang und dem Induktionsschritt die Behauptung.
Nach dem Induktionsprinzip folgt aus dem Induktionsanfang und dem Induktionsschritt die Behauptung.
\subsection{} %b
$X^{64}$ kann geschickter berechnet werden, wenn man die Ergebnisse von vorigen Multiplikationen speichert. Damit lässt sich $X^{64}$ auf diese Weise berechnen:\\
\begin{alignat*}{3}
@ -205,7 +206,7 @@
& X^{72} &\cdot & X^{2} &=& X^{74}
\end{alignat*}
Demnach würden bei $74$ acht Multiplikationen benötigt.
Daraus kann die allgemeine Formel für die Anzahl der Multiplikationen $F(n)$ gebildet werden:\\
\begin{alignat*}{2}
F(n) &=& \begin{cases}
@ -214,9 +215,9 @@
\end{cases}
\end{alignat*}
Diese rekursive Formel könnte auch als Schleife dargestellt werden. Durch die Halbierung von n bei jedem Durchgang hat die Funktion eine logarithmische Laufzeit. Die Addition ist dabei irrelevant, wenn man sich das asymptotische Verhalten ansieht.
Damit ist die Behauptung, dass $\mathcal{O}(\log n)$ Multiplikationen ausreichen um $X^{n}$ zu berechnen, gezeigt.
\subsection{} %c
In 3b haben wir gezeigt, dass sich $X^{n}$ in $\mathcal{O}(\log n)$ Multiplikationen ausgerechnen lässt. Daraus lässt sich schließen, dass sich auch die 2x2 Matrix in $\star$ in logarithmischer Zeit errechnen lässt. Eine weitere Multiplikation macht dann auch keinen Unterschied mehr. Daher lässt sich $\star$ in logarithmischer Zeit lösen. Da jeder Logarithmus langsamer wächst und damit schneller ist als eine Potenzfunktion, ist das Matrizen-Verfahren damit echt schneller als das in der Vorlesung vorgestellte Verfahren.
\end{document}

View File

@ -0,0 +1,128 @@
\documentclass[ngerman]{gdb-aufgabenblatt}
\renewcommand{\Aufgabenblatt}{1}
\renewcommand{\Ausgabedatum}{Mi. 16.10.2013}
\renewcommand{\Abgabedatum}{Fr. 01.11.2013}
\renewcommand{\Gruppe}{Tim Dittrich, Sebastian Lindemann, Jim Martens}
% define how the sections are rendered
\def\thesection{Aufgabe \arabic{section}:}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
\begin{document}
\section{Informationssysteme}
\subsection{} %a
Ein Informationssystem zeichnen sich durch Kommunikationsbeziehungen zwischen Menschen und Maschine aus. Rechnergestützte Informationssysteme beinhalten automatisierte Anwendungssysteme, welche zur Beschaffung, Speicherung, Veränderung und Veranschaulichung von Informationen genutzt werden.
Die Informationen dienen dazu zielorientiertes Wissen zu generieren. Dieses Wissen dient dann wiederum zur Vorbereitung und Durchführung von Handlungen und Entscheidungen. Somit werden Informationssysteme beispielsweise genutzt um Arbeitsabläufe im Unternehmen zu organisieren und unterstützen.
\subsection{} %b
Legt man die 3-Schicht-Architektur eines Datenbankmanagementsystems (DBMS), mit der Sicht-Ebene, logischen Ebene und physischen Ebene zu Grunde, so kann man generell Datenunabhängigkeit als die Immunität der einzelnen Schichten auf Änderungen innerhalb der nächsten tieferen Schicht beschreiben. Um im Folgenden den Unterschied zwischen der logischen und physischen Datenunabhängigkeit leichter verdeutlichen zu können folgendes Szenario:
Es gebe eine Anwendung zum Verwalten von Immobilien für Immobilienmakler. Dabei gibt es 2 Sichten auf die Daten (Sicht-Ebene). Einmal die "`Chefsicht"' auf alle Daten und die "`Verkäufersicht"' auf nur ein Teil der Daten. Alle Immobilen werden in einer Tabelle gespeichert (logische Ebene) und es werden verschiedene Indexstrukturen und Algorithmen für die Optimierung von Abfragen verwendet (physische Ebene).
Die physische Datenunabhängigkeit bezieht sich auf die beiden unteren Ebenen (logische- und physische-Ebene). Wird beispielsweise der Speicherort einzelner Daten aus optimierungstechnischen Gründen geändert, hat dies kein Einfluss auf das festgelegte Schema. Die beiden Ebenen sind also voneinander entkoppelt.
Die logische Datenunabhängigkeit bezieht sich auf die beiden oberen Schichten (Sicht-und logische-Ebene). Kommt es zu einer Änderung im Schema, beispielsweise es wird ein Attribut in der Tabelle hinzugefügt, hat dies im Idealfall keinen Einfluss auf die einzelnen Sichten. In der Praxis ist dies nicht immer ganz so leicht umsetzbar. Aber die logische Datenunabhängigkeit hat große Vorteile, so muss im besten Fall nichts an der Anwendung geändert werden wenn es zu einer Änderung am Schema kommt.
\subsection{} %c
Informationssysteme werden zum Beispiel im öffentlichen Nahverkehr verwendet, um den Informationsbedarf von Passagieren bezüglich Fahrplanauskunft oder anderen Informationsinhalten zu befriedigen. Steht ein Passagier an einer Bushaltestelle werden ihm beispielsweise mit Hilfe geeigneter Informations- und Kommunikationstechnik mögliche Verspätungen oder die Ankunftszeit des nächsten Busses auf einem Bildschirm angezeigt. Hierfür reicht es nicht statische Daten in einer Datenbank abzulegen, sondern es werden dynamische Informationen über den derzeitigen Aufenthaltsort der einzelnen Busse benötigt. Dies geschieht in der Praxis mit modernen Sende- und Empfangseinheiten.
Auch im Gesundheitswesen kommen Informationssysteme zum Einsatz, um Patienteninformationen zu verwalten und am richtigen Ort zur richtigen Zeit zur Verfügung zu stellen. Zum einen werden bei der Ankunft von Patienten im Krankenhaus neue Daten über deren derzeitigen Gemütszustand erhoben, zum anderen ist es besonders wichtig für einen behandelnden Arzt Einsicht in die Patientenakte zu haben, um über mögliche Vorerkrankungen informiert zu sein.
Es ist vorstellbar, dass aus der Patientenakte die wichtigsten Informationen automatisiert zusammengefasst und in geeigneter Form kompakt dem Arzt dargestellt werden. An diesem Beispiel wird sehr gut die Kommunikationsbeziehung zwischen Mensch und Maschine deutlich.
Ein weiteres Anwendungsbeispiel ist die intelligente Routenplanung im Logistikwesen. Der Ölpreis steigt seit Jahren und es wird dadurch immer wichtiger Treibstoff einzusparen. Hierbei kommen nicht nur mathematische Optimierungsverfahren zum Einsatz, um eine möglichst kurze Strecke zu berechnen, sondern auch beispielsweise die Bewertung aktueller Verkehrsinformationen um Staus oder Sperrungen mit in die Routenplanung einzubeziehen. Hierfür kommen natürlich wieder Informationssysteme zum Einsatz. Auch interessant ist der Einsatz bei der Live-Planung wobei Routen geändert werden können, um zusätzliche Aufträge mit in die geplante Route zu integrieren.
\section{Miniwelt}
\subsection{} %a
Anhand der Beschreibung der Miniwelt werden folgende Objekttypen benötigt, die jeweils explizite oder implizite Funktionalitäten haben.
\begin{itemize}
\item Mitglieder: können sich am System anmelden und müssen daher identifizierbar sein (Name, EMail, Passwort)
\item Tippspielgemeinschaften: haben einen Namen und einen Gründer, der ein Mitglied ist
\item Wettbewerbe: werden einer Tippspielgemeinschaft zugeordnet
\item Begegnungen: werden einem Wettbewerb zugeordnet, beinhalten die Info wer gegen wen spielt und was für ein Ergebnis herauskommt
\item Tipps: werden einem Mitspieler und einer Begegnung zugeordnet und enthalten den eigentlichen Tipp
\item Punkte: werden einem Mitspieler und einer Tippspielgemeinschaft zugeordnet und enthalten die Punkte des Mitspielers in der Gemeinschaft
\end{itemize}
Ergänzend zu den genannten Objekttypen, die je eine Tabelle im konzeptuellen Schema ausmachen, gibt es noch eine Tabelle, die Mitglieder den Tippspielgemeinschaften zuordnet.
Folgende Vorgänge müssen durch die Anwendung abgebildet werden:
\begin{itemize}
\item Anmeldung bei Anwendung
\item Registrierung bei Anwendung
\item Gründen einer Tippspielgemeinschaft
\item Erstellen eines Wettbewerbs für eine Gemeinschaft
\item Erstellen von Begegnungen für einen Wettbewerb
\item Eintragen von Ergebnissen für eine Begegnung
\item Hinzufügen von Mitspielern zu einer Gemeinschaft
\item Entfernen von Mitspielern aus einer Gemeinschaft
\item Tipp auf eine Begegnung in einem Wettbewerb in einer Gemeinschaft, der der Mitspieler angehörig ist, abgeben
\item Betrachten des Punktestandes innerhalb einer Gemeinschaft
\item Ergebnisse von Begegnungen ansehen
\end{itemize}
Das Errechnen der Punkte erfolgt im gleichen Atemzug wie das Eintragen von Ergebnissen und geschieht ohne Zutun des Bedieners.
\subsection{} %b
Zunächst werden die Anforderungen an die Anwendung erfasst, um dann die in der Vorlesung genannten allgemeinen Anforderungen an Datenbanksysteme anhand des hier beschriebenen Beispiels zu diskutieren.
\begin{itemize}
\item Die Anwendung muss als Mehrbenutzersystem konzipiert werden und gleichzeitige Anfragen von unterschiedlichen Nutzern bearbeiten können.
\item Ebenso muss die Anwendung bei jeder Anfrage darauf achten nur die Inhalte zurückzugeben, auf die der anfragende Benutzer Zugriff hat. So sollte ein Benutzer nur Tipps in einer Gemeinschaft abgeben können, wenn er Teil dieser Gemeinschaft ist.
\item Nachdem die Ergebnisse einer Begegnung eingetragen worden sind, darf kein Mitspieler mehr Tipps setzen oder vorhandene ändern können.
\item Sobald Ergebnisse eingetragen wurden, kann die Begegnung nicht mehr gelöscht werden, da sie bereits stattgefunden hat.
\item Der Gründer einer Tippspielgemeinschaft kann nicht aus eben jener Gemeinschaft austreten.
\item Die Punkte dürfen nur automatisch durch die Anwendung berechnet werden. Ein manuelles Verändern darf nicht möglich sein (weder vom betreffenden Mitspieler noch vom Gründer der Gemeinschaft).
\item Wenn der Browser vor dem Abschließen einer Aktion geschlossen wird, darf nichts verändert werden.
\end{itemize}
Diese Anforderungen sind zum einen Teil anwendungsspezifisch und zum anderen Teil allgemein für jede Anwendung mit persistenten Daten wichtig.
Da die Anforderungen an die Anwendung nun bekannt sind, werden die Anforderungen an Datenbanksysteme nun an diesem Beispiel diskutiert.
So müssen Datenbanksysteme einen Schutz vor inkonsistenten Daten bieten. So wird eine Transaktion erst dann zur Persistierung freigegeben, wenn sie komplett erfolgreich durchlief. Sollte der Browser während einer Transaktion geschlossen werden, wird sie nicht abgeschlossen und damit nicht persistiert.
Außerdem müssen gleichzeitige Anfragen problemlos bearbeitet werden, solange sie nicht im Konflikt stehen. Eine Abfrage von Ergebnissen einer Begegnung steht beispielsweise nicht im Konflikt mit dem Hinzufügen eines Mitspielers in eine Gemeinschaft oder dem Registrieren eines neuen Mitglieds. Um Konflikte zu vermeiden ist eine weitgehende Isolierung im Datenbanksystem von Nöten.
Die Rechteverwaltung hängt von der Implementation ab. Die oben angewandte Methode benutzt einen Anwendungszugang zur Datenbank, womit die Zugriffskontrolle auf die Anwendung übergeht. Theoretisch wäre auch ein Datenbankzugang pro Benutzer denkbar, der dann eben nur entsprechende Rechte hätte. Allerdings wäre dies ein unnötiger Datenbankzugang, der zudem auch nur das konzeptuelle Schema berücksichtigt. So könnte ein Nutzer entweder alle Punkte aller Mitglieder ansehen oder keine.
Die externe Anwendungssicht auf die Daten umfasst hingegen eine logische Sicht, die auf das Fallbeispiel zugeschnitten ist. Daher sind die Zugriffskontrollen des Datenbanksystems viel zu vage, um sinnvoll für das Beispiel geeignet zu sein. Deswegen muss die Zugriffskontrolle hier auf Seiten der Anwendung stattfinden, die dann nur erlaubte Anfragen an das Datenbanksystem sendet.
\section{Transaktionen}
Zunächst betrachten wir den Stromausfall zum Zeitpunkt A. Daraus ergeben sich mehrere Fälle. Die ersten beiden Fälle betrachten immer ein Datenbanksystem, die letzten beiden immer ein Dateisystem.
\begin{itemize}
\item Das System hat die Änderung am Konto mit der ID 5 nicht persistent gespeichert. Sie bleibt also im Hauptspeicher, bzw. wird daraus gelöscht bei dem Stromausfall. Somit wird die Überweisung nicht durchgeführt und es herrscht der Ausgangszustand.
\item Das System hat die Änderungen am Konto mit der ID 5 persistent gespeichert. Die Daten werden auf die Festplatte geschrieben. Es gibt nach der Abbuchung der 1000 Euro einen Stromausfall. Das System "`merkt"' sich diesen Zeitpunkt. Nach erneutem Start des Systems wird der letzte bekannte Zustand rekonstruiert und danach in den Ausgangszustand zurück versetzt.
\item Das System hat die Änderung am Konto mit der ID 5 noch nicht persistent gespeichert. Sie bleibt also im Hauptspeicher, bzw. wird daraus gelöscht bei dem Stromausfall. Somit wird die Überweisung nicht durchgeführt und es herrscht der Ausgangszustand.
\item Das System hat die Änderung am Konto mit der ID 5 persistent gespeichert. Also die Daten bereits auf die Festplatte geschrieben. Somit werden 1000 Euro vom Konto mit der ID 5 abgebucht. Da aber kein Datenbanksystem verwendet wird, gibt es keinen Wiederaufnahmepunkt, an welchem das System wiedereinsteigen könnte. Somit werden keine 1000 Euro dem Konto mit der ID 7 gutgeschrieben und das Geld ist weg.
\end{itemize}
Anschließend betrachten wir den Stromausfall B.
\begin{itemize}
\item Das System hat die Änderung an beiden Konten nicht persistent gespeichert. Sie bleibt also im Hauptspeicher; bzw. wird daraus gelöscht bei dem Stromausfall. Somit wird die Überweisung nicht durchgeführt und es herrscht der Ausgangszustand. Es gibt aber eine falsche Meldung dem Clienten gegenüber für den Kontostand des Kontos mit der ID 7.
\item Das System hat die Änderungen an beiden Konten persistent gespeichert. Die Daten werden auf die Festplatte geschrieben. Es gibt nach der Überweisung einen Stromausfall. Jedoch wurde der Print Vorgang für das Konto mir der ID 5 nicht abgeschlossen. Dieser würde eine benutzerdefinierte Meldung an den Clienten zurückgeben. Da der Komplette Vorgang noch nicht abgeschlossen war werden beide Konten wieder in ihren Ausgangszustand zurück versetzt. Es gibt somit aber eine falsche Meldung dem Clienten gegenüber für den Kontostand des Kontos mit der ID 7.
\item Das System hat die Änderungen an beiden Konten nicht persistent gespeichert. Sie bleibt also im Hauptspeicher, bzw. wird daraus gelöscht bei dem Stromausfall. Somit wird die Überweisung nicht durchgeführt und es herrscht der Ausgangszustand. Es gibt somit aber eine falsche Meldung dem Clienten gegenüber für den Kontostand des Kontos mit der ID 7.
\item Das System hat die Änderungen an beiden Konten persistent gespeichert. Somit werden an beiden Konten die richtigen Aktionen durchgeführt. Das Konto mit der ID 5 wird mit 1000 Euro belastet und das Konto mit der ID 7 werden 1000 Euro gutgeschrieben. Jedoch gibt es vor dem Printbefehl für das Konto mit der ID 5 den Stromausfall. Der letzte Zustand kann nicht wiederhergestellt werden und somit fehlt dieser Print Befehl und der Client bekommt den falschen Kontostand für dieses Konto angezeigt.
\end{itemize}
Zusammenfassend kann gesagt werden, dass es bei einem Datenbanksystem zu jedem Zeitpunkt immer nur konsistente Daten gibt. Bei einem reinen Dateisystem können die Daten hingegen inkonsistent zurückgelassen werden.
\section{Warm-Up MySQL}
\subsection{} %a
Es wurde eine Tabelle mit dem Namen \texttt{user} in der Datenbank \texttt{gdb\textunderscore gruppe062} angelegt, die drei Felder (id, name, passwort) hat. Anschließend wurde ein Nutzer in diese Tabelle eingetragen mit den Werten (1 für id, "`gdbNutzer"' für name und "`geheim"' für passwort).
\subsection{} %b
Zunächst wurde die Zeile mit dem eben angelegten Nutzer komplett ausgelesen und anschließend die user-Tabelle gelöscht.
\subsection{} %c
Die MySQL-Architektur hat einen ähnlichen Aufbau wie die ANSI-SPARC Architektur. Das Dateisystem entspricht der internen Ebene. Die Speicherengines repräsentieren diese interne Ebene gegenüber der konzeptuellen Ebene und abstrahieren die tatsächliche Speicherung der Daten.
Damit stellen die Engines auch das Zugriffssystem dar. Die Metadatenverwaltung findet sich bei den Verwaltungsdiensten und -tools. Der Verbindungspool ist eine spezifische Implementation für Mehrbenutzersysteme, sodass mehrere Verbindungen gleichzeitig mit der Datenbank verbunden sein können. Auf dieser Ebene findet auch die Authentifizierung statt.
Über den Verbindungspool, welcher die technische Schnittstelle zu externen Anwendungen darstellt, gelangen die Anfragen zu einer Zwischenebene, die die Anfragen parsed, optimiert und gegebenenfalls bereits gecachte Daten zurückgibt. Diese Ebene ist dafür zuständig die Datenbankzugriffe so effizient und schnell wie möglich zu gestalten. Damit ist diese Ebene das Datensystem des ANSI-SPARC Modells.
\end{document}

View File

@ -0,0 +1,111 @@
\documentclass[ngerman]{gdb-aufgabenblatt}
\usepackage{tikz-er2}
\renewcommand{\Aufgabenblatt}{2}
\renewcommand{\Ausgabedatum}{Mi. 30.10.2013}
\renewcommand{\Abgabedatum}{Do. 14.11.2013}
\renewcommand{\Gruppe}{Tim Dittrich, Sebastian Lindemann, Jim Martens}
% define how the sections are rendered
\def\thesection{Aufgabe \arabic{section}:}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
\usetikzlibrary{positioning}
\usetikzlibrary{shadows}
\tikzstyle{every entity} = [top color=white, bottom color=blue!30,
draw=blue!70, drop shadow]
\tikzstyle{every weak entity} = [drop shadow={shadow xshift=.7ex,
shadow yshift=-.7ex}]
\tikzstyle{every attribute} = [top color=white, bottom color=blue!30,
draw=blue!70, node distance=1cm, drop shadow]
\tikzstyle{every relationship} = [top color=white, bottom color=blue!30,
draw=blue!70, drop shadow]
\tikzstyle{every isa} = [top color=white, bottom color=orange!50,
draw=orange!70, drop shadow]
\begin{document}
\section{Informationsmodellierung: Erstellung eines ER-Modells}
\subsection{} %a
\begin{tikzpicture}[node distance=1.31cm, every edge/.style={link}]
\node[entity] (film) {Film};
\node[attribute] (filmName) [above left=of film] {\key{Titel}} edge (film);
\node[attribute] (filmStart) [left=of film] {ersterDrehtag} edge (film);
\node[attribute] (filmEnde) [below left=of film] {letzterDrehtag} edge (film);
\node[relationship] (relFilmStud) [right=of film] {produziert} edge node [above left=0 and 0.2] {1} (film);
\node[entity] (studio) [right=of relFilmStud] {Studio} edge node [above right=0 and 0.2] {n} (relFilmStud);
\node[attribute] (studName) [above=of studio] {\key{Name}} edge (studio);
\node[relationship] (relPersStud) [right=of studio] {leitet} edge node [above left=0 and 0.2] {n} (studio);
\node[entity] (pers) [below left=3cm and 2cm of relPersStud] {Person} edge node [below left=1 and 1.2] {1} (relPersStud);
\node[attribute] (persName) [above right=of pers] {\key{Name}} edge (pers);
\node[attribute] (persVName) [right=of pers] {\key{Vorname}} edge (pers);
\node[attribute] (persGebDat) [below right=of pers] {Geb.Datum} edge (pers);
\node[isa] (isaPers) [below=of pers] {Is-a} edge[->] (pers);
\node[entity] (regi) [left=of isaPers] {Regisseur} edge[->] (isaPers);
\node[entity] (schau) [below right=of isaPers] {Schauspieler} edge[->] (isaPers);
\node[relationship] (relMarkSchau) [below=of schau] {hat} edge node [above right=0.2 and 0] {n} (schau);
\node[entity] (marken) [below=of relMarkSchau] {Markenzeichen} edge node [below right=0.3cm and 0.05cm] {m} (relMarkSchau);
\node[relationship] (relSchauFilmChar) [left=of relMarkSchau] {spielt} edge node [above right=0.4 and 0.9] {n} (schau) edge[bend left] node [above left=5.4 and 1.1] {m} (film);
\node[entity] (char) [below=of relSchauFilmChar] {Charakter} edge node [below left=0.2 and 0] {1} (relSchauFilmChar);
\node[attribute] (charID) [below=of char] {\key{Char.ID}} edge (char);
\node[attribute] (charName) [below right=of char] {Name} edge (char);
\node[relationship] (relFilmGenre) [below=of filmEnde] {gehört zu} edge node [above right=1.2 and 1] {4} (film);
\node[entity] (genre) [below=of relFilmGenre] {Genre} edge node [below left=0.3 and 0] {n} (relFilmGenre);
\node[attribute] (genreName) [below=of genre] {\key{Name}} edge (genre);
\node[relationship] (relRegFilm) [left=of pers] {führt Regie} edge node [below left=0 and 0] {n} (regi) edge node [above left=0.8 and 0.4] {1} (film);
\node[relationship] (relRegiGenre) [right=of genre] {präferiert} edge node [above left=0 and 0.2] {n} (genre) edge node [above right=0.2 and 0.2] {1} (regi);
\node[entity] (verh) [left=of char] {Verhandlung};
\node[attribute] (verhDatum) [above left=of verh] {Datum} edge (verh);
\node[attribute] (verhBudget) [left=of verh] {Budget} edge (verh);
\node[relationship] (relRegiStud) [left=of relSchauFilmChar] {nimmt teil} edge node [below left=0.1 and 0.1] {1} (verh) edge node [above right=1 and 0.2] {n} (regi) edge node [above right=4.4 and 1.7] {m} (studio);
\end{tikzpicture}
\subsection{} %b
Ein Schauspieler kann nicht an Filmen mitwirken, deren Drehzeiten sich vor seiner Geburt befinden.
Ein Regisseur kann nicht bei Filmen Regie führen, deren Drehzeiten vor seiner Geburt liegen.
\section{Informationsmodellierung: Beschreibung von ER-Modellen}
\subsection{} %a
\begin{itemize}
\item Ein Student hat eine Matrikelnummer und einen Namen.
\item Die Matrikelnummer ist der primäre Schlüssel von Studenten.
\item Ein Student ist in genau einem Studiengang immatrikuliert.
\item Ein Studiengang hat einen Namen, der auch primärer Schlüssel ist.
\item Es können beliebig viele Studenten in einem Studiengang immatrikuliert sein.
\end{itemize}
\subsection{} %b
\begin{itemize}
\item Eine Universität hat einen Namen, der auch primärer Schlüssel ist.
\item Zu einer Universität gehören mindestens ein bis beliebig viele Hörsäle.
\item Die Universität ist ein starker Entitytyp. Der Hörsaal ist ein schwacher Entitytyp.
\item Ein Hörsaal besteht aus einem Sekundärschlüssel (Name) und der Anzahl seiner Plätze (\#Plaetze).
\item Ein Hörsaal gehört zu genau einer Universität und ist existenzabhängig von dieser.
\end{itemize}
\subsection{} %c
\begin{itemize}
\item Ein Auftrag besteht aus einer Auftragsnummer und einem Datum. Die Auftragsnummer (ANR) ist der primäre Schlüssel.
\item Ein Ersatzteil besteht aus einem Namen, einem Automodell und einem Preis.
\item Die Kombination Name und Automodell ist der primäre Schlüssel.
\item Ein Reparaturtyp besteht aus einer Art und einem Festpreis. Die Art ist der primäre Schlüssel.
\item Zu jedem Auftrag kann es beliebig viele Ersatzteile und Reparaturtypen geben.
\item Zu jedem Ersatzteil kann ess beliebig viele Aufträge und Reparaturtypen geben.
\item Zu jedem Reparaturtyp kann es beliebig viele Ersatzteile und Aufträge geben.
\item Die Beziehung (Relationship) Reparatur hat eine Uhrzeit und ein Datum.
\end{itemize}
\subsection{} %d
\begin{itemize}
\item Die drei Entity-Typen besitzen keine Attribute und somit auch keinen Primärschlüssel.
\item Sie werden durch die Relationship "`Fußballspiel"' in Verbindung gesetzt.
\item Der Entity-Typ Mannschaft zeichnet sich durch eine reflexive Relationship aus. Daher können Mannschaften auch untereinander in Beziehung gesetzt werden.
\item Eine Mannschaft kann in keinem oder beliebig vielen Fußballspielen teilnehmen.
\item Ein Schiedsrichter kann in keinem oder beliebig vielen Fußballspielen teilnehmen.
\item In einem Stadion können keine oder beliebig viele Fußballspiele stattfinden.
\item An einem Fußballspiel können keine oder beliebig viele Mannschaften teilnehmen.
\end{itemize}
\section{Schlüsselkandidaten}
\subsection{} %a
Ein Schlüsselkandidat muss eindeutig sein. Das bedeutet, dass über den Schlüsselkandidat eine Entität eindeutig identifizierbar sein muss. Im gegebenen Beispiel kommen demnach nur das 2. Fach, Telefonnummer und PLZ in Frage. Außerdem muss er minimal sein. Das bedeutet, dass es keinen anderen Schlüsselkandidaten mit weniger Attributen geben darf. Demnach käme die PLZ und das 2. Fach in Betracht.
Die Attributkombination Vorname und Hausnummer ist kein Schlüsselkandidat, da es eine Frida Weiß mit Hausnummer 8 und eine Frida Müller mit Hausnummer 8 gibt. Damit gibt es zwei Entitäten mit den gleichen Werten für Vorname und Hausnummer.
\subsection{} %b
Bei einer unspezifischen Menge an Studenten kann sich jede der Attribute wiederholen. Daher eignet sich keines der Attribute als eindeutiger Schlüsselkandidat. Mögliche Beispiele sind 20 Studenten, die alle aus Fbach kommen, in der gleichen Straße wohnen und die gleiche Fächerkombi studieren. Damit haben sie die gleiche PLZ und die gleiche Vorwahl. Damit bleiben nur Vor- und Nachname, Geburtsdatum, Hausnummer und der restliche Teil der Telefonnummer als Schlüssel. Allerdings gibt es gleichzeitig zwei Geschwister aus Bheim, die außer dem Vornamen keinen Unterschied aufweisen. Schließlich gibt es einen Peter aus Aheim und einen Peter aus Cfeld. Somit ist keines der vorliegenden Attribute eindeutig als Schlüssel.
Eine Lösungsmöglichkeit besteht in einer ID, die fortlaufend erhöht wird. Keine ID wird doppelt vergeben und einmal vergebene IDs werden nie mehr vergeben. Solch eine ID wäre immer eindeutig als Schlüssel verwendbar.
\end{document}

View File

@ -0,0 +1,165 @@
\documentclass[ngerman]{gdb-aufgabenblatt}
\RequirePackage[utf8]{inputenc}
\renewcommand{\Aufgabenblatt}{3}
\renewcommand{\Ausgabedatum}{Mi. 13.11.2013}
\renewcommand{\Abgabedatum}{Do. 28.11.2013}
\renewcommand{\Gruppe}{Tim Dittrich, Sebastian Lindemann, Jim Martens}
% define how the sections are rendered
\def\thesection{Aufgabe \arabic{section}:}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
\usetikzlibrary{positioning}
\usetikzlibrary{shadows}
\begin{document}
\section{Konzeptioneller Entwurf}
\begin{tikzpicture}%[node distance=1.31cm, every edge/.style={link}]
\node[entity] (biomol) {Biomolekül};
\node[attribut] (biomolID) [below left=0.5 and 0 of biomol] {\underline{Molekül-ID}} edge (biomol);
\node[attribut] (biomolDesc) [below right=0.5 and 0 of biomol] {Beschreibung} edge (biomol);
\node[relationship] (relBiomolOrg) [above=of biomol] {kommt vor} edge node [above left=-0.5 and 0.2] {[1;*]} (biomol);
\node[entity] (organism) [above=of relBiomolOrg] {Organismus} edge node [below right=-0.5 and 0.2] {[0;*]} (relBiomolOrg);
\node[attribut] (orgID) [left=of organism] {\underline{Taxonomie-ID}} edge (organism);
\node[attribut] (orgName) [above left=of organism] {Name} edge (organism);
\node[attribut] (orgTrivName) [above=of organism] {Trivialname} edge (organism);
\node[relationship] (relBiomolArt) [left=of biomol] {veröffentlicht in} edge node [above right=0 and -0.5] {[1;1]} (biomol);
\node[entity] (article) [left=of relBiomolArt] {Artikel} edge node [above left=0 and -0.5] {[0;*]} (relBiomolArt);
\node[attribut] (artTitel) [above left=of article] {\underline{Titel}} edge (article);
\node[attribut] (artDatum) [left=of article] {Datum} edge (article);
\node[relationship] (relArtWiss) [above=of article] {geschrieben von} edge node [above right=-0.5 and 0] {[1;*]} (article);
\node[entity] (wissen) [above=of relArtWiss] {Wissenschaftler} edge node [below right=-0.5 and 0] {[0;*]} (relArtWiss);
\node[attribut] (wissName) [left=of wissen] {\underline{Name}} edge (wissen);
\node[multivalentattribut] (wissKontakt) [above=of wissen] {Kontaktinformationen} edge (wissen);
\node[attribut] (wissTel) [above left=of wissKontakt] {Telefonnummer} edge (wissKontakt);
\node[attribut] (wissEmail) [above=of wissKontakt] {E-Mailadresse} edge (wissKontakt);
\node[erbt] (relDNABiomol) [below=of biomol] {is-a} edge (biomol);
\node[entity] (dnamol) [below left=0.5 and 2 of relDNABiomol] {DNA-Molekül} edge (relDNABiomol);
\node[attribut] (dnaNuk) [above left=of dnamol] {Nukleotidsequenz} edge (dnamol);
\node[attribut] (dnaStrang) [left=of dnamol] {Strang-Orientierung} edge (dnamol);
\node[attribut] (dnaChrom) [below left=of dnamol] {Nummer des Chromosoms} edge (dnamol);
\node[entity] (mrnamol) [below=of relDNABiomol] {mRNA-Molekül} edge (relDNABiomol);
\node[attribut] (mrnaNuk) [above right=of mrnamol] {Nukleotidksequenz} edge (mrnamol);
\node[attribut] (mrnaVien) [right=of mrnamol] {Vienna-String} edge (mrnamol);
\node[relationship] (relDNAmRNA) [below=3.0 of dnamol] {wird übersetzt} edge node [below left=-1.5 and 0] {[1;1]} (dnamol) edge node [above right=0.4 and -0.2] {[0;*]} (mrnamol);
\node[attribut] (relStart) [above left=0.9 and 1 of relDNAmRNA] {Startposition} edge (relDNAmRNA);
\node[attribut] (relEnde) [left=of relDNAmRNA] {Endposition} edge (relDNAmRNA);
\node[weakrelationship] (relRNAProt) [below=of mrnamol] {wird synthetisiert} edge node [below right=-0.5 and 0] {[1;1]} (mrnamol);
\node[weakentity] (prot) [below right=of relRNAProt] {Protein} edge node [above left=-0.5 and 0] {[0;1]} (relRNAProt);
\node[attribut] (protAmino) [below left=0.5 and 1 of prot] {\dashuline{Aminosäuresequenz}} edge (prot);
\node[attribut] (protGewicht) [left=of prot] {Molekulargewicht} edge (prot);
\node[attribut] (protCATH) [below right=0.6 and -1.3 of prot] {CATH-Klassifikation} edge (prot);
\node[relationship] (relProtDom) [right=of organism] {enthält} edge[bend left] node [above right=5 and -1] {[1;*]} (prot);
\node[entity] (domain) [above=of relProtDom] {Domäne} edge node [below right=-0.5 and 0] {[0;*]} (relProtDom);
\node[attribut] (domID) [above left=of domain] {\underline{Domänen-ID}} edge (domain);
\node[attribut] (domHMM) [above=of domain] {HMM} edge (domain);
\end{tikzpicture}
\section{Logischer Entwurf}
Person(\underline{Name}, DOB, Geschlecht) \\
Schauspieler(\dashuline{Name $\rightarrow$ Person.Name}, Markenzeichen) \\
Regisseur(\dashuline{Name $\rightarrow$ Person.Name}, Genre)\\
Charakter(\underline{CID}, Name, Charakterbeschreibung)\\
Film(\underline{Titel}, \dashuline{Regisseur $\rightarrow$ Regisseur.Name}, Zusammenfassung, 1. Drehtag,
letzter Drehtag, Genre1, Genre2, Genre3, Genre4)\\
Rolle(\dashuline{Charakter $\rightarrow$ Charakter.CID, Schauspieler $\rightarrow$ Schauspieler.Name, Film $\rightarrow$ Film.Titel}, Drehbeginn, Drehende, Gage)
\section{Relationale Algebra und SQL}
\subsection{} %a
\subsubsection{} %i
Nachname des Rennfahrers, der im Malaysia GP den ersten Platz belegte.
\begin{tabular}{c}
Nachname \\
\hline
Vettel \\
\hline
\end{tabular}
\subsubsection{} %ii
Vor- und Nachname aller Rennfahrer, die in einem Rennstall angestellt sind, der weniger als 350 Budget hat.
\begin{tabular}{c|c}
Vorname & Nachname \\
\hline
Lewis & Hamilton \\
Jenson & Button \\
Kimi & Räikkonen \\
\hline
\end{tabular}
\subsubsection{} %iii
Name der Rennställe, deren Fahrer im Australien GP eine Platzierung haben.
\begin{tabular}{c}
Name \\
\hline
RedBull \\
Ferrari \\
McLaren \\
\hline
\end{tabular}
\subsection{} %b
\subsubsection{} %i
\[
\pi_{Rennstall.Name}(\sigma_{Geburt >= 1985}(Rennfahrer) \underset{RSID=Rennstall}{\bowtie} Rennstall)
\]
\begin{tabular}{c}
Name \\
\hline
RedBull \\
McLaren \\
\hline
\end{tabular}
\subsubsection{} %ii
$\pi_{Vorname, Nachname, Geburt}(\pi_{RID}(\sigma_{Name='Australien GP'}(Rennort) \bowtie Platzierung) \bowtie $\\$ Rennfahrer \underset{Rennstall=RSID}{\bowtie} (\sigma_{Name='McLaren'}(Rennstall)))$
\begin{tabular}{c|c|c}
Vorname & Nachname & Geburt \\
\hline
Lewis & Hamilton & 1985-01-07 \\
Jenson & Button & 1980-01-19 \\
\hline
\end{tabular}
\subsubsection{} %iii
$Rennfahrer - (Rennfahrer \bowtie (\pi_{RID}(Platzierung)))$
\begin{tabular}{c|c|c|c|c|c}
RID & Vorname & Nachname & Geburt & Wohnort & Rennstall \\
\hline
44 & Kimi & Räikkönen & 1979-10-17 & Espoo (Finnland) & 34 \\
\hline
\end{tabular}
\subsubsection{} %iv
$\pi_{Vorname, Nachname}(\sigma_{Rennstall = 31}(Rennfahrer) - (\sigma_{Nachname='Button'}(Rennfahrer)))$
\begin{tabular}{c|c}
Vorname & Nachname \\
\hline
Lewis & Hamilton \\
\hline
\end{tabular}
\subsection{} %c
\subsubsection{} %i
\begin{verbatim}
SELECT fahrer.Vorname, fahrer.Nachname, fahrer.Geburt
FROM Platzierung platz,
Rennort ort,
Rennfahrer fahrer
WHERE platz.OID = ort.OID
AND platz.RID = fahrer.RID
AND ort.Name = 'Australien GP'
AND fahrer.Rennstall = 31
\end{verbatim}
\subsubsection{} %ii
\begin{verbatim}
SELECT Vorname, Nachname
FROM Rennfahrer
WHERE Rennstall = 31
AND Nachname <> 'Button'
\end{verbatim}
\section{Algebraische Optimierung}
\subsection{} %a
\subsection{} %b
\end{document}

View File

@ -0,0 +1,200 @@
\documentclass[ngerman]{gdb-aufgabenblatt}
\RequirePackage[utf8]{inputenc}
\renewcommand{\Aufgabenblatt}{3}
\renewcommand{\Ausgabedatum}{Mi. 13.11.2013}
\renewcommand{\Abgabedatum}{Do. 28.11.2013}
\renewcommand{\Gruppe}{Tim Dittrich, Sebastian Lindemann, Jim Martens}
% define how the sections are rendered
\def\thesection{Aufgabe \arabic{section}:}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
\usetikzlibrary{positioning}
\usetikzlibrary{shadows}
\begin{document}
\section{Relationenalgebra}
\subsection{} %a
\[
\pi_{Obst.Sorte}(Obst \underset{Obst.Entdecker=Person.PNR}{\bowtie}( \sigma_{Vorname='Horst'}(Person)))
\]
\subsection{} %b
\[
\pi_{Person.Vorname, Person.Nachname}(Person \underset{Person.PNR=Allergie.Person}{\bowtie} (\sigma_{Symptom='Halskratzen'}(Allergie)))
\]
\subsection{} %c
\[
\pi_{Obst.Sorte, Person.Nachname}((Person \underset{Obst.Entdecker=Person.PNR}{\bowtie} Obst) \underset{Allergie.Obst=Obst.ONR}{\bowtie} (\sigma_{Symptom='W"urgreiz'}(Allergie)))
\]
\section{SQL - Schemadefinition}
\subsection{} %a
\begin{verbatim}
CREATE TABLE Rennstall (
RSID INT(10) NOT NULL PRIMARY KEY,
Name VARCHAR(255) NOT NULL UNIQUE KEY,
Teamchef VARCHAR(255) DEFAULT NULL,
Budget INT(3) NOT NULL CHECK(Budget>=0 AND Budget <= 500)
);
CREATE TABLE Rennfahrer (
RID INT(10) NOT NULL PRIMARY KEY,
Rennstall INT(10) NOT NULL,
Vorname VARCHAR(255) NOT NULL,
Nachname VARCHAR(255) NOT NULL,
Geburt DATE NOT NULL,
Wohnort VARCHAR(255) DEFAULT NULL,
CONSTRAINT fk_rennstall FOREIGN KEY (Rennstall) REFERENCES Rennstall (RSID)
);
CREATE TABLE Rennort (
OID INT(10) NOT NULL PRIMARY KEY,
Name VARCHAR(255) NOT NULL,
Strecke VARCHAR(255) NOT NULL
);
CREATE TABLE Platzierung (
RID INT(10) NOT NULL,
OID INT(10) NOT NULL,
Platz INT(3) NOT NULL,
CONSTRAINT pk_platzierung PRIMARY KEY (RID, OID)
);
\end{verbatim}
\subsection{} %b
Dadurch muss beim Erstellen einer Datenbankabfrage verstärkt darauf geachtet werden, dass nach jeder einzelnen Anweisung die Integrität eingehalten wird. Demnach wird eine feste Reihenfolge vorgegeben. Zyklische Verweise verhindern damit ein irgendwie geartetes Verändern auch nur eines Bestandteils, wenn durch diese Änderung irgendeine Fremdschlüsselbedingung verletzt ist.
Der Fremdschlüssel von Rennstall zu Rennfahrer könnte erst nach der Anlegung der Tabelle Rennfahrer erstellt werden.
Außerdem könnten dadurch weder Rennställe noch Rennfahrer gelöscht werden. Wenn ein Rennfahrer gelöscht werden soll und er ein Star eines Rennstalles ist, dann wird die Operation sofort abgebrochen. Umgekehrt kann kein Stall gelöscht werden, da zumindest der Star des Rennstalles selber auf den Rennstall referenziert, wodurch auch solche eine Operation abgebrochen würde.
\subsection{} %c
\begin{verbatim}
INSERT INTO Rennstall
(RSID, Name, Teamchef, Budget)
VALUES (2, 'Red Bull', 'Christian Horner', 370),
(5, 'Ferrari', 'Stefano Domenicali', 350),
(31, 'McLaren', 'Martin Whitmarsh', 220),
(34, 'Lotus F1', 'Eric Boullier', 100);
INSERT INTO Rennfahrer
(RID, Rennstall, Vorname, Nachname, Geburt, Wohnort)
VALUES (4, 2, 'Sebastian', 'Vettel', 19870703, 'Kemmental (Schweiz)'),
(6, 5, 'Fernando', 'Alonso', 19810729, 'Lugano (Schweiz)'),
(8, 2, 'Marc', 'Webber', 19760827, 'Aston Clinton (UK)'),
(9, 31, 'Lewis', 'Hamilton', 19850107, 'Genf (Schweiz)'),
(20, 31, 'Jenson', 'Button', 19800119, 'Monte Carlo (Monaco)'),
(21, 5, 'Felipe', 'Massa', 19820425, 'São Paulo (Brasilien)'),
(44, 34, 'Kimi', 'Räikkönen', 19791017, 'Espoo (Finnland)');
INSERT INTO Rennort
(OID, Name, Strecke)
VALUES (4, 'Australien GP', 'Albert Park Circuit'),
(15, 'Malaysia GP', 'Sepang International Circuit'),
(21, 'China GP', 'Shanghai International Circuit');
INSERT INTO Platzierung
(RID, OID, Platz)
VALUES (8, 4, 6),
(4, 15, 1),
(20, 15, 17),
(4, 4, 3),
(6, 4, 2),
(8, 15, 2),
(6, 21, 1),
(9, 4, 5),
(21, 15, 5),
(20, 4, 9),
(21, 4, 4);
\end{verbatim}
\subsection{} %d
\begin{itemize}
\item \begin{verbatim}
DELETE FROM Rennfahrer
WHERE Vorname LIKE 'F%';
\end{verbatim}
\item \begin{verbatim}
DROP TABLE Platzierung;
DROP TABLE Rennort;
DROP TABLE Rennfahrer;
DROP TABLE Rennstall;
\end{verbatim}
\end{itemize}
\section{SQL - Anfragen}
\subsection{} %a
\begin{verbatim}
SELECT DISTINCT obst.Sorte
FROM Person pers,
Allergie aller,
Obst obst
WHERE pers.PNR = aller.Person
AND aller.Obst = obst.ONR
AND pers.Vorname = 'Peter'
AND pers.Nachname = 'Meyer'
ORDER BY obst.Sorte DESC;
\end{verbatim}
\subsection{} %b
\begin{verbatim}
SELECT pers.PNR, pers.Nachname, COUNT(aller.Obst)
FROM Person pers,
Allergie aller
WHERE pers.PNR = aller.Person
GROUP BY pers.PNR;
\end{verbatim}
\subsection{} %c
\begin{verbatim}
SELECT pers.PNR
FROM Person pers,
Obst obst
WHERE pers.PNR = obst.Entdecker
GROUP BY pers.PNR
HAVING COUNT(obst.ONR) > 6;
\end{verbatim}
\subsection{} %d
\begin{verbatim}
SELECT pers.Vorname, pers.Nachname
FROM Person pers,
Person entdecker,
Obst obst
WHERE entdecker.PNR = obst.Entdecker
AND pers.Lieblingsobst = obst.ONR
AND entdecker.Vorname = pers.Vorname;
\end{verbatim}
\subsection{} %e
\begin{verbatim}
SELECT pers.PNR, pers.Vorname, pers.Nachname
FROM Person pers
WHERE pers.PNR NOT IN (SELECT obst.Entdecker
FROM Obst obst);
\end{verbatim}
\section{Optimierung}
anfänglicher Operatorbaum:\\
\begin{tikzpicture}[shorten >=1pt,node distance=1.1cm,on grid]
\node (proj) {$\pi_{Person.PNR, Person.Vorname, Person.Nachname}$};
\node (sel) [below=2.0 of proj] {$\sigma_{Obst.Sorte\text{ LIKE 'K\%'}}$};
\node (join) [below=2.0 of sel] {$\underset{Person.Lieblingsobst = Obst.ONR}{\bowtie}$};
\node (person) [below left=2.0 and 2.0 of join] {Person};
\node (obst) [below right=2.0 and 2.0 of join] {Obst};
\path (proj) edge node [right] {400} (sel)
(sel) edge node [right] {2000} (join)
(join) edge node [left] {2000} (person)
(join) edge node [right] {25} (obst);
\end{tikzpicture}
optimierter Operatorbaum:\\
\begin{tikzpicture}[shorten >=1pt,node distance=1.1cm,on grid]
\node (proj) {$\pi_{Person.PNR, Person.Vorname, Person.Nachname}$};
\node (join) [below=2.0 of proj] {$\underset{Person.Lieblingsobst = Obst.ONR}{\bowtie}$};
\node (person) [below left=2.0 and 2.0 of join] {Person};
\node (sel) [below right=2.0 and 2.0 of join] {$\sigma_{Obst.Sorte\text{ LIKE 'K\%'}}$};
\node (obst) [below=of sel] {Obst};
\path (proj) edge node [right] {400} (join)
(join) edge node [left] {2000} (person)
(join) edge node [right] {5} (sel)
(sel) edge node [right] {25} (obst);
\end{tikzpicture}
Der zweite Operatorbaum ist klar performanter, da die Selektion der Obstsorte bereits vor dem Join stattfindet.
\end{document}

22
gdb/gdb-aufgabenblatt.cls Normal file
View File

@ -0,0 +1,22 @@
% VSIS-Aufgabenblatt
%
% LaTeX-Klasse zur Erstellung von Aufgabenblaettern inkl. optionaler Musterloesung im VSIS-Stil.
%
% Entworfen von Wolfram Wingerath auf Grundlage eines existierenden Designs von Kristof Hamann
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{gdb-aufgabenblatt}[2009/11/08 v1.0 VSIS-Aufgabenblaetter]
\LoadClass{vsis-aufgabenblatt}
\newcommand{\Gruppe}{*Teilnehmernamen*}
\renewcommand{\Vorlesung}{Grundlagen von Datenbanken}
\renewcommand{\Semester}{WS 2013/14}
\renewcommand{\Punktezahl}{40}
\renewcommand{\PunktezahlTitel}{Gruppe}
\renewcommand{\Punktezahl}{\Gruppe}

469
gdb/sfmath.sty Normal file
View File

@ -0,0 +1,469 @@
% sfmath.sty, copyright 2001-2007 by Olaf Dietrich (olaf@dtrx.de)
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Olaf Dietrich.
%
% This work consists of the file sfmath.sty.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sfmath}[2007/08/27 v0.8 sans serif maths]
% This is a simple package for sans serif maths in documents.
%
% Usage: \usepackage{sfmath} or \usepackage[OPTIONS]{sfmath}
%
% After including the package sfmath.sty, all maths of the current
% document is displayed with sans serif fonts; there is no way to
% switch back to the original behavior.
%
% The default sans serif font for maths is the sans serif font
% selected for sans serif text (i.e., \sfdefault) when sfmath.sty
% is loaded. Therefore, you must include sfmath.sty after having
% changed \sfdefault, e.g., by a package such as helvet.sty or
% manually. Alternatively, use one of the font options described
% below (cm, helvet, cmbright, tx, px, or lm) in order to override
% the default sans serif font.
%
% Package OPTIONS (options marked with (+) are experimental):
%
% * slantedGreek: for slanted uppercase Greek letters
%
% * cm: use Computer Modern (cmss) for maths (explicitly)
% * helvet: use Postscript Helvetica (phv) for maths (explicitly)
% * cmbright: use CM-Bright fonts (cmbr) for maths (explicitely)
% * tx: use Postscript txfonts (tx) for maths (explicitly)
% * px: use Postscript pxfonts (tx) for maths (explicitly)
% * lm: use Latin Modern (lmss) for maths (explicitly) (+)
%
% * T1experimental: use T1 font encoding for standard maths (+)
% * AlphT1experimental: use T1 font encoding for \math*{...} commands (+)
%
% * mathrmOrig: do not change the behavior of the \mathrm command
% * mathbfOrig: do not change the behavior of the \mathbf command
% * mathitOrig: do not change the behavior of the \mathit command
% * mathsfOrig: do not change the behavior of the \mathsf command
%
% (+): Known limitations of experimental options:
% T1experimental produces a warning about the encoding of the
% operators font.
% AlphT1experimental DOES NOT WORK with uppercase Greek letters
% within the \math*{...} command!
% These options should only be used with the ec fonts.
%
% lm includes T1experimental and AlphT1experimental with the
% limitations mentioned above.
%
% RECOMMENDATION:
% use the fix-cm package instead of the experimental
% T1 options: with fix-cm.sty, the chosen ec fonts
% harmonize much better with the cm sans serif math fonts.
% Add \RequirePackage{fix-cm} _before_ \documentclass{...}.
%
%
% Some new macros are defined by sfmath.sty:
%
% * \mathsl{...}: A new math alphabet that is by default identical
% with \mathit{...}; useful in combination with the option mathitOrig.
%
% * \upOmega, \upDelta: upright versions of \Omega and \Delta;
% useful when the option slantedGreek is selected.
%
%
% More documentation can currently be found at:
% <URL:http://dtrx.de/od/tex/sfmath.html>
% CHANGES:
%
% v0.8:
%
% * Update documentation and add license details for CTAN upload.
%
%
% v0.7:
%
% * Add (experimental) support for latin modern (lmodern) fonts.
%
%
% v0.6:
%
% * Add some artificial intelligence to use slanted bold letters
% if available (e.g., for phv, txfonts, or pxfonts).
% Add options to select txfonts, pxfonts, and cmbright (probably
% not very useful) explicitely.
% (Thanks to Alberto Lusiani who asked for slanted bold letters.)
%
%
% v0.5:
%
% * Add experimental options for T1 font encoding of maths fonts.
% Using these options can be useful with ec fonts which look
% slightly different from the standard cm maths fonts (especially
% at large font size). About limitations see above.
%
%
% v0.4:
%
% * Add \upDelta, \upOmega command (to be a little more compatible
% with other packages that provide the slantedGreek option)
%
%
% v0.3:
%
% * Add sans serif shapes for "," and ".", "\ldotp"
%
% * Modified documentation
%
%
% v0.2:
%
% * New option slantedGreek for slanted greek capitals
%
% * Options helvet and cm to select explicitly the sans serif font
% for maths. Without any of these options, the current \sfdefault
% is chosen.
%
% * Options mathxxOrig: don't change the alphabet command \mathxx;
% available for \mathrm, \mathbf, \mathit, and \mathsf
%
% * Provide dotlessi and dotlessj (if available)
%
% BUGS/LIMITATIONS/PROBLEMS:
%
% * Functionality is limited by the intention to work without
% additionally defined (virtual) fonts; instead, only standard
% fonts are used.
%
% * The font metrics are not adjusted to maths usage (this may
% result in typographically unsatisfying results).
%
% * In many constellations with Postscript fonts (helvet.sty,
% pslatex.sty, ...) the upper-case greek letters are not chosen
% correctly within \mathrm, \mathbf, \mathit, ... (because
% they should be part of OT1-encoded fonts but are not included
% in these standard postscript fonts).
%
% * Bold math symbols are not always available (e.g. with pslatex.sty)
% or at least not slanted (e.g. with cmss fonts), so better don't
% use bold maths with this package. (This has been partially improved
% in version 0.6.)
%
% * There is a visual difference between the ec sans serif text fonts
% and the cm sans serif maths fonts, especially at larger font sizes.
% The fix-cm package might help to reduce the ugliness of the ec
% sans serif fonts and the differences between the ec text fonts
% and the cm math fonts.
% Alternatively, the experimental options T1experimental and
% AlphT1Experimental might help by using the ec fonts for maths as well.
%
% * The txfonts and pxfonts are reported to have several deficiencies
% with respect to font metrics and macro implementation; using
% these fonts is not recommended by the package author.
%
% * The set symbols \mathbb{N} or \mathbbm{N} (from bbm.sty) are not
% changed. You might like to use \mathbbmss{N} (from bbm.sty).
%
% * Some symbols have serifish shapes (\sum, \prod, probably more) and
% are not changed.
%
% * Lower-case greek letters are not available in sans serif shape
% (they don't have real serifs, but cannot be expected to harmonize
% with the sans serif latin letters).
%
%
% TODO:
%
% * Improve documentation.
%
% * Provide LaTeX .ins/.dtx files instead of naked .sty file.
%
% HERE WE GO:
% Declare options and defaults and process options
\DeclareOption{slantedGreek}{%
\renewcommand{\greek@shape}{sl}%
\renewcommand{\greek@bold@shape}{\greek@bold@sl}%
}
\DeclareOption{cm}{\renewcommand{\math@sfdefault}{cmss}}
\DeclareOption{lm}{\renewcommand{\math@sfdefault}{lmss}}
\DeclareOption{helvet}{\renewcommand{\math@sfdefault}{phv}}
\DeclareOption{cmbright}{\renewcommand{\math@sfdefault}{cmbr}}
\DeclareOption{tx}{\renewcommand{\math@sfdefault}{txss}}
\DeclareOption{px}{\renewcommand{\math@sfdefault}{pxss}}
\DeclareOption{T1experimental}{\renewcommand{\math@encoding}{T1}}
\DeclareOption{AlphT1experimental}{\renewcommand{\math@lph@encoding}{T1}}
\DeclareOption{mathrmOrig}{\renewcommand{\mathrm@lph}{cmr}}
\DeclareOption{mathbfOrig}{\renewcommand{\mathbf@lph}{cmr}}
\DeclareOption{mathitOrig}{\renewcommand{\mathit@lph}{cmr}}
\DeclareOption{mathsfOrig}{\renewcommand{\mathsf@lph}{cmss}}
\newcommand{\math@sfdefault}{\sfdefault}
\newcommand{\math@encoding}{OT1}
\newcommand{\math@lph@encoding}{OT1}
\newcommand{\mathrm@lph}{\math@sfdefault}
\newcommand{\mathbf@lph}{\math@sfdefault}
\newcommand{\mathit@lph}{\math@sfdefault}
\newcommand{\mathsf@lph}{\math@sfdefault}
% \math@sfGreek: Font for capital greeks: cmss or other?
% \greek@shape: Capital greeks: normal or slanted? [slantedGreek]
% \greek@bold@shape: Bold capital greeks: normal or slanted? [slantedGreek]
% \greek@bold@sl: Bold capital greeks: "sl" if slanted possible
%
% \mathnormal@bold@shape: Bold letters: normal or slanted? (always bold)
% \mathit@bold@series: Bold \mathit (\mathsl): medium or bold? (always slanted)
\newcommand{\math@sfGreek}{cmss}
\newcommand{\greek@shape}{n}
\newcommand{\greek@bold@shape}{n}
\newcommand{\greek@bold@sl}{n}
\newcommand{\mathnormal@bold@shape}{n}
\newcommand{\mathit@bold@series}{m}
\ProcessOptions
% check the current value of \math@sfdefault
\edef\tmp@sfdefault{\math@sfdefault}
\def\tmp@compare{cmss}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is cmss
% no slanted bold letters
% no slanted bold capital Greeks
\renewcommand{\math@sfGreek}{cmss}
\renewcommand{\greek@bold@sl}{n}
\renewcommand{\mathnormal@bold@shape}{n}
\renewcommand{\mathit@bold@series}{m}
\fi
\def\tmp@compare{phv}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is phv (helvet.sty)
% slanted bold letters
% no capital Greeks
\renewcommand{\math@sfGreek}{cmss}
\renewcommand{\greek@bold@sl}{n}
\renewcommand{\mathnormal@bold@shape}{sl}
\renewcommand{\mathit@bold@series}{bx}
\fi
\def\tmp@compare{txss}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is txss (txfonts.sty)
% slanted bold letters
% slanted bold capital Greeks
\renewcommand{\math@sfGreek}{txss}
\renewcommand{\greek@bold@sl}{sl}
\renewcommand{\mathnormal@bold@shape}{sl}
\renewcommand{\mathit@bold@series}{bx}
\fi
\def\tmp@compare{pxss}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is pxss (pxfonts.sty)
% slanted bold letters
% slanted bold capital Greeks
\renewcommand{\math@sfGreek}{pxss}
\renewcommand{\greek@bold@sl}{sl}
\renewcommand{\mathnormal@bold@shape}{sl}
\renewcommand{\mathit@bold@series}{bx}
\fi
\def\tmp@compare{cmbr}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is cmbr (cmbright.sty)
% no slanted bold letters
% no slanted bold capital Greeks
\renewcommand{\math@sfGreek}{cmbr}
\renewcommand{\greek@bold@sl}{n}
\renewcommand{\mathnormal@bold@shape}{n}
\renewcommand{\mathit@bold@series}{m}
\fi
\def\tmp@compare{lmss}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is lmss (lmodern.sty sans serif)
% T1 encoding only
% slanted bold letters
% no slanted bold capital Greeks
\renewcommand{\math@encoding}{T1}
\renewcommand{\math@lph@encoding}{T1}
\renewcommand{\math@sfGreek}{cmss}
\renewcommand{\greek@bold@sl}{n}
\renewcommand{\mathnormal@bold@shape}{sl}
\renewcommand{\mathit@bold@series}{bx}
\fi
% Change font for digits and "operators" (\sin, \exp, ...)
% to default sans serif font
\SetSymbolFont{operators}{normal}{\math@encoding}{\math@sfdefault}{m}{n}
\SetSymbolFont{operators}{bold}{\math@encoding}{\math@sfdefault}{bx}{n}
% Most special math symbols remain unmodified (and many of those
% don't have serifs); however all letters (A-Z, a-z) are
% explicitely changed to the sans serif version (again
% default sans serif font).
%
% Unfortunately, there is no standard slanted+bold sans serif font
% available (as Postscript Type 1 font), so try an upright
% version (may be better than nothing).
\DeclareSymbolFont{SFMath}{\math@encoding}{\math@sfdefault}{m}{sl}
\SetSymbolFont{SFMath}{normal}{\math@encoding}{\math@sfdefault}{m}{sl}
\SetSymbolFont{SFMath}{bold}{\math@encoding}{\math@sfdefault}{bx}{\mathnormal@bold@shape}
\DeclareMathSymbol{A}{\mathalpha}{SFMath}{`A}
\DeclareMathSymbol{B}{\mathalpha}{SFMath}{`B}
\DeclareMathSymbol{C}{\mathalpha}{SFMath}{`C}
\DeclareMathSymbol{D}{\mathalpha}{SFMath}{`D}
\DeclareMathSymbol{E}{\mathalpha}{SFMath}{`E}
\DeclareMathSymbol{F}{\mathalpha}{SFMath}{`F}
\DeclareMathSymbol{G}{\mathalpha}{SFMath}{`G}
\DeclareMathSymbol{H}{\mathalpha}{SFMath}{`H}
\DeclareMathSymbol{I}{\mathalpha}{SFMath}{`I}
\DeclareMathSymbol{J}{\mathalpha}{SFMath}{`J}
\DeclareMathSymbol{K}{\mathalpha}{SFMath}{`K}
\DeclareMathSymbol{L}{\mathalpha}{SFMath}{`L}
\DeclareMathSymbol{M}{\mathalpha}{SFMath}{`M}
\DeclareMathSymbol{N}{\mathalpha}{SFMath}{`N}
\DeclareMathSymbol{O}{\mathalpha}{SFMath}{`O}
\DeclareMathSymbol{P}{\mathalpha}{SFMath}{`P}
\DeclareMathSymbol{Q}{\mathalpha}{SFMath}{`Q}
\DeclareMathSymbol{R}{\mathalpha}{SFMath}{`R}
\DeclareMathSymbol{S}{\mathalpha}{SFMath}{`S}
\DeclareMathSymbol{T}{\mathalpha}{SFMath}{`T}
\DeclareMathSymbol{U}{\mathalpha}{SFMath}{`U}
\DeclareMathSymbol{V}{\mathalpha}{SFMath}{`V}
\DeclareMathSymbol{W}{\mathalpha}{SFMath}{`W}
\DeclareMathSymbol{X}{\mathalpha}{SFMath}{`X}
\DeclareMathSymbol{Y}{\mathalpha}{SFMath}{`Y}
\DeclareMathSymbol{Z}{\mathalpha}{SFMath}{`Z}
\DeclareMathSymbol{a}{\mathalpha}{SFMath}{`a}
\DeclareMathSymbol{b}{\mathalpha}{SFMath}{`b}
\DeclareMathSymbol{c}{\mathalpha}{SFMath}{`c}
\DeclareMathSymbol{d}{\mathalpha}{SFMath}{`d}
\DeclareMathSymbol{e}{\mathalpha}{SFMath}{`e}
\DeclareMathSymbol{f}{\mathalpha}{SFMath}{`f}
\DeclareMathSymbol{g}{\mathalpha}{SFMath}{`g}
\DeclareMathSymbol{h}{\mathalpha}{SFMath}{`h}
\DeclareMathSymbol{i}{\mathalpha}{SFMath}{`i}
\DeclareMathSymbol{j}{\mathalpha}{SFMath}{`j}
\DeclareMathSymbol{k}{\mathalpha}{SFMath}{`k}
\DeclareMathSymbol{l}{\mathalpha}{SFMath}{`l}
\DeclareMathSymbol{m}{\mathalpha}{SFMath}{`m}
\DeclareMathSymbol{n}{\mathalpha}{SFMath}{`n}
\DeclareMathSymbol{o}{\mathalpha}{SFMath}{`o}
\DeclareMathSymbol{p}{\mathalpha}{SFMath}{`p}
\DeclareMathSymbol{q}{\mathalpha}{SFMath}{`q}
\DeclareMathSymbol{r}{\mathalpha}{SFMath}{`r}
\DeclareMathSymbol{s}{\mathalpha}{SFMath}{`s}
\DeclareMathSymbol{t}{\mathalpha}{SFMath}{`t}
\DeclareMathSymbol{u}{\mathalpha}{SFMath}{`u}
\DeclareMathSymbol{v}{\mathalpha}{SFMath}{`v}
\DeclareMathSymbol{w}{\mathalpha}{SFMath}{`w}
\DeclareMathSymbol{x}{\mathalpha}{SFMath}{`x}
\DeclareMathSymbol{y}{\mathalpha}{SFMath}{`y}
\DeclareMathSymbol{z}{\mathalpha}{SFMath}{`z}
\DeclareMathSymbol{\imath}{\mathalpha}{SFMath}{"10}
\DeclareMathSymbol{\jmath}{\mathalpha}{SFMath}{"11}
% The symbols ",", ".", and "\ldotp" should be sans serif
% but upright.
\DeclareSymbolFont{SFMathUp}{\math@encoding}{\math@sfdefault}{m}{n}
\SetSymbolFont{SFMathUp}{normal}{\math@encoding}{\math@sfdefault}{m}{n}
\SetSymbolFont{SFMathUp}{bold}{\math@encoding}{\math@sfdefault}{bx}{n}
\DeclareMathSymbol{,}{\mathpunct}{SFMathUp}{`,}
\DeclareMathSymbol{.}{\mathord}{SFMathUp}{`.}
\DeclareMathSymbol{\ldotp}{\mathord}{SFMathUp}{`.}
% Take capital greek letters from cmss or [tp]xss; other sans serif fonts
% like helvetica don't have capital greeks, so here cmss is
% taken instead of \sfdefault. Unfortunately, this does not work
% within the alphabet commands \mathrm, \mathsf, ...
\DeclareSymbolFont{SFMathGreek}{OT1}{\math@sfGreek}{m}{\greek@shape}
\SetSymbolFont{SFMathGreek}{normal}{OT1}{\math@sfGreek}{m}{\greek@shape}
\SetSymbolFont{SFMathGreek}{bold}{OT1}{\math@sfGreek}{bx}{\greek@bold@shape}
\DeclareMathSymbol{\Gamma}{\mathalpha}{SFMathGreek}{"00}
\DeclareMathSymbol{\Delta}{\mathalpha}{SFMathGreek}{"01}
\DeclareMathSymbol{\Theta}{\mathalpha}{SFMathGreek}{"02}
\DeclareMathSymbol{\Lambda}{\mathalpha}{SFMathGreek}{"03}
\DeclareMathSymbol{\Xi}{\mathalpha}{SFMathGreek}{"04}
\DeclareMathSymbol{\Pi}{\mathalpha}{SFMathGreek}{"05}
\DeclareMathSymbol{\Sigma}{\mathalpha}{SFMathGreek}{"06}
\DeclareMathSymbol{\Upsilon}{\mathalpha}{SFMathGreek}{"07}
\DeclareMathSymbol{\Phi}{\mathalpha}{SFMathGreek}{"08}
\DeclareMathSymbol{\Psi}{\mathalpha}{SFMathGreek}{"09}
\DeclareMathSymbol{\Omega}{\mathalpha}{SFMathGreek}{"0A}
\DeclareSymbolFont{SFMathUpGreek}{OT1}{\math@sfGreek}{m}{n}
\SetSymbolFont{SFMathUpGreek}{normal}{OT1}{\math@sfGreek}{m}{n}
\SetSymbolFont{SFMathUpGreek}{bold}{OT1}{\math@sfGreek}{bx}{n}
\DeclareMathSymbol{\upDelta}{\mathalpha}{SFMathUpGreek}{"01}
\DeclareMathSymbol{\upOmega}{\mathalpha}{SFMathUpGreek}{"0A}
% Define new behavior for math alphabet commands
\SetMathAlphabet{\mathnormal}{normal}{\math@lph@encoding}{\math@sfdefault}{m}{sl}
\SetMathAlphabet{\mathnormal}{bold}{\math@lph@encoding}{\math@sfdefault}{bx}{\mathnormal@bold@shape}
\SetMathAlphabet{\mathrm}{normal}{\math@lph@encoding}{\mathrm@lph}{m}{n}
\SetMathAlphabet{\mathrm}{bold}{\math@lph@encoding}{\mathrm@lph}{bx}{n}
\SetMathAlphabet{\mathbf}{normal}{\math@lph@encoding}{\mathbf@lph}{bx}{n}
\SetMathAlphabet{\mathbf}{bold}{\math@lph@encoding}{\mathbf@lph}{bx}{n}
\SetMathAlphabet{\mathit}{normal}{\math@lph@encoding}{\mathit@lph}{m}{sl}
\SetMathAlphabet{\mathit}{bold}{\math@lph@encoding}{\mathit@lph}{\mathit@bold@series}{sl}
\SetMathAlphabet{\mathsf}{normal}{\math@lph@encoding}{\mathsf@lph}{m}{n}
\SetMathAlphabet{\mathsf}{bold}{\math@lph@encoding}{\mathsf@lph}{bx}{n}
% Define new math alphabet command \mathsl
\DeclareMathAlphabet{\mathsl}{\math@lph@encoding}{\math@sfdefault}{m}{sl}
\SetMathAlphabet{\mathsl}{bold}{\math@lph@encoding}{\math@sfdefault}{\mathit@bold@series}{sl}
\endinput

101
gdb/vsis-aufgabenblatt.cls Normal file
View File

@ -0,0 +1,101 @@
% VSIS-Aufgabenblatt
%
% LaTeX-Klasse zur Erstellung von Aufgabenblaettern inkl. optionaler Musterloesung im VSIS-Stil.
%
% Entworfen von Kristof Hamann auf Grundlage eines existierenden Designs aus aelteren Semestern.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{vsis-aufgabenblatt}[2009/11/08 v1.0 VSIS-Aufgabenblaetter]
\LoadClass[a4paper,parskip=half-,numbers=noenddot]{scrartcl}
% Kodierung der Schriftarten wegen Umlauten
\RequirePackage[T1]{fontenc}
% Silbentrennung
\RequirePackage[ngerman]{babel}
% Einbinden von Grafiken (z.B. VSIS-Logo)
\RequirePackage{graphicx}
% Definieren von Farben
\RequirePackage{xcolor}
\definecolor{shadecolor}{gray}{0.9}
% Rahmen (z.B. fuer Musterloesungen)
\RequirePackage{framed}
% Erweiterte Tabellen (z.B. fuer Kopfzile)
\RequirePackage{tabularx}
% Tabellenzellen ueber mehrere Zeilen (z.B. fuer Kopfzeile)
\RequirePackage{multirow}
\renewcommand{\familydefault}{\sfdefault}
\RequirePackage{sfmath}
\RequirePackage{uri}
% Seitenlayout
\RequirePackage{scrpage2}
\setlength{\headsep}{3.5cm}
\setlength{\oddsidemargin}{-1cm}
\setlength{\textwidth}{18cm}
\setkomafont{pageheadfoot}{\small}
% Section = Aufgabe
% \othersectionlevelsformat{Gliederungsname}{}{Zaehlerausgabe}
%\renewcommand*{\othersectionlevelsformat}[3]{\AufgabeTitel~#3:\enskip}
% Aufzaehlungen fuer Teilaufgaben
%\renewcommand{\labelenumi}{\alph{enumi})}
%\renewcommand{\labelenumii}{\roman{enumii})}
% Optionales Einblenden von Musterloesungen, Layout von Musterloesungen
\newif\ifmusterloesung
\musterloesungfalse
\newcommand{\aufgabe}[2]{\section{#1\hfill\normalfont(#2)}}
\newenvironment{musterloesung}{\begin{shaded}\textbf{\MusterloesungTitel:}\\[0.5em]}{\end{shaded}}
% Kopfzeile mit VSIS-Logo und Vorlesungsdaten
\pagestyle{scrheadings}
\chead{
\begin{tabularx}{\textwidth}{|p{2.2cm}|X|X|X|X|}
\cline{1-5}
& & \multicolumn{3}{l|}{}\\[-0.95em]
\multirow{4}{*}{\includegraphics[width=2.2cm]{vsis.pdf}} & \VorlesungTitel & \multicolumn{3}{l|}{\textbf{\Vorlesung}\hfill\Semester} \\
& & \multicolumn{3}{l|}{}\\[-0.95em]
\cline{2-5}
& & \multicolumn{3}{l|}{}\\[-0.95em]
& \AufgabenblattTitel & \multicolumn{3}{l|}{\bfseries\Aufgabenblatt{} \ifmusterloesung(\MusterloesungTitelblatt)\fi} \\
& & \multicolumn{3}{l|}{}\\[-0.95em]
\cline{2-5}
& & \multicolumn{3}{l|}{}\\[-0.95em]
& \PunktezahlTitel & \multicolumn{3}{l|}{\bfseries\Punktezahl} \\
& & \multicolumn{3}{l|}{}\\[-0.95em]
\cline{2-5}
& & & &\\[-0.95em]
& \AusgabedatumTitel & \bfseries\Ausgabedatum & \AbgabedatumTitel & \bfseries\Abgabedatum \\[0.25em]
\cline{1-5}
\end{tabularx}
}
% GDB-Makros laden
\RequirePackage{vsis-gdb}
% Variablen fuer Seitenkopf: Setzen mit \renewcommand{\Variable}{Wert}
\newcommand{\Vorlesung}{}
\newcommand{\Semester}{}
\newcommand{\Ausgabedatum}{}
\newcommand{\Abgabedatum}{}
\newcommand{\Aufgabenblatt}{}
\newcommand{\Punktezahl}{}
\newcommand{\MusterloesungTitel}{L\"osungsvorschlag}
\newcommand{\MusterloesungTitelblatt}{L\"osungsvorschl\"age}
\newcommand{\VorlesungTitel}{Lehrveranstaltung}
\newcommand{\AufgabenblattTitel}{Aufgabenzettel}
\newcommand{\PunktezahlTitel}{Gesamtpunktzahl}
\newcommand{\AusgabedatumTitel}{Ausgabe}
\newcommand{\AbgabedatumTitel}{Abgabe}
\newcommand{\AufgabeTitel}{Aufgabe}

136
gdb/vsis-gdb.sty Normal file
View File

@ -0,0 +1,136 @@
%
% Nuetzliche Makros und Einstellungen fuer GDB
%
% von Kristof Hamann, teilweise basierend auf Aufgabenzettel vergangener Jahre
%
% Changelog:
%
% v1.2:
% 2009-11-27 KH: Makro \wert angepasst (Schriftart)
%
% v1.1:
% 2009-11-11 KH: Neues Makro \SF
% 2009-11-11 KH: Makro \wert angepasst (Anf<6E>hrungszeichen)
%
% v1.0:
% 2009-11-09 KH: Erste Version der Makro-Sammlung
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{vsis-gdb}[2009/11/27 v1.2 Nuetzliche Makros fuer GDB]
\RequirePackage{ulsy}
\RequirePackage{setspace}
\RequirePackage[fleqn]{amsmath}
\RequirePackage{latexsym} % F<>r Befehle wie \Join
% Gestricheltes Unterstreichen, z.B. f<>r Relationales Datenbankmodell (Fremdschl<68>ssel)
\RequirePackage[normalem]{ulem}
\def\dashuline{\bgroup
\ifdim\ULdepth=\maxdimen % Set depth based on font, if not set already
\settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi
\markoverwith{\kern.1em
\vtop{\kern\ULdepth \hrule width .3em}%
\kern.1em}\ULon}
\def\soliduline{\bgroup \markoverwith{\hbox
{\vtop{\kern.3ex\hrule width.2em}}}\ULon}
% Umgebung f<>r relationale Datenbankschemata
\newenvironment{RMSchma}{\begin{raggedright}\it\doublespacing}{\end{raggedright}}
% Operatoren der relationalen Algebra
\newcommand*{\projektion}[1]{\pi_{#1}}
\newcommand*{\selektion}[1]{\sigma_{#1}}
\newcommand*{\symdiff}{\triangleright}
\newcommand*{\natverbund}{\bowtie}
\newcommand*{\verbund}[1]{\raisebox{-1ex}{\(\stackrel{\textrm{\large$\natverbund$}}{_{#1}}\)}}
\newcommand*{\wert}[1]{\mathrm{``#1``}}
\newcommand*{\SF}{\textup{SF}}
% textsubscript
\newcommand{\ts}{\textsubscript}
% TikZ fuer Grafiken, wie ER-Diagramme
\RequirePackage{tikz}
\usetikzlibrary{arrows,positioning,calc,fit,shapes}
% the vsis blue color
% RGB value / 255
\definecolor{vsisBlue}{rgb}{0.596078,0.7176471,0.937254922}
\definecolor{arrowBlue}{rgb}{0.15294117,0.31372549,0.7725490196}
\tikzset{
% Layout fuer ER-Diagramme
er-element/.style={
draw,
fill=white,
top color=white,
bottom color=vsisBlue,
minimum width=2cm,
minimum height=0.8cm,
},
entity/.style={
er-element,
rectangle,
},
weakentity/.style={
er-element,
rectangle,
double distance=1pt
},
relationship/.style={
er-element,
diamond,
aspect=2,
inner sep=2pt,
font=\footnotesize,
},
weakrelationship/.style={
er-element,
diamond,
aspect=2,
inner sep=2pt,
double distance=1pt,
font=\footnotesize,
},
multivalentattribut/.style={
er-element,
ellipse,
inner sep=0,
double distance=1pt,
font=\footnotesize,
},
attribut/.style={
er-element,
ellipse,
inner sep=0,
font=\footnotesize,
},
erbt/.style={
regular polygon, regular polygon sides=6,
draw, black, very thick, minimum size=3em
},
% Layout fuer referenzgraphen
refGraph/.style={
draw,
fill=white,
minimum width=2cm,
minimum height=0.8cm,
},
tabelle/.style={
refGraph,
rectangle,
},
}
% Layouts fuer Grafiken
\tikzset{
smalll/.style={
font=\scriptsize,
align=left,
},
smallr/.style={
font=\scriptsize,
align=right,
},
}

View File

@ -0,0 +1,296 @@
\documentclass[14pt]{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Meta informations:
\newcommand{\trauthor}{Jim Martens}
\newcommand{\trtype}{} %{Proseminar} %{Seminar} %{Workshop}
\newcommand{\trcourse}{Einführung in das wissenschaftliche Arbeiten}
\newcommand{\trtitle}{Elektronische Demokratie}
\newcommand{\trmatrikelnummer}{}
\newcommand{\tremail}{2martens@informatik.uni-hamburg.de}
\newcommand{\trinstitute}{Fachbereich Informatik}
\newcommand{\trwebsiteordate}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Languages:
% Falls die Ausarbeitung in Deutsch erfolgt:
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% \usepackage[latin9]{inputenc}
\selectlanguage{ngerman}
% If the thesis is written in English:
%\usepackage[english]{babel}
%\selectlanguage{english}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bind packages:
\usepackage{beamerthemesplit}
\usetheme{Boadilla}
%\usetheme{Copenhagen}
%\usetheme{Darmstadt}
%\usetheme{Frankfurt}
%\usetheme{Ilmenau}
%\usetheme{JuanLesPins}
%\usetheme{Madrid}
%\usetheme{Warsaw }
%\usecolortheme{dolphin}
%\setbeamertemplate{sections/subsections in toc}[sections numbered]
%\beamertemplatenavigationsymbolsempty
%\setbeamertemplate{headline}[default] % deaktiviert die Kopfzeile
\setbeamertemplate{navigation symbols}{}% deaktiviert Navigationssymbole
%\useinnertheme{rounded}
\usepackage{acronym} % Acronyms
\usepackage{algorithmic} % Algorithms and Pseudocode
\usepackage{algorithm} % Algorithms and Pseudocode
\usepackage{amsfonts} % AMS Math Packet (Fonts)
\usepackage{amsmath} % AMS Math Packet
\usepackage{amssymb} % Additional mathematical symbols
\usepackage{amsthm}
\usepackage{color} % Enables defining of colors via \definecolor
\usepackage{fancybox} % Gleichungen einrahmen
\usepackage{fancyhdr} % Paket zur schickeren der Gestaltung der
\usepackage{graphicx} % Inclusion of graphics
%\usepackage{latexsym} % Special symbols
\usepackage{longtable} % Allow tables over several parges
\usepackage{listings} % Nicer source code listings
\usepackage{lmodern}
\usepackage{multicol} % Content of a table over several columns
\usepackage{multirow} % Content of a table over several rows
\usepackage{rotating} % Alows to rotate text and objects
\usepackage[section]{placeins} % Ermoeglich \Floatbarrier fuer Gleitobj.
\usepackage[hang]{subfigure} % Allows to use multiple (partial) figures in a fig
%\usepackage[font=footnotesize,labelfont=rm]{subfig} % Pictures in a floating environment
\usepackage{tabularx} % Tables with fixed width but variable rows
\usepackage{url,xspace,boxedminipage} % Accurate display of URLs
\definecolor{uhhRed}{RGB}{254,0,0} % Official Uni Hamburg Red
\definecolor{uhhGrey}{RGB}{136,136,136} % Official Uni Hamburg Grey
\definecolor{uhhLightGrey}{RGB}{180,180,180} % Official Uni Hamburg LightGrey
\definecolor{uhhLightLightGrey}{RGB}{220,220,220} % Official Uni Hamburg LightLightGrey
\setbeamertemplate{itemize items}[ball]
\setbeamercolor{title}{fg=uhhRed,bg=white}
\setbeamercolor{title in head/foot}{bg=uhhRed}
\setbeamercolor{block title}{bg=uhhGrey,fg=white}
\setbeamercolor{block body}{bg=uhhLightLightGrey,fg=black}
\setbeamercolor{section in head/foot}{bg=black}
\setbeamercolor{frametitle}{bg=white,fg=uhhRed}
\setbeamercolor{author in head/foot}{bg=black,fg=white}
\setbeamercolor{author in footline}{bg=white,fg=black}
\setbeamercolor*{item}{fg=uhhRed}
\setbeamercolor*{section in toc}{fg=black}
\setbeamercolor*{separation line}{bg=black}
\setbeamerfont*{author in footline}{size=\scriptsize,series=\mdseries}
\setbeamerfont*{institute}{size=\footnotesize}
\newcommand{\opticalseperator}{0.0025\paperwidth}
\institute{Universit\"at Hamburg\\\trinstitute}
\title{\trtitle}
\subtitle{\trtype}
\author{\trauthor}
\date{}
\logo{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Configurationen:
%\hypersetup{pdfpagemode=FullScreen}
\hyphenation{whe-ther} % Manually use: "\-" in a word: Staats\-ver\-trag
%\lstloadlanguages{C} % Set the default language for listings
\DeclareGraphicsExtensions{.pdf,.svg,.jpg,.png,.eps} % first try pdf, then eps, png and jpg
\graphicspath{{./src/}} % Path to a folder where all pictures are located
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Custom Definitions:
\setbeamertemplate{title page}
{
\vbox{}
\vspace{0.4cm}
\begin{centering}
\begin{beamercolorbox}[sep=8pt,center,colsep=-4bp]{title}
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.20em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip0.4em
\begin{beamercolorbox}[sep=8pt,center,colsep=-4bp,rounded=true,shadow=true]{author}
\usebeamerfont{author}\insertauthor \\ \insertinstitute
\end{beamercolorbox}
\vfill
%\begin{beamercolorbox}[ht=8ex,center]{}
% \includegraphics[width=0.20\paperwidth]{wtmIcon.pdf}
% \end{beamercolorbox}%
\begin{beamercolorbox}[sep=8pt,center,colsep=-4bp,rounded=true,shadow=true]{institute}
\usebeamerfont{institute}%\trwebsiteordate
\end{beamercolorbox}
\vspace{-0.1cm}
\end{centering}
}
\setbeamertemplate{frametitle}
{
\begin{beamercolorbox}[wd=\paperwidth,ht=3.8ex,dp=1.2ex,leftskip=0pt,rightskip=4.0ex]{frametitle}%
\usebeamerfont*{frametitle}\centerline{\insertframetitle}
\end{beamercolorbox}
\vspace{0.0cm}
}
\setbeamertemplate{footline}
{
\leavevmode
\vspace{-0.05cm}
\hbox{
\begin{beamercolorbox}[wd=.32\paperwidth,ht=4.8ex,dp=2.7ex,center]{author in footline}
\hspace*{2ex}\usebeamerfont*{author in footline}\trauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.60\paperwidth,ht=4.8ex,dp=2.7ex,center]{author in footline}
\usebeamerfont*{author in footline}\trtitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.07\paperwidth,ht=4.8ex,dp=2.7ex,center]{author in footline}
\usebeamerfont*{author in footline}\insertframenumber{}
\end{beamercolorbox}
}
\vspace{0.15cm}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Additional 'theorem' and 'definition' blocks:
\newtheorem{axiom}{Axiom}[section]
%\newtheorem{axiom}{Fakt}[section] % Wenn in Deutsch geschrieben wird.
%Usage:%\begin{axiom}[optional description]%Main part%\end{fakt}
%Additional types of axioms:
\newtheorem{observation}[axiom]{Observation}
%Additional types of definitions:
\theoremstyle{remark}
%\newtheorem{remark}[section]{Bemerkung} % Wenn in Deutsch geschrieben wird.
\newtheorem{remark}[section]{Remark}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Provides TODOs within the margin:
\newcommand{\TODO}[1]{\marginpar{\emph{\small{{\bf TODO: } #1}}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Abbreviations and mathematical symbols
\newcommand{\modd}{\text{ mod }}
\newcommand{\RS}{\mathbb{R}}
\newcommand{\NS}{\mathbb{N}}
\newcommand{\ZS}{\mathbb{Z}}
\newcommand{\dnormal}{\mathit{N}}
\newcommand{\duniform}{\mathit{U}}
\newcommand{\erdos}{Erd\H{o}s}
\newcommand{\renyi}{-R\'{e}nyi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Display of TOCs:
\AtBeginSection[]
{
\setcounter{tocdepth}{2}
\frame
{
\frametitle{Outline}
\tableofcontents[currentsection]
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Document:
\begin{document}
\renewcommand{\arraystretch}{1.2}
\begin{frame}[plain] % plain => kein Rahmen
\titlepage
\end{frame}
%\setcounter{framenumber}{0}
\frame{
\frametitle{Outline}
\tableofcontents
}
%%%%%%%%%%%%%%
% Your Content
\section{Herleitung}
\frame[t]{
\frametitle{Beispiele}
\only<1-5>{
\begin{itemize}
\item<1-5> Terminfindung per Dudle
\item<2-5> Petitionen
\item<3-5> Crowdfunding - Abstimmen mit Geld
\begin{itemize}
\item<4-5> Star Citizen
\item<5> Oculus Rift
\end{itemize}
\end{itemize}
}
}
\section{3-Phasen Modell}
\frame[t]{
\frametitle{3-Phasen Modell}
\begin{itemize}
\item<1-> Single-point-of-entry
\item<2-> E-Government
\item<3> eins-zu-eins Beziehung zwischen Staat und Bürger
\end{itemize}
}
\section{Kritische Diskussion}
\frame[t]{
\only<1-2>{
\frametitle{Vorteile}
\begin{itemize}
\item<1-> Erleichterung der Informationsbeschaffung
\item<2> Vereinfachung der Interaktion
\item<2> gesteigerte Effizienz
\item<2> erhöhte Transparenz
\end{itemize}
}
\only<3->{
\frametitle{Nachteile}
\begin{itemize}
\item<4-> Arbeitsplatzverlust
\item<5-> Einschnitt in Privatsphäre
\item<6-> erhöhtes Risiko des Identitätsdiebstahls
\item<6-> Gefahr von politischer Verfolgung
\end{itemize}
}
}
\section{Auswertung}
\frame[t]{
\frametitle{Auswertung}
\begin{itemize}
\item<1-> Übertragung aufs Internet nötig
\item<2> unter Beachtung integraler Prinzipien
\end{itemize}
}
%%%%%%%%%%%%%%
\frame[c]{
\frametitle{Ende}
\begin{center}
Danke für Eure Aufmerksamkeit.\\[1ex]
Fragen?\\[5ex]
\end{center}
}
\end{document}

190
mk/bib.bib Executable file
View File

@ -0,0 +1,190 @@
% This file was created with JabRef 2.9b2.
% Encoding: UTF-8
@ARTICLE{Aagren2001,
author = {Ågren, Per-Olof},
title = {Is online democracy in the EU for professionals only?},
journal = {Communications of the ACM},
year = {2001},
volume = {44},
pages = {36-38},
number = {1},
month = {January},
abstract = {A directive of the EU protects the privacy very harsh. This directive
forbids mentioning anything privacy related of any person without
their declared consent. This makes e-democracy in the form of e.g.
bulletin boards close to impossible as it isn't really possible to
discuss a statement of a person without identifying the person.
As it is a directive the EU member states have to interpret the directive
into national law. Sweden has made a law that follows the directive
to the letter. That resulted in 296 reports of violation of this
law between October 1998 and August 2000. Another law in Sweden restricts
e-democracy in another way. The person who initiates a bulletin board
is responsible for all its content. This constraint leads to a situation
where fear stops people from engaging in e-democracy. Fear to violate
such rules.
The EU directive allows processing of personal data only for journalistic,
artistic and literary purposes which results in the opinion of the
EU parliament that enough freedom of expression in virtual forums
is achieved when authors, journalists and artists are free to engage
in political discussions. That way democratic debate becomes a purely
professional activity and thereby reflects a very thin democracy
model.},
issue = {1},
journaltitle = {Communications of the ACM},
owner = {jim},
quality = {1},
timestamp = {2013.10.28}
}
@ARTICLE{Mohen2001,
author = {Mohen, Joe and Glidden, Julia},
title = {The case for internet voting},
journal = {Communications of the ACM},
year = {2001},
volume = {44},
pages = {72-85},
number = {1},
month = {January},
abstract = {The internet voting is explored with the example of the Arizona presidential
preference elections. That election allowed for the first time ever
to vote from every place around the world (as long as you were a
registered Democrat in Arizona). It also included the option to vote
by mail, offering the same convenience as voting by Internet. But
you were able to vote traditionally in a polling station either.
A massive campaign was started to increase the awareness of the election.
Many third parties were invited to monitor the voting process.
To authenticate the voters each registered Democrat received a randomly
generated seven digit PIN. In addition they were given two challenge
questions (date of birth or last four digits of a social security
number) which were randomly selected from a strictly confidential
field of five. To prevent overvoting, the system voided ballots from
reuse once they were cast. They were also voided when a voter requested
a mail-in ballot or disclosed that his/her name or address was incorrect.
In the latter case the voter had to vote in person in one of the
polling stations.
Moreover voters had to explicetly state their voting eligibility.
A false information is a 6 class felony, worthy of jail time. Digital
signature were used to identify the specific voting servers being
used.
The votes were encrypted and then saved encrypted in a database of
election.com. But election.com didn't have the private key. Only
once election was over, the encrypted set of data was given to the
third party that was able to decrypt the votes. A single bit of error
in the encrypted data would have led to not accepting that vote.
It is remarkable that no single vote has been rejected.
Internet voting can only be one element of a legally binding election.
To give everyone the same opportunity to vote, the Internet voting
took place four days prior to Election Day. On the Election Day itself
Internet voting was not allowed. The goal was to prevent anyone from
waiting till the last second to vote via computer.
Internet voting is most useful on the small level where people able
to sabotage the electronic voting process mostly don't bother. Still
the PC from which the voting is performed is a security risk. Of
the whole 96 hours available for Internet voting, the site wasn't
available for one hour only due to a router problem. For each server
there were backups to prevent data loss.
Learned lessions:
Many voters have an around-the-clock lifestyle and want to be among
the first to vote online. Therefore even more servers are required
to process the peak at the beginning.
Current browsers are required.
Internet voting at polling stations offers no extra value and increases
the cost of elections.
When should Internet voting be used? In what manner and at what cost?
These questions should be answered by politicians and the people
who vote them, not technology developers and vendors.},
issue = {1},
journaltitle = {Communications of the ACM},
owner = {jim},
quality = {1},
timestamp = {2013.10.28}
}
@ARTICLE{Watson2001,
author = {Watson, Richard T. and Mundy, Bryan},
title = {A strategic perspective of electronic democracy},
journal = {Communications of the ACM},
year = {2001},
volume = {44},
pages = {27-30},
number = {1},
month = {January},
abstract = {E-Democracy can be introduced via a three phase structure. During
initiation the citizens must get one portal that gives them access
to all levels of government (from local residence to U.S. president
or alike in other countries). This portal would give them all relevant
info based upon their postal code. All they need to remember is the
URL of the portal and their postal code which reduces searching effort
significantly.
Another important aspect is web-based payment. Around $3 trillion
exchanges hands between governments and U.S. citizens each year.
But the overwhelming majority happens via traditional checks, cash
and money orders. Less than 0.5% are web-enabled. Web-bases payment
allows for reduced travel to all the different agencies as many actions
require physical presence nowadays. By reducing this travel the environment
can profit from e-payment as well.
In the second phase most governments adopt to the principles of e-government.
Most payments are handled via the Web and governments become more
efficient via two approaches. Small governments opt for an application
service provider (ASP) solution whereas large governments implement
in-house systems.
Political decision making becomes more and more transparent. Citizens
can find out what steps a certain peace of legislation takes from
the first thoughts to signing the bill by the president. They can
find out about all stakeholders of the process and who is involved.
This gives citizens an inside perspective about the law making process
and allows for increased citizen influence over the politicians.
The final third phase is the customization and creates a one-to-one
relation between government and citizen. Via a personal profile a
citizen can manage all financial transactions with every government
level. A change of address will be one transaction that notifies
everyone involved. Even further it is possible to show the citizen
how much of the paid taxes are used e.g. for education or national
parks.
This involvement into the process creates a much bigger attachment
for democracy and the decision making process and abstracts away
everything that one doesn't have to know.},
issue = {1},
journaltitle = {Communications of the ACM},
owner = {jim},
quality = {1},
timestamp = {2013.10.28}
}

12
mk/feedback.txt Normal file
View File

@ -0,0 +1,12 @@
Feedback zu Vortrag Elektronische Demokratie
* roter Faden war nicht zu erkennen
* Gesamtüberblick über Elektronische Demokratie
* auf einen einzelnen Aspekt konzentrieren
* aktuellere Quellen benutzen (z.B. Piratenpartei, etc.)
* mehr Quellen
* Vergleich basierend auf mehreren Quellen
* Definition der Begriffe
* miteinbeziehen des Publikums bei einem so populären Thema

277
mk/mkpaper.tex Executable file
View File

@ -0,0 +1,277 @@
\documentclass[12pt,twoside,ngerman]{scrartcl}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Meta informations:
\newcommand{\trauthor}{Jim Martens}
\newcommand{\trtype}{Paper} %{Seminararbeit} %{Proseminararbeit}
\newcommand{\trcourse}{Einf\"uhrung in das wissenschaftliche Arbeiten}
\newcommand{\trtitle}{Elektronische Demokratie}
\newcommand{\trmatrikelnummer}{6420323}
\newcommand{\tremail}{2martens@informatik.uni-hamburg.de}
\newcommand{\trarbeitsbereich}{}
\newcommand{\trdate}{06.11.2013}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Languages:
% Falls die Ausarbeitung in Deutsch erfolgt:
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
%\usepackage[latin1]{inputenc}
\usepackage[utf8]{inputenc}
\selectlanguage{ngerman}
% If the thesis is written in English:
%\usepackage[english]{babel}
%\selectlanguage{english}
%\addto{\captionsenglish}{\renewcommand{\refname}{Bibliography}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bind packages:
\usepackage{acronym} % Acronyms
\usepackage{algorithmic} % Algorithms and Pseudocode
\usepackage{algorithm} % Algorithms and Pseudocode
\usepackage{amsfonts} % AMS Math Packet (Fonts)
\usepackage{amsmath} % AMS Math Packet
\usepackage{amssymb} % Additional mathematical symbols
\usepackage{amsthm}
\usepackage{booktabs} % Nicer tables
%\usepackage[font=small,labelfont=bf]{caption} % Numbered captions for figures
\usepackage{color} % Enables defining of colors via \definecolor
\definecolor{uhhRed}{RGB}{254,0,0} % Official Uni Hamburg Red
\definecolor{uhhGrey}{RGB}{122,122,120} % Official Uni Hamburg Grey
\usepackage{fancybox} % Gleichungen einrahmen
\usepackage{fancyhdr} % Packet for nicer headers
%\usepackage{fancyheadings} % Nicer numbering of headlines
%\usepackage[outer=3.35cm]{geometry} % Type area (size, margins...) !!!Release version
%\usepackage[outer=2.5cm]{geometry} % Type area (size, margins...) !!!Print version
%\usepackage{geometry} % Type area (size, margins...) !!!Proofread version
\usepackage[outer=3.15cm]{geometry} % Type area (size, margins...) !!!Draft version
\geometry{a4paper,body={5.8in,9in}}
\usepackage{graphicx} % Inclusion of graphics
%\usepackage{latexsym} % Special symbols
\usepackage{longtable} % Allow tables over several parges
\usepackage{listings} % Nicer source code listings
\usepackage{multicol} % Content of a table over several columns
\usepackage{multirow} % Content of a table over several rows
\usepackage{rotating} % Alows to rotate text and objects
\usepackage[hang]{subfigure} % Allows to use multiple (partial) figures in a fig
%\usepackage[font=footnotesize,labelfont=rm]{subfig} % Pictures in a floating environment
\usepackage{tabularx} % Tables with fixed width but variable rows
\usepackage{url,xspace,boxedminipage} % Accurate display of URLs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Configurationen:
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
\hyphenation{whe-ther} % Manually use: "\-" in a word: Staats\-ver\-trag
%\lstloadlanguages{C} % Set the default language for listings
\DeclareGraphicsExtensions{.pdf,.svg,.jpg,.png,.eps} % first try pdf, then eps, png and jpg
\graphicspath{{./src/}} % Path to a folder where all pictures are located
\pagestyle{fancy} % Use nicer header and footer
% Redefine the environments for floating objects:
\setcounter{topnumber}{3}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4}
\renewcommand{\topfraction}{0.9} %Standard: 0.7
\renewcommand{\bottomfraction}{0.5} %Standard: 0.3
\renewcommand{\textfraction}{0.1} %Standard: 0.2
\renewcommand{\floatpagefraction}{0.8} %Standard: 0.5
% Tables with a nicer padding:
\renewcommand{\arraystretch}{1.2}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Additional 'theorem' and 'definition' blocks:
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
%\newtheorem{theorem}{Satz}[section] % Wenn in Deutsch geschrieben wird.
\newtheorem{axiom}{Axiom}[section]
%\newtheorem{axiom}{Fakt}[chapter] % Wenn in Deutsch geschrieben wird.
%Usage:%\begin{axiom}[optional description]%Main part%\end{fakt}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
%Additional types of axioms:
\newtheorem{lemma}[axiom]{Lemma}
\newtheorem{observation}[axiom]{Observation}
%Additional types of definitions:
\theoremstyle{remark}
%\newtheorem{remark}[definition]{Bemerkung} % Wenn in Deutsch geschrieben wird.
\newtheorem{remark}[definition]{Remark}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Provides TODOs within the margin:
\newcommand{\TODO}[1]{\marginpar{\emph{\small{{\bf TODO: } #1}}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Abbreviations and mathematical symbols
\newcommand{\modd}{\text{ mod }}
\newcommand{\RS}{\mathbb{R}}
\newcommand{\NS}{\mathbb{N}}
\newcommand{\ZS}{\mathbb{Z}}
\newcommand{\dnormal}{\mathit{N}}
\newcommand{\duniform}{\mathit{U}}
\newcommand{\erdos}{Erd\H{o}s}
\newcommand{\renyi}{-R\'{e}nyi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Document:
\begin{document}
\renewcommand{\headheight}{14.5pt}
\fancyhead{}
\fancyhead[LE]{ \slshape \trauthor}
\fancyhead[LO]{}
\fancyhead[RE]{}
\fancyhead[RO]{ \slshape \trtitle}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Cover Header:
\begin{titlepage}
\begin{flushleft}
Universit\"at Hamburg\\
Fachbereich Informatik\\
% \trarbeitsbereich\\
\end{flushleft}
\vspace{3.5cm}
\begin{center}
\huge \trtitle\\
\end{center}
\vspace{3.5cm}
\begin{center}
\normalsize\trtype\\
[0.2cm]
\Large\trcourse\\
[1.5cm]
\Large \trauthor\\
% [0.2cm]
% \normalsize Matr.Nr. \trmatrikelnummer\\
[0.2cm]
\normalsize\tremail\\
[1.5cm]
\Large \trdate
\end{center}
\vfill
\end{titlepage}
%backsite of cover sheet is empty!
\thispagestyle{empty}
\hspace{1cm}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Abstract:
% Abstract gives a brief summary of the main points of a paper:
\section*{Abstract}
Demokratie ist eine wichtige Errungenschaft der Menschheit. Das Internet ist das technologische Gegenstück, das wohl einen ähnlichen tiefgreifenden Einfluss in die Gesellschaft genommen hat. Elektronische Demokratie befasst sich mit der Frage die Demokratie auf das Internet auszudehnen. Dieses Vorhaben hat naturgemäß Vor- und Nachteile, mit denen sich in diesem Paper befasst wird.
% Lists:
\setcounter{tocdepth}{2} % depth of the table of contents (for Seminars 2 is recommended)
\tableofcontents
\pagenumbering{arabic}
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Content:
% the actual content, usually separated over a number of sections
% each section is assigned a label, in order to be able to put a
% crossreference to it
\section{Einleitung}
\label{sec:introduction}
Es ist so ziemlich jedem bekannt was Demokratie ist. Demokratie bezeichnet die Herrschaft des Volkes und ist die Regierungsform in vielen Ländern, wie unter anderem die USA, Kanada, Frankreich und Deutschland. In jedem dieser Länder ist sie ein wenig anders organisiert, aber ihr Markenkern ist derselbe. Durch das Aufkommen vom Internet hat sich die Bezahlkultur längst gewandelt. Viele Menschen bestellen sich Waren aus dem Internet von Firmen wie Amazon und bekommen die Waren dann an die Tür geliefert.
Diese Form des webbasierten Bezahlens nennt sich "`E-Commerce"'. Was passiert aber, wenn die Demokratie auf eben jenes Internet erweitert wird? Dabei sind nicht losgelöste Abstimmungen gemeint, sondern die Erweiterung der Demokratie in den Staaten auf das Internet. In welcher Form kann dies geschehen? Ist es überhaupt vernünftig?
Es gibt reichlich Fragen zu diesem Thema. Im Rahmen dieses Papers wird eine Begriffserklärung für elektronische Demokratie versucht, um dann auf Basis dieses Begriffes ein Konzept von Watson\cite{Watson2001} kritisch zu diskutieren und abschließend zu einem Fazit zu kommen.
\section{Begriffserklärung}
\label{sec:definition}
Elektronische Demokratie ist also die irgendwie geartete Erweiterung der bestehenden analogen Demokratie auf das Internet. Aber wie läuft das eigentlich genau ab?
Diese Frage wird zum Teil durch Watson\cite{Watson2001} geklärt. Er erläutert eine strategische Perspektive zur Einführung von elektronischer Demokratie. Diese Einführung findet in Form eines 3-Phasen-Modells statt.
Die Kernpunkte seines Konzeptes sind die Bündelung der Informationen über die einzelnen Regierungen in einem Land (von der Rathausebene bis hin zur Bundesebene) auf einer zentralen Internetseite und das Verwalten aller Amtsgeschäfte aus Bürgersicht über diese Internetseite. Diese beiden Punkte spiegeln Transparenz, Zugänglichkeit und Komfort wieder.
Kurz zusammengefasst bedeutet elektronische Demokratie also unter anderem, dass das Abwickeln der Amtsgeschäfte vereinheitlicht und damit vereinfacht wird und die Bürger alle Informationen an zentraler Stelle finden können und nicht erst zig Seiten und Amtsstellen abklappern müssen.
Diese Sicht auf elektronische Demokratie ist mit Sicherheit nicht abschließend. Es gibt auch noch den Punkt des elektronischen Wählens, wie ihn Mohen\cite{Mohen2001} anhand einer Fallstudie aus Arizona (USA) beschreibt.
Daran wird deutlich, dass elektronische Demokratie weit mehr ist als das, was Watson in seinem Artikel beschreibt.
\section{Kritische Diskussion}
\label{sec:critDisc}
Die von Watson\cite{Watson2001} erläuterte strategische Perspektive klingt auf den ersten Blick sehr verlockend. Allerdings hat auch diese Idee ihre negativen Auswirkungen. In der folgenden Diskussion werden die Vor- und Nachteile von Watsons Idee gegenübergestellt. Die Pro-Argumente werden dabei aus Watsons Idee übernommen, schließlich stellt er diese Perspektive nicht vor weil sie in seinen Augen unzureichend ist, wohingegen die Contra-Argumente aus meiner Perspektive dargelegt werden. Daraus kann jedoch nicht meine Position zu dieser Idee gefolgert werden.
Der erste Schritt Watsons ist die Schaffung eines zentralen Portals, von wo aus die Bürger je nach Postleitzahl zu allen relevanten Stellen verlinkt werden.
Der Vorteil dieses zentralen Einstiegspunktes ist offensichtlich. Die Bürger müssen sich nur noch eine URL und ihre Postleitzahl merken, um alle notwendigen Informationen zu finden.
Einen direkten Nachteil gibt es dort nicht, denn die darunter liegenden Websites der einzelnen Regierungen und staatlichen Stellen existieren weiterhin. Durch den single-point-of-entry wird jedoch das Auffinden der zuständigen Stellen erheblich erleichtert.
Im zweiten Schritt haben die meisten Regierungen die Prinzipien von "`E-Government"' übernommen. Damit haben Bürger die Möglichkeit den Großteil ihrer Finanztransaktionen mit staatlichen Stellen über das Internet abzuwickeln. Kleine Regierungen und staatliche Stellen benutzen dabei dritte Dienstleister, um diesen Service anzubieten, wohingegen größere Regierungen und staatliche Stellen eigene Lösungen benutzen.
Der Vorteil ist die starke Vereinfachung der Interaktion mit dem Staat. Durch die Einsparung von physischen Besuchen bei den Ämtern sparen Bürger Zeit und Kosten und das Regieren wird effizienter.
Der Nachteil ist, dass damit viele Mitarbeiter im staatlichen Dienst ebenfalls obsolet werden. Es werden keine Mitarbeiter mehr benötigt, die Überweisungen entgegen nehmen oder vor Ort Informationen an Bürger weitergeben.
Auf Seiten der Effizienz wird die politische Entscheidungsfindung zunehmend transparenter. Bürger können am Prozess teilhaben und herausfinden, wie zukünftige Gesetze entstehen. Dabei erfahren sie auch welche politischen Interessensgruppen, Industrievertreter, Lobbyisten und Politiker diese zukünftigen Gesetze entwerfen. Darüber hinaus können sie erfahren warum bestimmte Gruppen versuchen politische Vorteile zu bekommen.
Für Bürger ist diese Steigerung an Transparenz ganz klar ein Vorteil. Durch einen transparenten Gesetzesfindungsprozess können einseitige Lobbyinteressen viel schwieriger durchgesetzt werden. Bürger haben zeitig die Möglichkeit zu intervenieren, wenn Gesetze nicht ihren Wünschen entsprechen. Damit wird den Bürgern effektiv auch eine Möglichkeit gegeben eine Lobby zu sein.
Bedenkenswert sind die dafür nötigen impliziten Schritte. Dafür müssen Sitzungsprotokolle von Ausschüssen sowie die Telefonate und Schriftwechsel aller Politiker veröffentlicht werden. Dies stellt einen gravierenden Einschnitt in die Privatsphäre dar und erfordert in vielen Demokratien weitgehende Änderungen. Somit ist dieses Vorhaben trotz der hehren Ziele wohl vorerst nicht erreichbar. Gerade vor dem Hintergrund des sog. NSA-Skandals ist eine solche Transparenz des Gesetzgebungsverfahrens wohl auf absehbare Zeit unrealistisch.
Fairerweise muss gesagt werden, dass auch Watson auf diesen Missstand hinweist.
Der letzte Schritt bzw. die letzte Phase ist die Errichtung einer eins-zu-eins Beziehung zwischen Staat und Bürger. Alle Bürger haben ein elektronisch verwaltetes Konto über das alle Finanz- oder sonstigen Transaktionen mit dem Staat abgewickelt werden. Eine Adressänderung wäre somit eine einzige Transaktion, die dann alle beteiligten staatlichen Stellen automatisch benachrichtigen würde.
Desweiteren bekommen Bürger in dieser Phase eine detaillierte Auflistung wofür ihre Zahlungen verwendet werden. So könnte eingesehen werden, wie viel der Steuern bspw. für Bildung ausgegeben werden.
Diese Phase bietet eine weitere Vereinfachung der Interaktion mit dem Staat, was ein klarer Vorteil ist. Durch die individuelle Auflistung der Verwendung der Steuern und Abgaben für jeden Bürger wird die Bedeutung eben jener Abgaben deutlich. Es ist für jeden Bürger ersichtlich was er mit seinen Abgaben unterstützt. Damit wird die Verbindung zwischen Steuerzahlungen und Wertschaffung explizit und nachvollziehbar.
Es gibt aber auch hier einige Bedenken. Wenn jeder Bürger alle offiziellen Tätigkeiten über ein zentrales Profil abwickelt, dann wird Identitätsdiebstahl sehr viel einfacher. Auch sind die Daten von Bürgern weitaus gefährdeter. Wenn die Datenbank mit den Daten gehackt wird, dann besteht Zugriff auf alle Daten aller Bürger, die dann meistbietend verkauft werden könnten.
Außerdem erlaubt dies auch für den Staat Einblicke in Sachverhalte, die ihn nichts angehen. Durch die Kombination aller staatlichen Interaktion in einem einzigen Konto, können viel leichter Profile über Personen erstellt werden. Geheimdienste hätten so auf einen Schlag alle interessanten Informationen an einem Platz.
Der letzte Schritt in Watsons Idee umfasst eine weitere Individualisierung. So können Bürger auswählen welche Themenfelder sie interessieren und darüber auf dem Laufen gehalten werden. Wenn sich jemand für Trends in der Verwaltung von Nationalparks interessiert, könnte er sich eines elektronischen Lobbyagenten oder Lobbybots bedienen, um dieses Themengebiet zu beobachten und den politischen Prozess zu beeinflussen.
Der Vorteil ist auch hier klar erkennbar. Bürger können sich aus der Fülle an Informationen die Bereiche herausnehmen, die für sie interessant sind und sich somit spezialisieren. Dies ermöglicht aktive Teilhabe am politischen Prozess ohne selber aktiv in der Politik zu sein. Damit ist die Integration der Bevölkerung in die Gesetzesfindung weitaus besser als vorher.
Der Vorteil ist hier der Nachteil zugleich. Denn durch die Möglichkeit der Präferenz ist es umso leichter zu ermitteln wer sich für welche Themen interessiert. Damit können oben genannte Profile weiter verfeinert werden und in Verbindung mit anderen Daten von Bürgern zu ernsthaften Problemen führen. Geheimdienste könnten diese Informationen in Verbindung mit gespeicherten Emails dazu nutzen Bürger aufgrund ihrer politischen Partizipation zu verfolgen.
Wenn ein Bürger sich zum Beispiel für Außenpolitik interessiert (als Präferenz in dem zentralen Konto) und sich gleichzeitig in Gesprächen mit Freunden positiv gegenüber suspekten Staaten äußert (bspw. Iran im Falle der USA), könnten die Geheimdienste vermuten, dass dieser Bürger eventuell ein Spion des Irans (in diesem Beispiel) ist. Ein komplett unschuldiger Bürger kann somit in das Fadenkreuz von entsprechenden Diensten kommen, nur wegen politischer Partizipation und einer Meinung, die nicht der offiziellen Linie der Regierung entspricht.
Alleine die Möglichkeit eines solchen Beispiels ist schon sehr bedenklich in einer Demokratie.
\section{Auswertung}
\label{sec:concl}
In der Diskussion um die Vor- und Nachteile von Watsons 3-Phasen-Konzepts ist deutlich geworden, dass es unter guten Umständen sehr helfen kann die Demokratie zu verbessern. Es ist aber auch deutlich geworden, dass eben jenes Konzept in der Lage ist die Demokratie noch weiter zu gefährden.
Abschließend kann daher hier weder behauptet werden, dass dieses Konzept sofort umgesetzt werden sollte, noch dass es keinen weiteren Gedanken verdient. Das Konzept zeigt eine Möglichkeit der Veränderung auf, die in Teilen heute (12 Jahre später) bereits vorhanden ist. In jedem Falle kann es als Diskussionsgrundlage für Veränderungen in der Umsetzung von Demokratie dienen.
Es ist in Zukunft unvermeidbar mehr und mehr die Demokratie auch über das Internet verfügbar zu machen. Entsprechende Änderungen müssen aber sorgsam und mit Rücksicht auf integrale Prinzipien der Demokratie durchgeführt werden.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% hier werden - zum Ende des Textes - die bibliographischen Referenzen
% eingebunden
%
% Insbesondere stehen die eigentlichen Informationen in der Datei
% ``bib.bib''
%
%\clearpage
\bibliography{bib}
\bibliographystyle{ieeetr}
\addcontentsline{toc}{section}{Literatur}% Add to the TOC
\end{document}

View File

@ -144,7 +144,7 @@ Stephan Niendorf (6242417)}
\end{alignat*}
\subsection{} %b
\begin{alignat*}{7}
\text{maximiere}\; & 13a_{1} &+& 8a_{2} &+& 15b_{1} &+& 12b_{2} &+& 14c_{1} &+& 10c_{2} && \\
\text{maximiere}\; & 8a_{1} &+& 3a_{2} &+& 6b_{1} &+& 3b_{2} &+& 9c_{1} &+& 5c_{2} && \\
\multicolumn{14}{l}{\text{unter den Nebenbedingungen}} && \\
& a_{1} &+& a_{2} && && && && &\leq &\, 400 \\
& && && b_{1} &+& b_{2} && && &\leq &\, 480 \\

View File

@ -0,0 +1,375 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usetikzlibrary{matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
% ensures that paragraphs are separated by empty lines
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
% define how the sections are rendered
\def\thesection{\arabic{section})}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
% some matrix magic
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\begin{document}
\author{Jan Branitz (6326955), Jim Martens (6420323),\\
Stephan Niendorf (6242417)}
\title{Hausaufgaben zum 28. Oktober}
\maketitle
\section{} %1
\subsection{} %a
\textbf{Aufgabe:} Lösen Sie das folgende LP-Problem mit dem Simplexverfahren:
\begin{alignat*}{4}
\text{maximiere}\; & x_{1} &+& 6x_{2} &-& 4x_{3} && \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
\;& 2x_{1} && &+& x_{3} &\leq & 5 \\
\;-& x_{1} &+& 3x_{2} &-& 2x_{3} &\leq & 2 \\
\;& && x_{2} &-& x_{3} &\leq & 2 \\
\multicolumn{6}{r}{$x_{1}, x_{2}, x_{3}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{5}
x_{4} \,&=&\, 5 \,&-&\, 2x_{1} && &-&\, x_{3} \\
x_{5} \,&=&\, 2 \,&+&\, x_{1} \,&-&\, 3x_{2} \,&+&\, 2x_{3} \\
x_{6} \,&=&\, 2 && &-&\, x_{2} \,&+&\, x_{3} \\ \cline{1 - 9}
z &=& && x_{1} \,&+&\, 6x_{2} \,&-&\, 4x_{3}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{2}$\\
Ausgangsvariable: $x_{5}$
Es folgt
\begin{alignat*}{2}
3x_{2} \,&=&&\, 2 + x_{1} + 2x_{3} - x_{5} \\
x_{2} \,&=&&\, \frac{2}{3} + \frac{1}{3}x_{1} + \frac{2}{3}x_{3} - \frac{1}{3}x_{5} \\
x_{4} \,&=&&\, 5 - 2x_{1} - x_{3} \\
x_{6} \,&=&&\, 2 - \left(\frac{2}{3} + \frac{1}{3}x_{1} + \frac{2}{3}x_{3} - \frac{1}{3}x_{5}\right) + x_{3} \\
&=&&\, 2 - \frac{2}{3} - \frac{1}{3}x_{1} - \frac{2}{3}x_{3} + \frac{1}{3}x_{5} + x_{3} \\
&=&&\, \frac{4}{3} - \frac{1}{3}x_{1} + \frac{1}{3}x_{3} + \frac{1}{3}x_{5} \\
z \,&=&&\, x_{1} + 6\left(\frac{2}{3} + \frac{1}{3}x_{1} + \frac{2}{3}x_{3} - \frac{1}{3}x_{5}\right) - 4x_{3} \\
&=&&\, x_{1} + 4 + 2x_{1} + 4x_{3} - 2x_{5} - 4x_{3} \\
&=&&\, 4 + 3x_{1} - 2x_{5}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{5}
x_{2} \,&=&\, \frac{2}{3} \,&+&\, \frac{1}{3}x_{1} \,&+&\, \frac{2}{3}x_{3} \,&-&\, \frac{1}{3}x_{5} \\
x_{4} \,&=&\, 5 \,&-&\, 2x_{1} \,&-&\, x_{3} && \\
x_{6} \,&=&\, \frac{4}{3} \,&-&\, \frac{1}{3}x_{1} \,&+&\, \frac{1}{3}x_{3} \,&+&\, \frac{1}{3}x_{5} \\ \cline{1 - 9}
z &=& 4 \,&+&\, 3x_{1} && &-& 2x_{5}
\end{alignat*}
\underline{2. Iteration}:
Eingangsvariable: $x_{1}$ \\
Ausgangsvariable: $x_{4}$
Es folgt
\begin{alignat*}{2}
2x_{1} &=&& 5 - x_{3} - x_{4} \\
x_{1} &=&& \frac{5}{2} - \frac{1}{2}x_{3} - \frac{1}{2}x_{4} \\
x_{2} &=&& \frac{2}{3} + \frac{1}{3}\left(\frac{5}{2} - \frac{1}{2}x_{3} - \frac{1}{2}x_{4}\right) + \frac{2}{3}x_{3} - \frac{1}{3}x_{5} \\
&=&& \frac{3}{2} - \frac{1}{6}x_{3} - \frac{1}{6}x_{4} + \frac{2}{3}x_{3} - \frac{1}{3}x_{5} \\
&=&& \frac{3}{2} + \frac{1}{2}x_{3} - \frac{1}{6}x_{4} - \frac{1}{3}x_{5} \\
x_{6} &=&& \frac{4}{3} - \frac{1}{3}\left(\frac{5}{2} - \frac{1}{2}x_{3} - \frac{1}{2}x_{4}\right) + \frac{1}{3}x_{3} + \frac{1}{3}x_{5} \\
&=&& \frac{1}{2} + \frac{1}{6}x_{3} + \frac{1}{6}x_{4} + \frac{1}{3}x_{3} + \frac{1}{3}x_{5} \\
&=&& \frac{1}{2} + \frac{1}{2}x_{3} + \frac{1}{6}x_{4} + \frac{1}{3}x_{5} \\
z &=&& 4 + 3\left(\frac{5}{2} - \frac{1}{2}x_{3} - \frac{1}{2}x_{4}\right) - 2x_{5} \\
&=&& \frac{23}{2} - \frac{3}{2}x_{3} - \frac{3}{2}x_{4} - 2x_{5} \\
&=&& \frac{23}{2} - \frac{3}{2}x_{3} - \frac{3}{2}x_{4} - 2x_{5}
\end{alignat*}
\underline{Ergebnis der 2. Iteration}:
\begin{alignat*}{5}
x_{1} \,&=&\, \frac{5}{2} \,&-&\, \frac{1}{2}x_{3} \,&-&\, \frac{1}{2}x_{4} && \\
x_{2} \,&=&\, \frac{3}{2} \,&+&\, \frac{1}{2}x_{3} \,&-&\, \frac{1}{6}x_{4} \,&-&\, \frac{1}{3}x_{5} \\
x_{6} \,&=&\, \frac{1}{2} \,&+&\, \frac{1}{2}x_{3} \,&+&\, \frac{1}{6}x_{4} \,&+&\, \frac{1}{3}x_{5} \\ \cline{1 - 9}
z &=& \frac{23}{2} \,&-&\, \frac{3}{2}x_{3} \,&-&\, \frac{3}{2}x_{4} \,&-&\, 2x_{5}
\end{alignat*}
Dieses Tableau liefert die optimale Lösung $x_{1} = \frac{5}{2}, x_{2} = \frac{3}{2}, x_{3} = 0$ mit $z = \frac{23}{2}$.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 0, x_{4} = 5, x_{5} = 2, x_{6} = 2 \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 0, x_{2} = \frac{2}{3}, x_{3} = 0, x_{4} = 5, x_{5} = 0, x_{6} = \frac{4}{3} \text{ mit } z = 4
\]
\underline{Zulässige Basislösung nach der 2. Iteration}:
\[
x_{1} = \frac{5}{2}, x_{2} = \frac{3}{2}, x_{3} = 0, x_{4} = 0, x_{5} = 0, x_{6} = \frac{1}{2} \text{ mit } z = \frac{23}{2}
\]
\subsection{} %b
\textbf{Aufgabe:} Lösen Sie das folgende LP-Problem mit dem Simplexverfahren:
\begin{alignat*}{4}
\text{maximiere}\; -& 5x_{1} &+& 11x_{2} &-& 5x_{3} && \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
\;-& x_{1} &+& 3x_{2} &-& 4x_{3} &\leq & 2 \\
\;& x_{1} &+& 5x_{2} &+& 3x_{3} &\leq & 6 \\
\;-& x_{1} &+& 3x_{2} &+& 3x_{3} &\leq &\, 4 \\
\;& x_{1} &-& x_{2} &+& 3x_{3} &\leq &\, 2 \\
\multicolumn{6}{r}{$x_{1}, x_{2}, x_{3}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{5}
x_{4} \,&=&\, 2 \,&+&\, x_{1} \,&-&\, 3x_{2} \,&+&\, 4x_{3} \\
x_{5} \,&=&\, 6 \,&-&\, x_{1} \,&-&\, 5x_{2} \,&-&\, 3x_{3} \\
x_{6} \,&=&\, 4 \,&+&\, x_{1} \,&-&\, 3x_{2} \,&-&\, 3x_{3} \\
x_{7} \,&=&\, 2 \,&-&\, x_{1} \,&+&\, x_{2} \,&-&\, 3x_{3} \\ \cline{1 - 9}
z \,&=&\, &-& 5x_{1} \,&+&\, 11x_{2} \,&-&\, 5x_{3}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{2}$\\
Ausgangsvariable: $x_{4}$
Es folgt
\begin{alignat*}{2}
3x_{2} \,&=&&\, 2 + x_{1} + 4x_{3} - x_{4} \\
x_{2} \,&=&&\, \frac{2}{3} + \frac{1}{3}x_{1} + \frac{4}{3}x_{3} - \frac{1}{3}x_{4} \\
x_{5} \,&=&&\, 6 - x_{1} - 5\left(\frac{2}{3} + \frac{1}{3}x_{1} + \frac{4}{3}x_{3} - \frac{1}{3}x_{4}\right) - 3x_{3} \\
&=&& 6 - x_{1} - \frac{10}{3} - \frac{5}{3}x_{1} - \frac{20}{3}x_{3} + \frac{5}{3}x_{4} - 3x_{3} \\
&=&& \frac{8}{3} - \frac{8}{3}x_{1} - \frac{29}{3}x_{3} + \frac{5}{3}x_{4} \\
x_{6} \,&=&&\, 4 + x_{1} - 3\left(\frac{2}{3} + \frac{1}{3}x_{1} + \frac{4}{3}x_{3} - \frac{1}{3}x_{4}\right) - 3x_{3} \\
&=&&\, 4 + x_{1} - 2 - x_{1} - 4x_{3} + x_{4} - 3x_{3} \\
&=&&\, 2 - 7x_{3} + x_{4} \\
x_{7} &=&& 2 - x_{1} + \frac{2}{3} + \frac{1}{3}x_{1} + \frac{4}{3}x_{3} - \frac{1}{3}x_{4} - 3x_{3} \\
&=&& \frac{8}{3} - \frac{2}{3}x_{1} - \frac{5}{3}x_{3} - \frac{1}{3}x_{4} \\
z \,&=&&\, - 5x_{1} + 11\left(\frac{2}{3} + \frac{1}{3}x_{1} + \frac{4}{3}x_{3} - \frac{1}{3}x_{4}\right) - 5x_{3} \\
&=&&\, -5x_{1} + \frac{22}{3} + \frac{11}{3}x_{1} + \frac{44}{3}x_{3} - \frac{11}{3}x_{4} - 5x_{3} \\
&=&&\, \frac{22}{3} - \frac{4}{3}x_{1} + \frac{29}{3}x_{3} - \frac{11}{3}x_{4}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{5}
x_{2} \,&=&\, \frac{2}{3} \,&+&\, \frac{1}{3}x_{1} \,&+&\, \frac{4}{3}x_{3} \,&-&\, \frac{1}{3}x_{4} \\
x_{5} \,&=&\, \frac{8}{3} \,&-&\, \frac{8}{3}x_{1} \,&-&\, \frac{29}{3}x_{3} \,&+&\, \frac{5}{3}x_{4} \\
x_{6} \,&=&\, 2 && \,&-&\, 7x_{3} \,&+&\, x_{4} \\
x_{7} \,&=&\, \frac{8}{3} \,&-&\, \frac{2}{3}x_{1} \,&-&\, \frac{5}{3}x_{3} \,&-&\, \frac{1}{3}x_{4} \\ \cline{1 - 9}
z \,&=&\, \frac{22}{3} \,&-&\, \frac{4}{3}x_{1} \,&+&\, \frac{29}{3}x_{3} \,&-&\, \frac{11}{3}x_{4}
\end{alignat*}
\underline{2. Iteration}:
Eingangsvariable: $x_{3}$ \\
Ausgangsvariable: $x_{5}$
Es folgt
\begin{alignat*}{2}
\frac{29}{3}x_{3} &=&& \frac{8}{3} - \frac{8}{3}x_{1} + \frac{5}{3}x_{4} - x_{5} \\
x_{3} &=&& \frac{8}{29} - \frac{8}{29}x_{1} + \frac{5}{29}x_{4} - \frac{3}{29}x_{5} \\
x_{2} &=&& \frac{2}{3} + \frac{1}{3}x_{1} + \frac{4}{3}\left(\frac{8}{29} - \frac{8}{29}x_{1} + \frac{5}{29}x_{4} - \frac{3}{29}x_{5}\right) - \frac{1}{3}x_{4} \\
&=&& \frac{2}{3} + \frac{1}{3}x_{1} + \frac{32}{87} - \frac{32}{87}x_{1} + \frac{20}{87}x_{4} - \frac{4}{29}x_{5} - \frac{1}{3}x_{4} \\
&=&& \frac{30}{29} - \frac{1}{29}x_{1} - \frac{1}{29}x_{4} - \frac{4}{29}x_{5} \\
x_{6} &=&& 2 - 7\left(\frac{8}{29} - \frac{8}{29}x_{1} + \frac{5}{29}x_{4} - \frac{3}{29}x_{5}\right) + x_{4} \\
&=&& 2 - \frac{56}{29} + \frac{56}{29}x_{1} - \frac{35}{29}x_{4} + \frac{21}{29}x_{5} + x_{4} \\
&=&& \frac{2}{29} + \frac{56}{29}x_{1} - \frac{6}{29}x_{4} + \frac{21}{29}x_{5} \\
x_{7} &=&& \frac{8}{3} - \frac{2}{3}x_{1} - \frac{5}{3}\left(\frac{8}{29} - \frac{8}{29}x_{1} + \frac{5}{29}x_{4} - \frac{3}{29}x_{5}\right) - \frac{1}{3}x_{4} \\
&=&& \frac{8}{3} - \frac{2}{3}x_{1} - \frac{40}{87} + \frac{40}{87}x_{1} - \frac{25}{87}x_{4} + \frac{5}{29}x_{5} - \frac{1}{3}x_{4} \\
&=&& \frac{64}{29} - \frac{6}{29}x_{1} - \frac{18}{29}x_{4} + \frac{5}{29}x_{5} \\
z &=&& \frac{22}{3} - \frac{4}{3}x_{1} + \frac{29}{3}\left(\frac{8}{29} - \frac{8}{29}x_{1} + \frac{5}{29}x_{4} - \frac{3}{29}x_{5}\right) - \frac{11}{3}x_{4} \\
&=&& \frac{22}{3} - \frac{4}{3}x_{1} + \frac{8}{3} - \frac{8}{3}x_{1} + \frac{5}{3}x_{4} - x_{5} - \frac{11}{3}x_{4} \\
&=&& 10 + \frac{4}{3}x_{1} - 2x_{4} - x_{5}
\end{alignat*}
\underline{Ergebnis der 2. Iteration}:
\begin{alignat*}{5}
x_{3} \,&=&\, \frac{8}{29} \,&-&\, \frac{8}{29}x_{1} \,&+&\, \frac{5}{29}x_{4} \,&-&\, \frac{3}{29}x_{5} \\
x_{2} \,&=&\, \frac{30}{29} \,&-&\, \frac{1}{29}x_{1} \,&-&\, \frac{1}{29}x_{4} \,&-&\, \frac{4}{29}x_{5} \\
x_{6} \,&=&\, \frac{2}{29} \,&+&\, \frac{56}{29}x_{1} \,&-&\, \frac{6}{29}x_{4} \,&+&\, \frac{21}{29}x_{5} \\
x_{7} \,&=&\, \frac{64}{29} \,&-&\, \frac{6}{29}x_{1} \,&-&\, \frac{18}{29}x_{4} \,&+&\, \frac{5}{29}x_{5} \\ \cline{1 - 9}
z \,&=&\, 10 \,&+&\, \frac{4}{3}x_{1} \,&-&\, 2x_{4} \,&-&\, x_{5}
\end{alignat*}
\underline{3. Iteration}:
Eingangsvariable: $x_{1}$\\
Ausgangsvariable: $x_{3}$
Es folgt
\begin{alignat*}{2}
\frac{8}{29}x_{1} &=&& \frac{8}{29} + \frac{5}{29}x_{4} - \frac{3}{29}x_{5} - x_{3} \\
x_{1} &=&& 1 + \frac{5}{8}x_{4} - \frac{3}{8}x_{5} - \frac{29}{8}x_{3} \\
x_{2} &=&& \frac{30}{29} - \frac{1}{29}\left(1 + \frac{5}{8}x_{4} - \frac{3}{8}x_{5} - \frac{29}{8}x_{3}\right) - \frac{1}{29}x_{4} - \frac{4}{29}x_{5} \\
&=&& \frac{30}{29} - \frac{1}{29} - \frac{5}{232}x_{4} + \frac{3}{232}x_{5} + \frac{1}{8}x_{3} - \frac{1}{29}x_{4} - \frac{4}{29}x_{5} \\
&=&& 1 - \frac{13}{232}x_{4} - \frac{1}{8}x_{5} + \frac{1}{8}x_{3} \\
x_{6} &=&& \frac{2}{29} + \frac{56}{29}\left(1 + \frac{5}{8}x_{4} - \frac{3}{8}x_{5} - \frac{29}{8}x_{3}\right) - \frac{6}{29}x_{4} + \frac{21}{29}x_{5} \\
&=&& \frac{2}{29} + \frac{56}{29} + \frac{35}{29}x_{4} - \frac{21}{29}x_{5} - 7x_{3} - \frac{6}{29}x_{4} + \frac{21}{29}x_{5} \\
&=&& 2 + x_{4} - 7x_{3} \\
x_{7} &=&& \frac{64}{29} - \frac{6}{29}\left(1 + \frac{5}{8}x_{4} - \frac{3}{8}x_{5} - \frac{29}{8}x_{3}\right) - \frac{18}{29}x_{4} + \frac{5}{29}x_{5} \\
&=&& \frac{64}{29} - \frac{6}{29} - \frac{15}{116}x_{4} + \frac{18}{232}x_{5} + \frac{3}{4}x_{3} - \frac{18}{29}x_{4} + \frac{5}{29}x_{5} \\
&=&& 2 - \frac{3}{4}x_{4} + \frac{1}{4}x_{5} + \frac{3}{4}x_{3} \\
z &=&& 10 + \frac{4}{3}\left(1 + \frac{5}{8}x_{4} - \frac{3}{8}x_{5} - \frac{29}{8}x_{3}\right) - 2x_{4} - x_{5} \\
&=&& 10 + \frac{4}{3} + \frac{5}{6}x_{4} - \frac{1}{2}x_{5} - \frac{29}{6}x_{3} - 2x_{4} - x_{5} \\
&=&& \frac{34}{3} - \frac{7}{6}x_{4} - \frac{3}{2}x_{5} - \frac{29}{6}x_{3}
\end{alignat*}
\underline{Ergebnis der 3. Iteration}:
\begin{alignat*}{5}
x_{1} \,&=&\, 1 \,&+&\, \frac{5}{8}x_{4} \,&-&\, \frac{3}{8}x_{5} \,&-&\, \frac{29}{8}x_{3} \\
x_{2} \,&=&\, 1 \,&-&\, \frac{13}{232}x_{4} \,&-&\, \frac{1}{8}x_{5} \,&+&\, \frac{1}{8}x_{3} \\
x_{6} \,&=&\, 2 \,&+&\, x_{4} && \,&-&\, 7x_{3} \\
x_{7} \,&=&\, 2 \,&-&\, \frac{3}{4}x_{4} \,&+&\, \frac{1}{4}x_{5} \,&+&\, \frac{3}{4}x_{3} \\ \cline{1 - 9}
z \,&=&\, \frac{34}{3} \,&-&\, \frac{7}{6}x_{4} \,&-&\, \frac{3}{2}x_{5} \,&-&\, \frac{29}{6}x_{3}
\end{alignat*}
Dieses Tableau liefert die optimale Lösung $x_{1} = 1, x_{2} = 1, x_{3} = 0$ mit $z = \frac{34}{3}$.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 0, x_{4} = 2, x_{5} = 6, x_{6} = 4, x_{7} = 2 \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 0, x_{2} = \frac{2}{3}, x_{3} = 0, x_{4} = 0, x_{5} = \frac{8}{3}, x_{6} = 2, x_{7} = \frac{8}{3} \text{ mit } z = \frac{22}{3} = 7\frac{1}{3}
\]
\underline{Zulässige Basislösung nach der 2. Iteration}:
\[
x_{1} = 0, x_{2} = \frac{30}{29}, x_{3} = \frac{8}{29}, x_{4} = 0, x_{5} = 0, x_{6} = 2, x_{7} = \frac{64}{29} \text{ mit } z = 10
\]
\underline{Zulässige Basislösung nach der 3. Iteration}:
\[
x_{1} = 1, x_{2} = 1, x_{3} = 0, x_{4} = 0, x_{5} = 0, x_{6} = 2, x_{7} = 2 \text{ mit } z = \frac{34}{3} = 11\frac{1}{3}
\]
%
% 2 startet hier
%
%
\section{} %2
\textbf{Aufgabe:} Lösen Sie das folgende LP-Problem mit dem Simplexverfahren:
\begin{alignat*}{5}
\text{maximiere}\; & x_{1} &-& 9x_{2} &-& 11x_{3} &+& 3x_{4} && \\
\multicolumn{10}{l}{\text{unter den Nebenbedingungen}} && \\
\;& x_{1} &+& x_{2} &+& 3x_{3} &+& x_{4} &\leq & 3 \\
\;-& x_{1} &-& 3x_{2} &-& 7x_{3} &+& x_{4} &\leq & 1 \\
\multicolumn{8}{r}{$x_{1}, x_{2}, x_{3}, x_{4}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{6}
x_{5} \,&=&\, 3 \,&-&\, x_{1} \,&-&\, x_{2} \,&-&\, 3x_{3} \,&-&\, x_{4} \\
x_{6} \,&=&\, 1 \,&+&\, x_{1} \,&+&\, 3x_{2} \,&+&\, 7x_{3} \,&-&\, x_{4} \\ \cline{1 - 11}
z \,&=&\, && x_{1} \,&-&\, 9x_{2} \,&-&\, 11x_{3} \,&+&\, 3x_{4}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{4}$\\
Ausgangsvariable: $x_{6}$
Es folgt
\begin{alignat*}{2}
x_{4} &=&& 1 + x_{1} + 3x_{2} + 7x_{3} - x_{6} \\
x_{5} &=&& 3 - x_{1} - x_{2} - 3x_{3} - \left(1 + x_{1} + 3x_{2} + 7x_{3} - x_{6}\right) \\
&=&& 3 - x_{1} - x_{2} - 3x_{3} - 1 - x_{1} - 3x_{2} - 7x_{3} + x_{6} \\
&=&& 2 - 2x_{1} - 4x_{2} - 10x_{3} + x_{6} \\
z &=&& x_{1} - 9x_{2} - 11x_{3} + 3\left(1 + x_{1} + 3x_{2} + 7x_{3} - x_{6}\right) \\
&=&& x_{1} - 9x_{2} - 11x_{3} + 3 + 3x_{1} + 9x_{2} + 21x_{3} - 3x_{6} \\
&=&& 3 + 4x_{1} + 10x_{3} - 3x_{6}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{6}
x_{4} \,&=&\, 1 \,&+&\, x_{1} \,&+&\, 3x_{2} \,&+&\, 7x_{3} \,&-&\, x_{6} \\
x_{5} \,&=&\, 2 \,&-&\, 2x_{1} \,&-&\, 4x_{2} \,&-&\, 10x_{3} \,&+&\, x_{6} \\ \cline{1 - 11}
z \,&=&\, 3 \,&+&\, 4x_{1} && \,&+&\, 10x_{3} \,&-&\, 3x_{6}
\end{alignat*}
\underline{2. Iteration}:
Eingangsvariable: $x_{3}$ \\
Ausgangsvariable: $x_{5}$
Es folgt
\begin{alignat*}{2}
10x_{3} &=&& 2 - 2x_{1} - 4x_{2} + x_{6} - x_{5} \\
x_{3} &=&& \frac{1}{5} - \frac{1}{5}x_{1} - \frac{2}{5}x_{2} + \frac{1}{10}x_{6} - \frac{1}{10}x_{5} \\
x_{4} &=&& 1 + x_{1} + 3x_{2} + 7\left(\frac{1}{5} - \frac{1}{5}x_{1} - \frac{2}{5}x_{2} + \frac{1}{10}x_{6} - \frac{1}{10}x_{5}\right) - x_{6} \\
&=&& 1 + x_{1} + 3x_{2} + \frac{7}{5} - \frac{7}{5}x_{1} - \frac{14}{5}x_{2} + \frac{7}{10}x_{6} - \frac{7}{10}x_{5} - x_{6} \\
&=&& \frac{12}{5} - \frac{2}{5}x_{1} + \frac{1}{5}x_{2} - \frac{3}{10}x_{6} - \frac{7}{10}x_{5} \\
z &=&& 3 + 4x_{1} + 10\left(\frac{1}{5} - \frac{1}{5}x_{1} - \frac{2}{5}x_{2} + \frac{1}{10}x_{6} - \frac{1}{10}x_{5}\right) - 3x_{6} \\
&=&& 3 + 4x_{1} + 2 - 2x_{1} - 4x_{2} + x_{6} - x_{5} - 3x_{6} \\
&=&& 5 + 2x_{1} - 4x_{2} - 2x_{6} - x_{5}
\end{alignat*}
\underline{Ergebnis der 2. Iteration}:
\begin{alignat*}{6}
x_{3} \,&=&\, \frac{1}{5} \,&-&\, \frac{1}{5}x_{1} \,&-&\, \frac{2}{5}x_{2} \,&+&\, \frac{1}{10}x_{6} \,&-&\, \frac{1}{10}x_{5} \\
x_{4} \,&=&\, \frac{12}{5} \,&-&\, \frac{2}{5}x_{1} \,&+&\, \frac{1}{5}x_{2} \,&-&\, \frac{3}{10}x_{6} \,&-&\, \frac{7}{10}x_{5} \\ \cline{1 - 11}
z \,&=&\, 5 \,&+&\, 2x_{1} \,&-&\, 4x_{2} \,&-&\, 2x_{6} \,&-&\, x_{5}
\end{alignat*}
\underline{3. Iteration}:
Eingangsvariable: $x_{1}$\\
Ausgangsvariable: $x_{3}$
Es folgt
\begin{alignat*}{2}
\frac{1}{5}x_{1} &=&& \frac{1}{5} - \frac{2}{5}x_{2} + \frac{1}{10}x_{6} - \frac{1}{10}x_{5} - x_{3} \\
x_{1} &=&& 1 - 2x_{2} + \frac{1}{2}x_{6} - \frac{1}{2}x_{5} - 5x_{3} \\
x_{4} &=&& \frac{12}{5} - \frac{2}{5}\left(1 - 2x_{2} + \frac{1}{2}x_{6} - \frac{1}{2}x_{5} - 5x_{3}\right) + \frac{1}{5}x_{2} - \frac{3}{10}x_{6} - \frac{7}{10}x_{5} \\
&=&& \frac{12}{5} - \frac{2}{5} + \frac{4}{5}x_{2} - \frac{1}{5}x_{6} + \frac{1}{5}x_{5} + 2x_{3} + \frac{1}{5}x_{2} - \frac{3}{10}x_{6} - \frac{7}{10}x_{5} \\
&=&& 2 + x_{2} - \frac{1}{2}x_{6} - \frac{1}{2}x_{5} + 2x_{3} \\
z &=&& 5 + 2\left(1 - 2x_{2} + \frac{1}{2}x_{6} - \frac{1}{2}x_{5} - 5x_{3}\right) - 4x_{2} - 2x_{6} - x_{5} \\
&=&& 5 + 2 - 4x_{2} + x_{6} - x_{5} - 10x_{3} - 4x_{2} - 2x_{6} - x_{5} \\
&=&& 7 - 8x_{2} - x_{6} - 2x_{5} - 10x_{3}
\end{alignat*}
\underline{Ergebnis der 3. Iteration}:
\begin{alignat*}{6}
x_{1} \,&=&\, 1 \,&-&\, 2x_{2} \,&+&\, \frac{1}{2}x_{6} \,&-&\, \frac{1}{2}x_{5} \,&-&\, 5x_{3} \\
x_{4} \,&=&\, 2 \,&+&\, x_{2} \,&-&\, \frac{1}{2}x_{6} \,&-&\, \frac{1}{2}x_{5} \,&+&\, 2x_{3} \\ \cline{1 - 11}
z \,&=&\, 7 \,&-&\, 8x_{2} \,&-&\, x_{6} \,&-&\, 2x_{5} \,&-&\, 10x_{3}
\end{alignat*}
Dieses Tableau liefert die optimale Lösung $x_{1} = 1, x_{2} = 0, x_{3} = 0$ mit $z = 7$.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 0, x_{4} = 2, x_{5} = 3, x_{6} = 1 \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 0, x_{2} = \frac{2}{3}, x_{3} = 0, x_{4} = 1, x_{5} = 2, x_{6} = 0 \text{ mit } z = 3
\]
\underline{Zulässige Basislösung nach der 2. Iteration}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = \frac{1}{5}, x_{4} = \frac{12}{5}, x_{5} = 0, x_{6} = 2 \text{ mit } z = 5
\]
\underline{Zulässige Basislösung nach der 3. Iteration}:
\[
x_{1} = 1, x_{2} = 0, x_{3} = 0, x_{4} = 2, x_{5} = 0, x_{6} = 0 \text{ mit } z = 7
\]
\end{document}

View File

@ -0,0 +1,386 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usetikzlibrary{matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
% ensures that paragraphs are separated by empty lines
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
% define how the sections are rendered
\def\thesection{\arabic{section})}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
% some matrix magic
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\begin{document}
\author{Jan Branitz (6326955), Jim Martens (6420323),\\
Stephan Niendorf (6242417)}
\title{Hausaufgaben zum 4. November}
\maketitle
\section{} %1
\subsection{} %a
\textbf{Aufgabe:} Lösen Sie das folgende LP-Problem mit dem Simplexverfahren:
\begin{alignat*}{3}
\text{maximiere}\; & x_{1} &+& 2x_{2} && \\
\multicolumn{6}{l}{\text{unter den Nebenbedingungen}} && \\
\;-& 4x_{1} &+& x_{2} &\leq & 1 \\
\;-& x_{1} &+& x_{2} &\leq & 2 \\
\;& \frac{1}{2}x_{1} &-& x_{2} &\leq & 1 \\
\multicolumn{4}{r}{$x_{1}, x_{2}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{4}
x_{3} \,&=&\, 1 \,&+&\, 4x_{1} \,&-&\, x_{2} \\
x_{4} \,&=&\, 2 \,&+&\, x_{1} \,&-&\, x_{2} \\
x_{5} \,&=&\, 1 \,&-&\, \frac{1}{2}x_{1} \,&+&\, x_{2} \\ \cline{1 - 9}
z &=& && x_{1} \,&+&\, 2x_{2}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{2}$\\
Ausgangsvariable: $x_{3}$
Es folgt
\begin{alignat*}{2}
x_{2} \,&=&&\, 1 + 4x_{1} - x_{3} \\
x_{4} \,&=&&\, 2 + x_{1} - \left(1 + 4x_{1} - x_{3}\right) \\
&=&&\, 2 + x_{1} - 1 - 4x_{1} + x_{3} \\
&=&&\, 1 - 3x_{1} + x_{3} \\
x_{5} \,&=&&\, 1 - \frac{1}{2}x_{1} + \left(1 + 4x_{1} - x_{3}\right) \\
&=&&\, 1 - \frac{1}{2}x_{1} + 1 + 4x_{1} - x_{3} \\
&=&&\, 2 + \frac{7}{2}x_{1} - x_{3} \\
z \,&=&&\, x_{1} + 2\left(1 + 4x_{1} - x_{3}\right) \\
&=&&\, x_{1} + 2 + 8x_{1} - 2x_{3} \\
&=&&\, 2 + 9x_{1} - 2x_{3}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{4}
x_{2} \,&=&\, 1 \,&+&\, 4x_{1} \,&-&\, x_{3} \\
x_{4} \,&=&\, 1 \,&-&\, 3x_{1} \,&+&\, x_{3} \\
x_{5} \,&=&\, 2 \,&+&\, \frac{7}{2}x_{1} \,&-&\, x_{3} \\ \cline{1 - 9}
z &=& 2 \,&+&\, 9x_{1} &-& 2x_{3}
\end{alignat*}
\underline{2. Iteration}:
Eingangsvariable: $x_{1}$ \\
Ausgangsvariable: $x_{4}$
Es folgt
\begin{alignat*}{2}
3x_{1} &=&& 1 + x_{3} - x_{4} \\
x_{1} &=&& \frac{1}{3} + \frac{1}{3}x_{3} - \frac{1}{3}x_{4} \\
x_{2} &=&& 1 + 4\left(\frac{1}{3} + \frac{1}{3}x_{3} - \frac{1}{3}x_{4}\right) - x_{3} \\
&=&& 1 + \frac{4}{3} + \frac{4}{3}x_{3} - \frac{4}{3}x_{4} \\
&=&& \frac{7}{3} + \frac{4}{3}x_{3} - \frac{4}{3}x_{4} \\
x_{5} &=&& 3 + \frac{7}{2}\left(\frac{1}{3} + \frac{1}{3}x_{3} - \frac{1}{3}x_{4}\right) - x_{3} \\
&=&& 3 + \frac{7}{6} + \frac{7}{6}x_{3} - \frac{7}{6}x_{4} - x_{3} \\
&=&& \frac{13}{6} + \frac{1}{6}x_{3} - \frac{7}{6}x_{4} \\
z &=&& 2 + 9\left(\frac{1}{3} + \frac{1}{3}x_{3} - \frac{1}{3}x_{4}\right) - 2x_{3} \\
&=&& 2 + 3 + 3x_{3} - 3x_{4} - 2x_{3} \\
&=&& 5 + x_{3} - 3x_{4}
\end{alignat*}
\underline{Ergebnis der 2. Iteration}:
\begin{alignat*}{4}
x_{1} \,&=&\, \frac{1}{3} \,&+&\, \frac{1}{3}x_{3} \,&-&\, \frac{1}{3}x_{4} \\
x_{2} \,&=&\, \frac{7}{3} \,&+&\, \frac{4}{3}x_{3} \,&-&\, \frac{4}{3}x_{4} \\
x_{5} \,&=&\, \frac{13}{6} \,&+&\, \frac{1}{6}x_{3} \,&-&\, \frac{7}{6}x_{4} \\ \cline{1 - 7}
z &=& 5 \,&+&\, x_{3} \,&-&\, 3x_{4}
\end{alignat*}
\underline{3. Iteration}:
Eingangsvariable: $x_{3}$ \\
Ausgangsvariable: keine vorhanden
Es gibt keine optimale Lösung, da es keine Basisvariable gibt, die $x_{3}$ beschränkt. Damit ist dieses Problem unbeschränkt.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 1, x_{4} = 2, x_{5} = 1 \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 0, x_{2} = 1, x_{3} = 0, x_{4} = 1, x_{5} = 2 \text{ mit } z = 2
\]
\underline{Zulässige Basislösung nach der 2. Iteration}:
\[
x_{1} = \frac{1}{3}, x_{2} = \frac{7}{3}, x_{3} = 0, x_{4} = 0, x_{5} = \frac{13}{6} \text{ mit } z = 5
\]
Ermittlung einer Halbgeraden des $\mathbb{R}^{2}$:
\begin{alignat*}{2}
x_{3} &=& t \\
x_{4} &=& 0 \\
x_{1} &=& \frac{1}{3} + \frac{1}{3}t \\
x_{2} &=& \frac{7}{3} + \frac{4}{3}t \\
x_{5} &=& \frac{13}{6} + \frac{1}{6}t \\
z &=& 5 + t \\
t &\geq & 0
\end{alignat*}
Daraus ergibt sich in Parameterform:
\begin{alignat*}{2}
(x_{1}, x_{2}) &=& \left(\frac{1}{3} + \frac{1}{3}t, \frac{7}{3} + \frac{4}{3}t\right) \\
&=& \left(\frac{1}{3}, \frac{7}{3}\right) + t\left(\frac{1}{3}, \frac{4}{3}\right)
\end{alignat*}
%\begin{alignat*}{2}
% (x_{3}, x_{2}) &=& \left(t, \frac{7}{3} + \frac{4}{3}t\right) \\
% &=& \left(0, \frac{7}{3}\right) + t\left(1, \frac{4}{3}\right)
%\end{alignat*}
Da in diesem Fall $x_{1}$ eine Basisvariable ist und somit nicht gleich $t$ ist, stellt $t$ eine beliebige positive Konstante dar. Daher verändert sich auch die Gerade je nach Wahl von $t$. Deswegen ist es nicht möglich genau eine Halbgerade zu finden, auf der die Zielfunktion beliebig große Werte annimmt.
\subsection{} %b
Durch Umstellen der Nebenbedingungen des Problems aus a nach $x_{2}$ ergibt sich:
\begin{alignat*}{3}
x_{2} &\leq & 4x_{1} &+& 1 \\
x_{2} &\leq & x_{1} &+& 2 \\
x_{2} &\geq & \frac{1}{2}x_{1} &-& 1
\end{alignat*}
Daraus lässt sich die Fläche aller gültigen Werte zeichnen.
\begin{tikzpicture}[>=stealth]
\begin{axis}[
ymin=0,ymax=7,
x=1cm,
y=1cm,
axis x line=middle,
axis y line=middle,
axis line style=->,
xlabel={$x_{1}$},
ylabel={$x_{2}$},
xmin=0,xmax=7
]
\addplot[no marks, black, -] expression[domain=0:6,samples=100]{4*x + 1} node[pos=0.65,anchor=north]{};
\addplot[no marks, black, -] expression[domain=0:6,samples=100]{1*x + 2} node[pos=0.65,anchor=north]{};
\addplot[no marks, black, -] expression[domain=0:6,samples=100]{0.5*x - 1} node[pos=0.65,anchor=north]{};
%\addplot[no marks, black, -] expression[domain=0:6,samples=100]{1.333333333333333*x + 2.33333333333333333} node[pos=0.65,anchor=north]{};
%\node at (axis cs: 2.5,4.5) {(2.25,3.75)};
%\node at (axis cs: 6,2) {z};
%\draw[>=stealth] (axis cs:1,0) -- (axis cs:1,-6) node [pos=0.65,anchor=north]{};
\end{axis}
\end{tikzpicture}\\
\section{} %2
\subsection{} %a
\textbf{Aufgabe:} Lösen Sie das folgende LP-Hilfsproblem mit dem Simplexverfahren:
\begin{alignat*}{5}
\text{maximiere}\; -& x_{0} && && && && \\
\multicolumn{10}{l}{\text{unter den Nebenbedingungen}} && \\
\; & &-& x_{1} &-& x_{2} &-& x_{0} &\leq & -4 \\
\; &&& x_{1} &+& 2x_{2} &-& x_{0} &\leq & 2 \\
\; &&-&x_{1} &+& x_{2} &-& x_{0} &\leq & -1 \\
\multicolumn{8}{r}{$x_{0}, x_{1}, x_{2}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{5}
x_{3} \,&=&\, -4 \,&+&\, x_{1} \,&+&\, x_{2} \,&+&\, x_{0} \\
x_{4} \,&=&\, 2 \,&-&\, x_{1} \,&-&\, 2x_{2} \,&+&\, x_{0} \\
x_{5} \,&=&\, -1 \,&+&\, x_{1} \,&-&\, x_{2} \,&+&\, x_{0} \\ \cline{1 - 9}
w &=& && && \,&-&\, x_{0}
\end{alignat*}
Umwandeln in ein zulässiges Tableau:
Eingangsvariable: $x_{0}$\\
Ausgangsvariable: $x_{3}$
Es folgt
\begin{alignat*}{2}
-x_{0} \,&=&&\, -4 + x_{1} + x_{2} - x_{3} \\
x_{0} \,&=&&\, 4 - x_{1} - x_{2} + x_{3} \\
x_{4} \,&=&&\, 2 - x_{1} - 2x_{2} + \left(4 - x_{1} - x_{2} + x_{3}\right) \\
&=&&\, 2 - x_{1} - 2x_{2} + 4 - x_{1} - x_{2} + x_{3} \\
&=&&\, 6 - 2x_{1} - 3x_{2} + x_{3} \\
x_{5} \,&=&&\, -1 + x_{1} - x_{2} + \left(4 - x_{1} - x_{2} + x_{3}\right) \\
&=&&\, -1 + x_{1} - x_{2} + 4 - x_{1} - x_{2} + x_{3} \\
&=&&\, 3 - 2x_{2} + x_{3} \\
w \,&=&&\, -\left(4 - x_{1} - x_{2} + x_{3}\right) \\
&=&&\, -4 + x_{1} + x_{2} - x_{3} \\
\end{alignat*}
\underline{Ergebnis des Umwandelns}:
\begin{alignat*}{5}
x_{0} \,&=&\, 4 \,&-&\, x_{1} \,&-&\, x_{2} \,&+&\, x_{3} \\
x_{4} \,&=&\, 6 \,&-&\, 2x_{1} \,&-&\, 3x_{2} \,&+&\, x_{3} \\
x_{5} \,&=&\, 3 \,&& &-&\, 2x_{2} \,&+&\, x_{3} \\ \cline{1 - 9}
w &=& -4 \,&+&\, x_{1} \,&+&\, x_{2} \,&-&\, x_{3}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{1}$ \\
Ausgangsvariable: $x_{0}$
Es folgt
\begin{alignat*}{2}
x_{1} \,&=&&\, 4 - x_{2} + x_{3} - x_{0} \\
x_{4} \,&=&&\, 6 - 2\left(4 - x_{2} + x_{3} - x_{0}\right) - 3x_{2} + x_{3} \\
&=&&\, 6 - 8 + 2x_{2} - 2x_{3} + 2x_{0} - 3x_{2} + x_{3}\\
&=&&\, -2 - x_{2} - x_{3} + 2x_{0} \\
x_{5} \,&=&&\, 3 - 2x_{2} + x_{3} \\
w \,&=&&\, -4 + \left(4 - x_{2} + x_{3} - x_{0}\right) + x_{2} - x_{3} \\
&=&&\, -4 + 4 - x_{2} + x_{3} - x_{0} + x_{2} - x_{3} \\
&=&&\, 0 - x_{0}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{5}
x_{1} \,&=&\, 4 \,&-&\, x_{2} \,&+&\, x_{3} \,&-&\, x_{0} \\
x_{4} \,&=&\, -2 \,&-&\, x_{2} \,&-&\, x_{3} \,&+&\, 2x_{0} \\
x_{5} \,&=&\, 3 \,&-&\, 2x_{2} \,&+&\, x_{3} \,&& \\ \cline{1 - 9}
w &=& && && &-&\, x_{0}
\end{alignat*}
Das Tableau ist optimal. Als optimale Lösung des Hilfsproblem erhält man:
\[
x_{0} = 0, x_{1} = 4, x_{2} = 0
\]
Als zulässige Lösung für das ursprüngliche Problem ergibt sich:
\[
x_{1} = 4, x_{2} = 0
\]
Die ursprüngliche Zielfunktion lautet $z = x_{1} + 3x_{2}$. Setzt man für $x_{1}$ die rechte Seite der Gleichung im obigen Tableau ein, erhält man:
\[
z = 4 - x_{2} + x_{3} + 3x_{2}
\]
Daraus ergibt sich dieses Starttableau:
\begin{alignat*}{4}
x_{1} \,&=&\, 4 \,&-&\, x_{2} \,&+&\, x_{3} \\
x_{4} \,&=&\, -2 \,&-&\, x_{2} \,&-&\, x_{3} \\
x_{5} \,&=&\, 3 \,&-&\, 2x_{2} \,&+&\, x_{3} \\ \cline{1 - 7}
z \,&=&\, 4 \,&+&\, 2x_{2} \,&+&\, x_{3}
\end{alignat*}
\subsection{} %b
\textbf{Aufgabe:} Lösen Sie das folgende LP-Hilfsproblem mit dem Simplexverfahren:
\begin{alignat*}{5}
\text{maximiere}\; -& x_{0} && && && && \\
\multicolumn{10}{l}{\text{unter den Nebenbedingungen}} && \\
\; & && x_{1} &-& x_{2} &-& x_{0} &\leq & 8 \\
\; & &-& x_{1} &-& x_{2} &-& x_{0} &\leq & -3 \\
\; & &-& x_{1} &+& 4x_{2} &-& x_{0} &\leq & 2 \\
\multicolumn{8}{r}{$x_{0}, x_{1}, x_{2}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{5}
x_{3} \,&=&\, 9 \,&-&\, x_{1} \,&+&\, x_{2} \,&+&\, x_{0} \\
x_{4} \,&=&\, -3 \,&+&\, x_{1} \,&+&\, x_{2} \,&+&\, x_{0} \\
x_{5} \,&=&\, 2 \,&+&\, x_{1} \,&-&\, 4x_{2} \,&+&\, x_{0} \\ \cline{1 - 9}
w &=& && && \,&-&\, x_{0}
\end{alignat*}
Umwandeln in ein zulässiges Tableau:
Eingangsvariable: $x_{0}$\\
Ausgangsvariable: $x_{4}$
Es folgt
\begin{alignat*}{2}
-x_{0} \,&=&&\, -3 + x_{1} + x_{2} - x_{4} \\
x_{0} \,&=&&\, 3 - x_{1} - x_{2} + x_{4} \\
x_{3} \,&=&&\, 9 - x_{1} + x_{2} + \left(3 - x_{1} - x_{2} + x_{4}\right) \\
&=&&\, 9 - x_{1} + x_{2} + 3 - x_{1} - x_{2} + x_{4} \\
&=&&\, 12 - 2x_{1} + x_{4} \\
x_{5} \,&=&&\, 2 + x_{1} - 4x_{2} + \left(3 - x_{1} - x_{2} + x_{4}\right) \\
&=&&\, 2 + x_{1} - 4x_{2} + 3 - x_{1} - x_{2} + x_{4} \\
&=&&\, 5 - 5x_{2} + x_{4} \\
w \,&=&&\, -\left(3 - x_{1} - x_{2} + x_{4}\right) \\
&=&&\, -3 + x_{1} + x_{2} - x_{4} \\
\end{alignat*}
\underline{Ergebnis des Umwandelns}:
\begin{alignat*}{5}
x_{0} \,&=&\, 3 \,&-&\, x_{1} \,&-&\, x_{2} \,&+&\, x_{4} \\
x_{3} \,&=&\, 12 \,&-&\, 2x_{1} \,&& &+&\, x_{4} \\
x_{5} \,&=&\, 5 \,&& &-&\, 5x_{2} \,&+&\, x_{4} \\ \cline{1 - 9}
w &=& -3 \,&+&\, x_{1} \,&+&\, x_{2} \,&-&\, x_{4}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{1}$ \\
Ausgangsvariable: $x_{0}$
Es folgt
\begin{alignat*}{2}
x_{1} &=&& 3 - x_{2} + x_{4} - x_{0} \\
x_{3} &=&& 12 - 2\left(3 - x_{2} + x_{4} - x_{0}\right) + x_{4} \\
&=&& 12 - 6 + 2x_{2} - 2x_{4} + 2x_{0} + x_{4} \\
&=&& 6 + 2x_{2} - x_{4} + 2x_{0} \\
x_{5} &=&& 5 - 5x_{2} + x_{4} \\
w &=&& -3 + \left(3 - x_{2} + x_{4} - x_{0}\right) + x_{2} - x_{4} \\
&=&& -3 + 3 - x_{2} + x_{4} - x_{0} + x_{2} - x_{4} \\
&=&& - x_{0}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{5}
x_{1} \,&=&\, 3 \,&-&\, x_{2} \,&+&\, x_{4} \,&-&\, x_{0} \\
x_{3} \,&=&\, 6 \,&+&\, 2x_{2} \,&-&\, x_{4} \,&+&\, 2x_{0} \\
x_{5} \,&=&\, 5 \,&-&\, 5x_{2} \,&-&\, x_{4} \,&& \\ \cline{1 - 9}
w &=& && && &-& x_{0}
\end{alignat*}
Das Tableau ist optimal. Als optimale Lösung des Hilfsproblem erhält man:
\[
x_{0} =0, x_{1} = 3, x_{2} = 0
\]
Als zulässige Lösung für das ursprüngliche Problem ergibt sich:
\[
x_{1} = 3, x_{2} = 0
\]
Die ursprüngliche Zielfunktion lautet $z = x_{1} + 3x_{2}$. Setzt man für $x_{1}$ die rechte Seite der Gleichung im obigen Tableau ein, erhält man:
\[
z = 3 - x_{2} + x_{4} + 3x_{2} = 3 + 2x_{2} + x_{4}
\]
Daraus ergibt sich dieses Starttableau:
\begin{alignat*}{4}
x_{1} \,&=&\, 3 \,&-&\, x_{2} \,&+&\, x_{4} \\
x_{3} \,&=&\, 6 \,&+&\, 2x_{2} \,&-&\, x_{4} \\
x_{5} \,&=&\, 5 \,&-&\, 5x_{2} \,&-&\, x_{4} \\ \cline{1 - 7}
z \,&=&\, 3 \,&+&\, 2x_{2} \,&+&\, x_{4}
\end{alignat*}
\end{document}

View File

@ -0,0 +1,571 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usetikzlibrary{matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
% ensures that paragraphs are separated by empty lines
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
% define how the sections are rendered
\def\thesection{\arabic{section})}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
% some matrix magic
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\begin{document}
\author{Jan Branitz (6326955), Jim Martens (6420323),\\
Stephan Niendorf (6242417)}
\title{Hausaufgaben zum 11. November}
\maketitle
\section{} %1
\subsection{} %a
\subsubsection{} %i
Regel vom größten Koeffizienten:
\textbf{Aufgabe:} Lösen Sie das folgende LP-Problem mit dem Simplexverfahren:
\begin{alignat*}{3}
\text{maximiere}\; & 2x_{1} \,&+&\, x_{2} && \\
\multicolumn{6}{l}{\text{unter den Nebenbedingungen}} && \\
\;& x_{1} \,&+&\, x_{2} \,&\leq & 9 \\
\;& x_{1} \,&& &\leq & 2 \\
\;& &&\, x_{2} \,&\leq & 8 \\
\multicolumn{4}{r}{$x_{1}, x_{2}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{4}
x_{3} \,&=&\, 9 \,&-&\, x_{1} \,&-&\, x_{2} \\
x_{4} \,&=&\, 2 \,&-&\, x_{1} && \\
x_{5} \,&=&\, 8 \,&& &-&\, x_{2} \\ \cline{1 - 7}
z &=& &&\, 2x_{1} \,&+&\, x_{2}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{1}$\\
Ausgangsvariable: $x_{4}$
Es folgt
\begin{alignat*}{2}
x_{1} \,&=&&\, 2 - x_{4} \\
x_{3} \,&=&&\, 9 - \left(2 - x_{4}\right) - x_{2} \\
&=&&\, 9 - 2 + x_{4} - x_{2} \\
&=&&\, 7 - x_{2} + x_{4} \\
x_{5} \,&=&&\, 8 - x_{2} \\
z \,&=&&\, 2\left(2 - x_{4}\right) + x_{2} \\
&=&&\, 4 - 2x_{4} + x_{2} \\
&=&&\, 4 + x_{2} - 2x_{4}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{4}
x_{1} \,&=&\, 2 \,&& &-&\, x_{4} \\
x_{3} \,&=&\, 7 \,&-&\, x_{2} \,&+&\, x_{4} \\
x_{5} \,&=&\, 8 \,&-&\, x_{2} \,&& \\ \cline{1 - 7}
z &=& 4 \,&+&\, x_{2} \,&-&\, 2x_{4}
\end{alignat*}
\underline{2. Iteration}:
Eingangsvariable: $x_{2}$ \\
Ausgangsvariable: $x_{3}$
Es folgt
\begin{alignat*}{2}
x_{2} \,&=&&\, 7 + x_{4} - x_{3} \\
x_{1} \,&=&&\, 2 - x_{4}\\
x_{5} \,&=&&\, 8 - \left(7 + x_{4} - x_{3}\right) \\
&=&&\, 8 - 7 - x_{4} + x_{3} \\
&=&&\, 1 - x_{4} + x_{3} \\
z \,&=&&\, 4 + \left(7 + x_{4} - x_{3}\right) - 2x_{4} \\
&=&&\, 4 + 7 + x_{4} - x_{3} - 2x_{4} \\
&=&&\, 11 - x_{4} - x_{3}
\end{alignat*}
\underline{Ergebnis der 2. Iteration}:
\begin{alignat*}{4}
x_{2} \,&=&\, 7 \,&+&\, x_{4} \,&-&\, x_{3} \\
x_{1} \,&=&\, 2 \,&-&\, x_{4} \,&& \\
x_{5} \,&=&\, 1 \,&-&\, x_{4} \,&+&\, x_{3} \\ \cline{1 - 7}
z &=& 11 \,&-&\, x_{4} \,&-&\, x_{3}
\end{alignat*}
Dieses Tableau liefert die optimale Lösung $x_{1} = 2, x_{2} = 7$ mit $z = 11$.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 9, x_{4} = 2, x_{5} = 8 \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 2, x_{2} = 0, x_{3} = 7, x_{4} = 0, x_{5} = 8 \text{ mit } z = 4
\]
\underline{Zulässige Basislösung nach der 2. Iteration}:
\[
x_{1} = 2, x_{2} = 7, x_{3} = 0, x_{4} = 0, x_{5} = 1 \text{ mit } z = 11
\]
Regel vom größten Zuwachs:
\textbf{Aufgabe:} Lösen Sie das folgende LP-Problem mit dem Simplexverfahren:
\begin{alignat*}{3}
\text{maximiere}\; & 2x_{1} \,&+&\, x_{2} && \\
\multicolumn{6}{l}{\text{unter den Nebenbedingungen}} && \\
\;& x_{1} \,&+&\, x_{2} \,&\leq & 9 \\
\;& x_{1} \,&& &\leq & 2 \\
\;& &&\, x_{2} \,&\leq & 8 \\
\multicolumn{4}{r}{$x_{1}, x_{2}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{4}
x_{3} \,&=&\, 9 \,&-&\, x_{1} \,&-&\, x_{2} \\
x_{4} \,&=&\, 2 \,&-&\, x_{1} && \\
x_{5} \,&=&\, 8 \,&& &-&\, x_{2} \\ \cline{1 - 7}
z &=& &&\, 2x_{1} \,&+&\, x_{2}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{2}$\\
Ausgangsvariable: $x_{5}$
Es folgt
\begin{alignat*}{2}
x_{2} \,&=&&\, 8 - x_{5} \\
x_{3} \,&=&&\, 9 - x_{1} - \left(8 - x_{5}\right) \\
&=&&\, 9 - x_{1} - 8 + x_{5} \\
&=&&\, 1 - x_{1} + x_{5} \\
x_{4} \,&=&&\, 2 - x_{1} \\
z \,&=&&\, 2x_{1} + \left(8 - x_{5}\right) \\
&=&&\, 2x_{1} + 8 - x_{5} \\
&=&&\, 8 + 2x_{1} - x_{5}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{4}
x_{2} \,&=&\, 8 \,&& &-&\, x_{5} \\
x_{3} \,&=&\, 1 \,&-&\, x_{1} \,&+&\, x_{5} \\
x_{4} \,&=&\, 2 \,&-&\, x_{1} \,&& \\ \cline{1 - 7}
z &=& 8 \,&+&\, 2x_{1} \,&-&\, x_{5}
\end{alignat*}
\underline{2. Iteration}:
Eingangsvariable: $x_{1}$ \\
Ausgangsvariable: $x_{3}$
Es folgt
\begin{alignat*}{2}
x_{1} \,&=&&\, 1 + x_{5} - x_{3} \\
x_{2} \,&=&&\, 8 - x_{5}\\
x_{4} \,&=&&\, 2 - \left(1 + x_{5} - x_{3}\right) \\
&=&&\, 2 - 1 - x_{5} + x_{3} \\
&=&&\, 1 - x_{5} + x_{3} \\
z \,&=&&\, 8 + 2\left(1 + x_{5} - x_{3}\right) - x_{5} \\
&=&&\, 8 + 2 + 2x_{5} - 2x_{3} - x_{5} \\
&=&&\, 10 + x_{5} - 2x_{3}
\end{alignat*}
\underline{Ergebnis der 2. Iteration}:
\begin{alignat*}{4}
x_{1} \,&=&\, 1 \,&+&\, x_{5} \,&-&\, x_{3} \\
x_{2} \,&=&\, 8 \,&-&\, x_{5} \,&& \\
x_{4} \,&=&\, 1 \,&-&\, x_{5} \,&+&\, x_{3} \\ \cline{1 - 7}
z &=& 10 \,&+&\, x_{5} \,&-&\, 2x_{3}
\end{alignat*}
\underline{3. Iteration}:
Eingangsvariable: $x_{5}$ \\
Ausgangsvariable: $x_{4}$
Es folgt
\begin{alignat*}{2}
x_{5} \,&=&&\, 1 + x_{3} - x_{4} \\
x_{1} \,&=&&\, 1 + \left(1 + x_{3} - x_{4}\right) - x_{3} \\
&=&&\, 1 + 1 + x_{3} - x_{4} - x_{3} \\
&=&&\, 2 - x_{4} \\
x_{2} \,&=&&\, 8 - \left(1 + x_{3} - x_{4}\right) \\
&=&&\, 8 - 1 - x_{3} + x_{4} \\
&=&&\, 7 - x_{3} + x_{4} \\
z \,&=&&\, 10 + \left(1 + x_{3} - x_{4}\right) - 2x_{3} \\
&=&&\, 10 + 1 + x_{3} - x_{4} - 2x_{3} \\
&=&&\, 11 - x_{3} - x_{4}
\end{alignat*}
\underline{Ergebnis der 3. Iteration}:
\begin{alignat*}{4}
x_{5} \,&=&\, 1 \,&+&\, x_{3} \,&-&\, x_{4} \\
x_{1} \,&=&\, 2 \,&& &-&\, x_{4} \\
x_{2} \,&=&\, 7 \,&-&\, x_{3} \,&+&\, x_{4} \\ \cline{1 - 7}
z &=& 11 \,&-&\, x_{3} \,&-&\, x_{4}
\end{alignat*}
Dieses Tableau liefert die optimale Lösung $x_{1} = 2, x_{2} = 7$ mit $z = 11$.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 9, x_{4} = 2, x_{5} = 8 \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 0, x_{2} = 8, x_{3} = 1, x_{4} = 2, x_{5} = 0 \text{ mit } z = 8
\]
\underline{Zulässige Basislösung nach der 2. Iteration}:
\[
x_{1} = 1, x_{2} = 8, x_{3} = 0, x_{4} = 1, x_{5} = 0 \text{ mit } z = 10
\]
\underline{Zulässige Basislösung nach der 3. Iteration}:
\[
x_{1} = 2, x_{2} = 7, x_{3} = 0, x_{4} = 0, x_{5} = 1 \text{ mit } z = 11
\]
Die Regel vom größten Koeffizienten schneidet besser ab und ist eine Iteration früher fertig.
\subsubsection{} %ii
\begin{tikzpicture}[>=stealth]
\begin{axis}[
ymin=0,ymax=10,
x=1cm,
y=1cm,
axis x line=middle,
axis y line=middle,
axis line style=->,
xlabel={$x_{1}$},
ylabel={$x_{2}$},
xmin=0,xmax=4
]
\addplot[no marks, black, -] expression[domain=0:3,samples=100]{-1*x + 9} node[pos=0.65,anchor=north]{};
\addplot[no marks, black, -] expression[domain=0:3,samples=100]{8} node[pos=0.65,anchor=north]{};
\node at (axis cs: 0.25,8.25) {P};
\node at (axis cs: 1,8.25) {Q};
\node at (axis cs: 2.25,7.25) {R};
\node at (axis cs: 2.25,0.25) {S};
\node at (axis cs: 0.25,0.25) {T};
\draw[>=stealth] (axis cs:2,0) -- (axis cs:2,10) node [pos=0.65,anchor=north]{};
\end{axis}
\end{tikzpicture}
Bei der Regel des größten Koeffizienten wurden die Eckpunkte in der Reihenfolge T, S und R durchlaufen. Bei der Regel des größten Zuwachses wurden die Eckpunkte in der Reihenfolge T, P, Q und R durchlaufen.
\subsection{} %b
\subsubsection{} %i
Regel vom größten Koeffizienten:
\textbf{Aufgabe:} Lösen Sie das folgende LP-Problem mit dem Simplexverfahren:
\begin{alignat*}{3}
\text{maximiere}\; & x_{1} \,&+&\, 2x_{2} && \\
\multicolumn{6}{l}{\text{unter den Nebenbedingungen}} && \\
\;& x_{1} \,&+&\, 4x_{2} \,&\leq & 4 \\
\multicolumn{4}{r}{$x_{1}, x_{2}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{4}
x_{3} \,&=&\, 4 \,&-&\, x_{1} \,&-&\, 4x_{2} \\ \cline{1 - 7}
z &=& &&\, x_{1} \,&+&\, 2x_{2}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{2}$\\
Ausgangsvariable: $x_{3}$
Es folgt
\begin{alignat*}{2}
4x_{2} \,&=&&\, 4 - x_{1} - x_{3} \\
x_{2} \,&=&&\, 1 - \frac{1}{4}x_{1} - \frac{1}{4}x_{3} \\
z \,&=&&\, x_{1} + 2\left(1 - \frac{1}{4}x_{1} - \frac{1}{4}x_{3}\right) \\
&=&&\, x_{1} + 2 - \frac{1}{2}x_{1} - \frac{1}{2}x_{3} \\
&=&&\, 2 + \frac{1}{2}x_{1} - \frac{1}{2}x_{3}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{4}
x_{2} \,&=&\, 1 \,&-&\, \frac{1}{4}x_{1} &-&\, \frac{1}{4}x_{3} \\ \cline{1 - 7}
z &=& 2 \,&+&\, \frac{1}{2}x_{1} \,&-&\, \frac{1}{2}x_{3}
\end{alignat*}
\underline{2. Iteration}:
Eingangsvariable: $x_{1}$\\
Ausgangsvariable: $x_{2}$
Es folgt
\begin{alignat*}{2}
\frac{1}{4}x_{1} \,&=&&\, 1 - \frac{1}{4}x_{3} - x_{2} \\
x_{1} \,&=&&\, 4 - x_{3} - 4x_{2} \\
z \,&=&&\, 2 + \frac{1}{2}\left(4 - x_{3} - 4x_{2}\right) - \frac{1}{2}x_{3} \\
&=&&\, 2 + 2 - \frac{1}{2}x_{3} - 2x_{2} - \frac{1}{2}x_{3} \\
&=&&\, 4 - x_{3} - 2x_{2}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{4}
x_{1} \,&=&\, 4 \,&-&\, x_{3} &-&\, 4x_{2} \\ \cline{1 - 7}
z &=& 4 \,&-&\, x_{3} \,&-&\, 2x_{2}
\end{alignat*}
Dieses Tableau liefert die optimale Lösung $x_{1} = 4, x_{2} = 0$ mit $z = 4$.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 4 \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 0, x_{2} = 1, x_{3} = 0 \text{ mit } z = 2
\]
\underline{Zulässige Basislösung nach der 2. Iteration}:
\[
x_{1} = 4, x_{2} = 0, x_{3} = 0 \text{ mit } z = 4
\]
Regel vom größten Zuwachs:
\textbf{Aufgabe:} Lösen Sie das folgende LP-Problem mit dem Simplexverfahren:
\begin{alignat*}{3}
\text{maximiere}\; & x_{1} \,&+&\, 2x_{2} && \\
\multicolumn{6}{l}{\text{unter den Nebenbedingungen}} && \\
\;& x_{1} \,&+&\, 4x_{2} \,&\leq & 4 \\
\multicolumn{4}{r}{$x_{1}, x_{2}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{4}
x_{3} \,&=&\, 4 \,&-&\, x_{1} \,&-&\, 4x_{2} \\ \cline{1 - 7}
z &=& &&\, x_{1} \,&+&\, 2x_{2}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{1}$\\
Ausgangsvariable: $x_{3}$
Es folgt
\begin{alignat*}{2}
x_{1} \,&=&&\, 4 - 4x_{2} - x_{3} \\
z \,&=&&\, \left(4 - 4x_{2} - x_{3}\right) + 2x_{2} \\
&=&&\, 4 - 4x_{2} - x_{3} + 2x_{2} \\
&=&&\, 4 - 2x_{2} - x_{3}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{4}
x_{1} \,&=&\, 4 \,&-&\, 4x_{2} \,&-&\, x_{3} \\ \cline{1 - 7}
z &=& 4 \,&-&\, 2x_{2} \,&-&\, x_{3}
\end{alignat*}
Dieses Tableau liefert die optimale Lösung $x_{1} = 4, x_{2} = 0$ mit $z = 4$.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 4 \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 4, x_{2} = 0, x_{3} = 0 \text{ mit } z = 4
\]
Die Regel vom größten Zuwachs ist nach einer Iteration fertig, wobei die Regel vom größten Koeffizienten erst nach der zweiten Iteration fertig ist. Damit ist die Regel vom größten Zuwachs besser.
\subsubsection{} %ii
\begin{tikzpicture}[>=stealth]
\begin{axis}[
ymin=0,ymax=2,
x=1cm,
y=1cm,
axis x line=middle,
axis y line=middle,
axis line style=->,
xlabel={$x_{1}$},
ylabel={$x_{2}$},
xmin=0,xmax=5
]
\addplot[no marks, black, -] expression[domain=0:4,samples=100]{-0.25*x + 1} node[pos=0.65,anchor=north]{};
%\addplot[no marks, black, -] expression[domain=0:3,samples=100]{8} node[pos=0.65,anchor=north]{};
\node at (axis cs: 0.25,1.25) {P};
\node at (axis cs: 4.25,0.25) {Q};
\node at (axis cs: 0.25,0.25) {R};
\end{axis}
\end{tikzpicture}
Bei der Regel mit dem größten Koeffizienten wurden die Eckpunkte in der Reihenfolge R, P und Q durchlaufen. Bei der Regel mit dem größten Zuwachs wurden die Eckpunkte in der Reihenfolge R und Q durchlaufen.
\section{} %2
\textbf{Aufgabe:} Lösen Sie das folgende LP-Problem mit dem Simplexverfahren:
\begin{alignat*}{4}
\text{maximiere}\; & 8x_{1} \,&-&\, x_{2} \,&+&\, 2x_{3} && \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
\;& x_{1} \,&& && &\leq & 2 \\
\;& 2x_{1} \,&+&\, 3x_{2} \,&-&\, x_{3} \,&\leq & 4 \\
\;& 3x_{1} \,&-&\, 4x_{2} \,&+&\, 2x_{3} \,&\leq & 6 \\
\multicolumn{6}{r}{$x_{1}, x_{2}, x_{3}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{5}
x_{4} \,&=&\, 2 \,&-&\, x_{1} && && \\
x_{5} \,&=&\, 4 \,&-&\, 2x_{1} \,&-&\, 3x_{2} \,&+&\, x_{3} \\
x_{6} \,&=&\, 6 \,&-&\, 3x_{1} \,&+&\, 4x_{2} \,&-&\, 2x_{3} \\ \cline{1 - 9}
z &=& &&\, 8x_{1} \,&-&\, x_{2} \,&+&\, 2x_{3}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{1}$\\
Ausgangsvariable: $x_{4}$
Es folgt
\begin{alignat*}{2}
x_{1} \,&=&&\, 2 - x_{4} \\
x_{5} \,&=&&\, 4 - 2\left(2 - x_{4}\right) - 3x_{2} + x_{3} \\
&=&&\, 4 - 4 + 2x_{4} - 3x_{2} + x_{3} \\
&=&&\, - 3x_{2} + x_{3} + 2x_{4} \\
x_{6} \,&=&&\, 6 - 3\left(2 - x_{4}\right) + 4x_{2} - 2x_{3} \\
&=&&\, 6 - 6 + 3x_{4} + 4x_{2} - 2x_{3} \\
&=&&\, 4x_{2} - 2x_{3} + 3x_{4} \\
z \,&=&&\, 8\left(2 - x_{4}\right) - x_{2} + 2x_{3} \\
&=&&\, 16 - 8x_{4} - x_{2} + 2x_{3} \\
&=&&\, 16 - x_{2} + 2x_{3} - 8x_{4}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{5}
x_{1} \,&=&\, 2 \,&& && &-&\, x_{4} \\
x_{5} \,&=&\, 0 \,&-&\, 3x_{2} \,&+&\, x_{3} \,&+&\, 2x_{4} \\
x_{6} \,&=&\, 0 \,&+&\, 4x_{2} \,&-&\, 2x_{3} \,&+&\, 3x_{4} \\ \cline{1 - 9}
z &=& 16 \,&-&\, x_{2} \,&+&\, 2x_{3} \,&-&\, 8x_{4}
\end{alignat*}
\underline{2. Iteration}:
Eingangsvariable: $x_{3}$ \\
Ausgangsvariable: $x_{6}$
Es folgt
\begin{alignat*}{2}
2x_{3} \,&=&&\, 4x_{2} + 3x_{4} - x_{6} \\
x_{3} \,&=&&\, 2x_{2} + \frac{3}{2}x_{4} - \frac{1}{2}x_{6} \\
x_{1} \,&=&&\, 2 - x_{4}\\
x_{5} \,&=&&\, - 3x_{2} + \left(2x_{2} + \frac{3}{2}x_{4} - \frac{1}{2}x_{6}\right) + 2x_{4} \\
&=&&\, - 3x_{2} + 2x_{2} + \frac{3}{2}x_{4} - \frac{1}{2}x_{6} + 2x_{4} \\
&=&&\, - x_{2} + \frac{7}{2}x_{4} - \frac{1}{2}x_{6} \\
z \,&=&&\, 16 - x_{2} + 2\left(2x_{2} + \frac{3}{2}x_{4} - \frac{1}{2}x_{6}\right) - 8x_{4} \\
&=&&\, 16 - x_{2} + 4x_{2} + 3x_{4} - x_{6} - 8x_{4} \\
&=&&\, 16 + 3x_{2} - 5x_{4} - x_{6}
\end{alignat*}
\underline{Ergebnis der 2. Iteration}:
\begin{alignat*}{5}
x_{3} \,&=&\, 0 \,&+&\, 2x_{2} \,&+&\, \frac{3}{2}x_{4} \,&-&\, \frac{1}{2}x_{6} \\
x_{1} \,&=&\, 2 \,&& &-&\, x_{4} && \\
x_{5} \,&=&\, 0 \,&-&\, x_{2} \,&+&\, \frac{7}{2}x_{4} \,&-&\, \frac{1}{2}x_{6} \\ \cline{1 - 9}
z &=& 16 \,&+&\, 3x_{2} \,&-&\, 5x_{4} \,&-&\, x_{6}
\end{alignat*}
\underline{3. Iteration}:
Eingangsvariable: $x_{2}$ \\
Ausgangsvariable: $x_{5}$
Es folgt
\begin{alignat*}{2}
x_{2} \,&=&&\, \frac{7}{2}x_{4} - \frac{1}{2}x_{6} - x_{5} \\
x_{3} \,&=&&\, 2\left(\frac{7}{2}x_{4} - \frac{1}{2}x_{6} - x_{5}\right) + \frac{3}{2}x_{4} - \frac{1}{2}x_{6} \\
&=&&\, 7x_{4} - x_{6} - 2x_{5} + \frac{3}{2}x_{4} - \frac{1}{2}x_{6} \\
&=&&\, \frac{17}{2}x_{4} - \frac{3}{2}x_{6} - 2x_{5} \\
x_{1} \,&=&&\, 2 - x_{4} \\
z \,&=&&\, 16 + 3\left(\frac{7}{2}x_{4} - \frac{1}{2}x_{6} - x_{5}\right) - 5x_{4} - x_{6} \\
&=&&\, 16 + \frac{21}{2}x_{4} - \frac{3}{2}x_{6} - 3x_{5} - 5x_{4} - x_{6} \\
&=&&\, 16 + \frac{11}{2}x_{4} - \frac{5}{2}x_{6} - 3x_{5}
\end{alignat*}
\underline{Ergebnis der 3. Iteration}:
\begin{alignat*}{5}
x_{2} \,&=&\, 0 \,&+&\, \frac{7}{2}x_{4} \,&-&\, \frac{1}{2}x_{6} \,&-&\, x_{5} \\
x_{3} \,&=&\, 0 \,&+&\, \frac{17}{2}x_{4} \,&-&\, \frac{3}{2}x_{6} \,&-&\, 2x_{5} \\
x_{1} \,&=&\, 2 \,&-&\, x_{4} && && \\ \cline{1 - 9}
z &=& 16 \,&+&\, \frac{11}{2}x_{4} \,&-&\, \frac{5}{2}x_{6} \,&-&\, 3x_{5}
\end{alignat*}
\underline{4. Iteration}:
Eingangsvariable: $x_{4}$ \\
Ausgangsvariable: $x_{1}$
Es folgt
\begin{alignat*}{2}
x_{4} \,&=&&\, 2 - x_{1} \\
x_{2} \,&=&&\, \frac{7}{2}\left(2 - x_{1}\right) - \frac{1}{2}x_{6} - x_{5} \\
&=&&\, 7 - \frac{7}{2}x_{1} - \frac{1}{2}x_{6} - x_{5} \\
&=&&\, 7 - \frac{1}{2}x_{6} - x_{5} - \frac{7}{2}x_{1} \\
x_{3} \,&=&&\, \frac{17}{2}\left(2 - x_{1}\right) - \frac{3}{2}x_{6} - 2x_{5} \\
&=&&\, 17 - \frac{17}{2}x_{1} - \frac{3}{2}x_{6} - 2x_{5} \\
&=&&\, 17 - \frac{3}{2}x_{6} - 2x_{5} - \frac{17}{2}x_{1} \\
z \,&=&&\, 16 + \frac{11}{2}\left(2 - x_{1}\right) - \frac{5}{2}x_{6} - 3x_{5} \\
&=&&\, 16 + 11 - \frac{11}{2}x_{1} - \frac{5}{2}x_{6} - 3x_{5} \\
&=&&\, 27 - \frac{5}{2}x_{6} - 3x_{5} - \frac{11}{2}x_{1}
\end{alignat*}
\underline{Ergebnis der 4. Iteration}:
\begin{alignat*}{5}
x_{4} \,&=&\, 2 \,&& && &-&\, x_{1} \\
x_{2} \,&=&\, 7 \,&-&\, \frac{1}{2}x_{6} \,&-&\, x_{5} \,&-&\, \frac{7}{2}x_{1} \\
x_{3} \,&=&\, 17 \,&-&\, \frac{3}{2}x_{6} \,&-&\, 2x_{5} \,&-&\, \frac{17}{2}x_{1} \\ \cline{1 - 9}
z &=& 27 \,&-&\, \frac{5}{2}x_{6} \,&-&\, 3x_{5} \,&-&\, \frac{11}{2}x_{1}
\end{alignat*}
Dieses Tableau liefert die optimale Lösung $x_{1} = 0, x_{2} = 7, x_{3} = 17$ mit $z = 27$.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 0, x_{4} = 2, x_{5} = 4, x_{6} = 6 \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 2, x_{2} = 0, x_{3} = 0, x_{4} = 0, x_{5} = 0, x_{6} = 0 \text{ mit } z = 16
\]
\underline{Zulässige Basislösung nach der 2. Iteration}:
\[
x_{1} = 2, x_{2} = 0, x_{3} = 0, x_{4} = 0, x_{5} = 0, x_{6} = 0 \text{ mit } z = 16
\]
\underline{Zulässige Basislösung nach der 3. Iteration}:
\[
x_{1} = 2, x_{2} = 0, x_{3} = 0, x_{4} = 0, x_{5} = 0, x_{6} = 0 \text{ mit } z = 16
\]
\underline{Zulässige Basislösung nach der 4. Iteration}:
\[
x_{1} = 0, x_{2} = 7, x_{3} = 17, x_{4} = 2, x_{5} = 0, x_{6} = 0 \text{ mit } z = 27
\]
Die erste Iteration ist kein degenerierter Schritt. Aber die zweite und dritte Iteration sind degenerierte Schritte, da sich die zulässige Basislösung nicht geändert hat. Die vierte Iteration ist kein degenerierter Schritt.
\end{document}

View File

@ -0,0 +1,230 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usetikzlibrary{matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
% ensures that paragraphs are separated by empty lines
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
% define how the sections are rendered
\def\thesection{\arabic{section})}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
% some matrix magic
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\begin{document}
\author{Jan Branitz (6326955), Jim Martens (6420323),\\
Stephan Niendorf (6242417)}
\title{Hausaufgaben zum 18. November}
\maketitle
\section{} %1
\subsection{} %a
\begin{alignat*}{15}
\text{maximiere}\; & 2v_{01} \,&+&\, 3v_{02} \,&+&\, v_{03} \,&+&\, 7v_{04} && && && && && && && && && && && \\
\multicolumn{30}{l}{\text{unter den Nebenbedingungen}} && \\
\;&\, v_{01} \,&& && && && && && && && && && && && && \,&\leq &\, 2 \\
\;& &&\, v_{02} \,&& && && && && && && && && && && && \,&\leq &\, 3 \\
\;& && &&\, v_{03} \,&& && && && && && && && && && && \,&\leq &\, 1 \\
\;& && && &&\, v_{04} \,&& && && && && && && && && && \,&\leq &\, 7 \\
\;& && && && &&\, v_{16} \,&& && && && && && && && && \,&\leq &\, 5 \\
\;& && && && && &&\, v_{21} \,&& && && && && && && && \,&\leq &\, 4 \\
\;& && && && && && &&\, v_{25} \,&& && && && && && && \,&\leq &\, 4 \\
\;& && && && && && && &&\, v_{34} \,&& && && && && && \,&\leq &\, 4 \\
\;& && && && && && && && &&\, v_{35} \,&& && && && && \,&\leq &\, 3 \\
\;& && && && && && && && && &&\, v_{37} \,&& && && && \,&\leq &\, 2 \\
\;& && && && && && && && && && &&\, v_{47} \,&& && && \,&\leq &\, 3 \\
\;& && && && && && && && && && && &&\, v_{56} \,&& && \,&\leq &\, 2 \\
\;& && && && && && && && && && && && &&\, v_{57} \,&& \,&\leq &\, 8 \\
\;& && && && && && && && && && && && && &&\, v_{67} \,&\leq &\, 3 \\
\;&\, v_{01} && && && &-&\, v_{16} \,&+&\, v_{21} \,&& && && && && && && && \,&=&\, 0 \\
\;& &&\, v_{02} \,&& && && &-&\, v_{21} \,&-&\, v_{25} \,&& && && && && && && \,&=&\, 0 \\
\;& && &&\, v_{03} \,&& && && && &-&\, v_{34} \,&-&\, v_{35} \,&-&\, v_{37} \,&& && && && \,&=&\, 0 \\
\;& && && &&\, v_{04} \,&& && && &+&\, v_{34} \,&& && &-&\, v_{47} \,&& && && \,&=&\, 0 \\
\;& && && && && && &&\, v_{25} \,&& &+&\, v_{35} \,&& && &-&\, v_{56} \,&-&\, v_{57} \,&& \,&=&\, 0 \\
\;& && && && &&\, v_{16} \,&& && && && && && &+&\, v_{56} \,&& &-&\, v_{67} \,&=&\, 0 \\
\multicolumn{28}{r}{$v_{01}, v_{02}, v_{03}, v_{04}, v_{16}, v_{21}, v_{25}, v_{34}, v_{35}, v_{37}, v_{47}, v_{56}, v_{57}, v_{67}$} \,&\geq &\, 0
\end{alignat*}
\subsection{} %b
\begin{alignat*}{12}
\text{minimiere}\; & 5v_{01} \,&+&\, 4v_{02} \,&+&\, 3v_{03} \,&+&\, 3v_{16} \,&+&\, 6v_{21} \,&+&\, v_{23} \,&+&\, 5v_{24} \,&+&\, 5v_{35} \,&+&\, 3v_{45} \,&+&\, 4v_{46} \,&+&\, 2v_{56} \,&& \\
\multicolumn{24}{l}{\text{unter den Nebenbedingungen}} && \\
\;&\, v_{01} \,&+&\, v_{02} \,&+&\, v_{03} \,&& && && && && && && && \,&=&\, 6 \\
\;&\, v_{01} \,&& && && && && && && && && && \,&\leq &\, 3 \\
\;& &&\, v_{02} \,&& && && && && && && && && \,&\leq &\, 4 \\
\;& && &&\, v_{03} \,&& && && && && && && && \,&\leq &\, 5 \\
\;& && && &&\, v_{16} \,&& && && && && && && \,&\leq &\, 1 \\
\;& && && && &&\, v_{21} \,&& && && && && && \,&\leq &\, 6 \\
\;& && && && && &&\, v_{23} \,&& && && && && \,&\leq &\, 7 \\
\;& && && && && && &&\, v_{24} \,&& && && && \,&\leq &\, 4 \\
\;& && && && && && && &&\, v_{35} \,&& && && \,&\leq &\, 2 \\
\;& && && && && && && && &&\, v_{45} \,&& && \,&\leq &\, 4 \\
\;& && && && && && && && && &&\, v_{46} \,&& \,&\leq &\, 7 \\
\;& && && && && && && && && && &&\, v_{56} \,&\leq &\, 4 \\
\;&\, v_{01} && && &-&\, v_{16} \,&+&\, v_{21} \,&& && && && && && \,&=&\, 0 \\
\;& &&\, v_{02} \,&& && &-&\, v_{21} \,&-&\, v_{23} \,&-&\, v_{24} \,&& && && && \,&=&\, 0 \\
\;& && &&\, v_{03} \,&& && &+&\, v_{23} \,&& &-&\, v_{35} \,&& && && \,&=&\, 0 \\
\;& && && && && && &&\, v_{24} \,&& &-&\, v_{45} \,&-&\, v_{46} \,&& \,&=&\, 0 \\
\;& && && && && && && &&\, v_{35} \,&+&\, v_{45} \,&& &-&\, v_{56} \,&=&\, 0 \\
\multicolumn{22}{r}{$v_{01}, v_{02}, v_{03}, v_{16}, v_{21}, v_{23}, v_{24}, v_{35}, v_{45}, v_{46}, v_{56}$} \,&\geq &\, 0
\end{alignat*}
\subsection{} %c
\begin{alignat*}{5}
\text{minimiere}\; & c_{11}x_{11} \,&+&\, ... \,&+&\, c_{35}x_{35} \,&& && \\
\multicolumn{10}{l}{\text{unter den Nebenbedingungen}} \\
\; & x_{11} \,&+&\, ... \,&+&\, x_{35} \,&=&\, 3 && \\
\; & x_{11} \,&+&\, ... \,&+&\, x_{15} \,&=&\, 1 && \\
\; & x_{21} \,&+&\, ... \,&+&\, x_{25} \,&=&\, 1 && \\
\; & x_{31} \,&+&\, ... \,&+&\, x_{35} \,&=&\, 1 && \\
\multicolumn{6}{r}{$x_{ij}$} \,&\in &\, \{0,1\} &\; (i = 1, 2, 3) &\; (j = 1, 2, 3, 4, 5)
\end{alignat*}
\section{} %2
\textbf{Aufgabe:} Lösen Sie das folgende LP-Hilfsproblem mit dem Simplexverfahren:
\begin{alignat*}{4}
\text{maximiere}\; & && &-&\, x_{0} \,&& \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} \\
\;-&\, 2x_{1} \,&-&\, x_{2} \,&-&\, x_{0} \,&\leq &\, -3 \\
\;-&\, 2x_{1} \,&-&\, 2x_{2} \,&-&\, x_{0} \,&\leq &\, -5 \\
\;-&\, x_{1} \,&-&\, 4x_{2} \,&-&\, x_{0} \,&\leq &\, -4 \\
\multicolumn{6}{r}{$x_{0}, x_{1}, x_{2}$} \,&\geq &\, 0
\end{alignat*}
\textbf{Lösung.}
\underline{Starttableau}:
\begin{alignat*}{5}
x_{3} \,&=&\, -3 \,&+&\, 2x_{1} \,&+&\, x_{2} \,&+&\, x_{0} \\
x_{4} \,&=&\, -5 \,&+&\, 2x_{1} \,&+&\, 2x_{2} \,&+&\, x_{0} \\
x_{5} \,&=&\, -4 \,&+&\, x_{1} \,&+&\, 4x_{2} \,&+&\, x_{0} \\ \cline{1 - 9}
w &=& && && \,&-&\, x_{0}
\end{alignat*}
Umwandeln in ein zulässiges Tableau:
Eingangsvariable: $x_{0}$\\
Ausgangsvariable: $x_{4}$
Es folgt
\begin{alignat*}{2}
-x_{0} \,&=&&\, -5 + 2x_{1} + 2x_{2} - x_{4} \\
x_{0} \,&=&&\, 5 - 2x_{1} - 2x_{2} + x_{4} \\
x_{3} \,&=&&\, -3 + 2x_{1} + x_{2} + \left(5 - 2x_{1} - 2x_{2} + x_{4}\right) \\
&=&&\, -3 + 2x_{1} + x_{2} + 5 - 2x_{1} - 2x_{2} + x_{4} \\
&=&&\, 2 - x_{2} + x_{4} \\
x_{5} \,&=&&\, -4 + x_{1} + 4x_{2} + \left(5 - 2x_{1} - 2x_{2} + x_{4}\right) \\
&=&&\, -4 + x_{1} + 4x_{2} + 5 - 2x_{1} - 2x_{2} + x_{4} \\
&=&&\, 1 - x_{1} + 2x_{2} + x_{4} \\
w \,&=&&\, -\left(5 - 2x_{1} - 2x_{2} + x_{4}\right) \\
&=&&\, -5 + 2x_{1} + 2x_{2} - x_{4} \\
\end{alignat*}
\underline{Ergebnis des Umwandelns}:
\begin{alignat*}{5}
x_{0} \,&=&\, 5 \,&-&\, 2x_{1} \,&-&\, 2x_{2} \,&+&\, x_{4} \\
x_{3} \,&=&\, 2 \,&& &-&\, x_{2} \,&+&\, x_{4} \\
x_{5} \,&=&\, 1 \,&-&\, x_{1} \,&+&\, 2x_{2} \,&+&\, x_{4} \\ \cline{1 - 9}
w &=& -5 \,&+&\, 2x_{1} \,&+&\, 2x_{2} \,&-&\, x_{4}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{1}$ \\
Ausgangsvariable: $x_{5}$
Es folgt
\begin{alignat*}{2}
x_{1} \,&=&&\, 1 + 2x_{2} + x_{4} - x_{5} \\
x_{0} \,&=&&\, 5 - 2\left(1 + 2x_{2} + x_{4} - x_{5}\right) - 2x_{2} + x_{4} \\
&=&&\, 5 - 2 - 4x_{2} - 2x_{4} + 2x_{5} - 2x_{2} + x_{4} \\
&=&&\, 3 - 6x_{2} - x_{4} + 2x_{5} \\
x_{3} \,&=&&\, 2 - x_{2} + x_{4} \\
w \,&=&&\, -5 + 2\left(1 + 2x_{2} + x_{4} - x_{5}\right) + 2x_{2} - x_{4} \\
&=&&\, -5 + 2 + 4x_{2} + 2x_{4} - 2x_{5} + 2x_{2} - x_{4} \\
&=&&\, -3 + 6x_{2} + x_{4} - 2x_{5}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{5}
x_{1} \,&=&\, 1 \,&+&\, 2x_{2} \,&+&\, x_{4} \,&-&\, x_{5} \\
x_{0} \,&=&\, 3 \,&-&\, 6x_{2} \,&-&\, x_{4} \,&+&\, 2x_{5} \\
x_{3} \,&=&\, 2 \,&-&\, x_{2} \,&+&\, x_{4} \,&& \\ \cline{1 - 9}
w &=&\, -3 \,&+&\, 6x_{2} \,&+&\, x_{4} \,&-&\, 2x_{5}
\end{alignat*}
\underline{2. Iteration}:
Eingangsvariable: $x_{2}$ \\
Ausgangsvariable: $x_{0}$
Es folgt
\begin{alignat*}{2}
6x_{2} \,&=&&\, 3 - x_{4} + 2x_{5} - x_{0} \\
x_{2} \,&=&&\, \frac{1}{2} - \frac{1}{6}x_{4} + \frac{1}{3}x_{5} - \frac{1}{6}x_{0} \\
x_{1} \,&=&&\, 1 + 2\left(\frac{1}{2} - \frac{1}{6}x_{4} + \frac{1}{3}x_{5} - \frac{1}{6}x_{0}\right) + x_{4} - x_{5} \\
&=&&\, 1 + 1 - \frac{1}{3}x_{4} + \frac{2}{3}x_{5} - \frac{1}{3}x_{0} + x_{4} - x_{5} \\
&=&&\, 2 + \frac{2}{3}x_{4} - \frac{1}{3}x_{5} - \frac{1}{3}x_{0} \\
x_{3} \,&=&&\, 2 - \left(\frac{1}{2} - \frac{1}{6}x_{4} + \frac{1}{3}x_{5} - \frac{1}{6}x_{0}\right) + x_{4} \\
&=&&\, 2 - \frac{1}{2} + \frac{1}{6}x_{4} - \frac{1}{3}x_{5} + \frac{1}{6}x_{0} + x_{4} \\
&=&&\, \frac{3}{2} + \frac{7}{6}x_{4} - \frac{1}{3}x_{5} + \frac{1}{6}x_{0} \\
w \,&=&&\, -3 + 6\left(\frac{1}{2} - \frac{1}{6}x_{4} + \frac{1}{3}x_{5} - \frac{1}{6}x_{0}\right) + x_{4} - 2x_{5} \\
&=&&\, -3 + 3 - x_{4} + 2x_{5} - x_{0} + x_{4} - 2x_{5} \\
&=&&\, 0 - x_{0}
\end{alignat*}
\underline{Ergebnis der 2. Iteration}:
\begin{alignat*}{5}
x_{2} \,&=&\, \frac{1}{2} \,&-&\, \frac{1}{6}x_{4} \,&+&\, \frac{1}{3}x_{5} \,&-&\, \frac{1}{6}x_{0} \\
x_{1} \,&=&\, 2 \,&+&\, \frac{2}{3}x_{4} \,&-&\,\frac{1}{3}x_{5} \,&-&\, \frac{1}{3}x_{0} \\
x_{3} \,&=&\, \frac{3}{2} \,&+&\, \frac{7}{6}x_{4} \,&-&\, \frac{1}{3}x_{5} \,&+&\, \frac{1}{6}x_{0} \\ \cline{1 - 9}
w &=& && && &-&\, x_{0}
\end{alignat*}
Das Tableau ist optimal. Als optimale Lösung des Hilfsproblem erhält man:
\[
x_{0} = 0, x_{1} = 2, x_{2} = \frac{1}{2}
\]
Als zulässige Lösung für das ursprüngliche Problem ergibt sich:
\[
x_{1} = 2, x_{2} = \frac{1}{2}
\]
Die ursprüngliche Zielfunktion lautet $z = -3x_{1} - 5x_{2}$. Setzt man für $x_{1}$ und $x_{2}$ die rechten Seiten der Gleichungen im obigen Tableau ein, erhält man:
\[
z = -\frac{17}{2} - \frac{7}{6}x_{4} - \frac{2}{3}x_{5}
\]
Daraus ergibt sich dieses Starttableau:
\begin{alignat*}{4}
x_{2} \,&=&\, \frac{1}{2} \,&-&\, \frac{1}{6}x_{4} \,&+&\, \frac{1}{3}x_{5} \\
x_{1} \,&=&\, 2 \,&+&\, \frac{2}{3}x_{4} \,&-&\, \frac{1}{3}x_{5} \\
x_{3} \,&=&\, \frac{3}{2} \,&+&\, \frac{7}{6}x_{4} \,&-&\, \frac{1}{3}x_{5} \\ \cline{1 - 7}
z \,&=&\, -\frac{17}{2} \,&-&\, \frac{7}{6}x_{4} \,&-&\, \frac{2}{3}x_{5}
\end{alignat*}
Es lässt sich leicht erkennen, dass das Starttableau zugleich auch die optimale Lösung enthält. Die optimale Lösung für das Ölraffinerieproblem lautet demnach wie folgt:
\[
x_{1} = 2, x_{2} = \frac{1}{2}
\]
Daraus ergibt sich durch Einsetzen in die Zielfunktion des ursprünglichen Minimierungsproblems, dass die geringsten Kosten unter Beachtung der Nebenbedingungen bei $8.5$ Euro liegen.
\end{document}

View File

@ -0,0 +1,191 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usetikzlibrary{matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
% ensures that paragraphs are separated by empty lines
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
% define how the sections are rendered
\def\thesection{\arabic{section})}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
% some matrix magic
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\begin{document}
\author{Jan Branitz (6326955), Jim Martens (6420323),\\
Stephan Niendorf (6242417)}
\title{Hausaufgaben zum 25. November}
\maketitle
\section{} %1
\subsection{} %a
Das duale Problem (D):
\begin{alignat*}{4}
\text{minimiere}\; & 5y_{1} \,&+&\, 11y_{2} \,&+&\, 8y_{3} && \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
\;& 2y_{1} \,&+&\, 4y_{2} \,&+&\, 3y_{3} \,&\geq & 5 \\
\;& 3y_{1} \,&+&\, y_{2} \,&+&\, 4y_{3} \,&\geq & 4 \\
\;& y_{1} \,&+&\, 2y_{2} \,&+&\, 2y_{3} \,&\geq & 3 \\
\multicolumn{6}{r}{$y_{1}, y_{2}, y_{3}$} \,&\geq &\, 0
\end{alignat*}
\subsection{} %b
Eine optimale Lösung für (D) ist $(y_{1}^{*}, y_{2}^{*}, y_{3}^{*}) = (1, 0, 1)$.
\subsection{} %c
Überprüfen, ob die in (b) abgelesene Lösung auch eine zulässige Lösung von (D) ist.
\begin{alignat*}{2}
2 \cdot 1 + 4 \cdot 0 + 3 \cdot 1 &=& 5 \geq 5 \\
3 \cdot 1 + 1 \cdot 0 + 4 \cdot 1 &=& 7 \geq 4 \\
1 \cdot 1 + 2 \cdot 0 + 2 \cdot 1 &=& 3 \geq 3
\end{alignat*}
Wie leicht zu erkennen ist, sind alle drei Nebenbedingungen plus die Nichtnegativitätsbedingungen von (D) durch diese Lösung erfüllt, womit die Lösung eine zulässige Lösung von (D) ist.
\subsection{} %d
Nach dem Dualitätssatz haben die optimale Lösung des primalen Problems und die optimale Lösung des dualen Problems die gleichen Zielfunktionswerte.
Für das primale Problem wurde der Zielfunktionswert $13$ errechnet (siehe Skript Seite 16). Nach dem Einsetzen der in (b) ermittelten Lösung in die Zielfunktion von (D) ergibt sich:
\[
5 \cdot 1 + 11 \cdot 0 + 8 \cdot 1 = 13
\]
Da die in (b) gefundene Lösung den gleichen Zielfunktionswert hat, wie die optimale Lösung des primalen Problems, ist die gefundene Lösung nach dem Dualitätssatz die optimale Lösung von (D).
\subsection{} %e
Zum Überprüfen der komplementären Schlupfbedingungen wird die Lösung des primalen Problems in die Ungleichungen des primalen Problems eingesetzt. Ist eine Ungleichheit nicht mit Gleichheit erfüllt, dann ist die entsprechende Variable im dualen Problem gleich $0$. Wenn eine Variable im primalen Problem größer $0$ ist, dann muss die entsprechende Ungleichung im dualen Problem mit Gleichheit erfüllt sein.
Es ergibt sich:
\begin{alignat*}{3}
2 \cdot 2 + 3 \cdot 0 + 1 \cdot 1 &=& 5 &\leq &5 \\
4 \cdot 2 + 1 \cdot 0 + 2 \cdot 1 &=& 10 &\leq &11 \\
3 \cdot 2 + 4 \cdot 0 + 2 \cdot 1 &=& 8 &\leq &8
\end{alignat*}
Die erste und dritte Ungleichung ist somit mit Gleichheit erfüllt. Die zweite Ungleichung ist nicht mit Gleichheit erfüllt. Daher muss $y_{2}^{*} = 0$ gelten. Da sowohl $x_{1}^{*}$ als auch $x_{3}^{*}$ größer $0$ sind, müssen die erste und dritte Ungleichung des dualen Problems mit Gleichheit erfüllt sein. Daraus ergibt sich:
\begin{alignat*}{3}
2 \cdot 1 + 3 \cdot 1 &=& 5 &\geq & 5\\
1 \cdot 1 + 2 \cdot 1 &=& 3 &\geq & 3\\
\end{alignat*}
Wie zu erkennen ist, sind die beiden betreffenden Ungleichungen mit Gleichheit erfüllt. Damit gelten die komplementären Schlupfbedingungen, womit bestätigt ist, dass die gefundenen Lösungen optimal sind.
\section{} %2
\subsection{} %a
Bestätigen der in den Präsenzaufgaben bestimmten Lösungen als optimale Lösungen mithilfe der komplementären Schlupfbedingungen:
\begin{alignat*}{3}
1 \cdot \frac{32}{29} + 3 \cdot \frac{8}{29} + 1 \cdot \frac{30}{29} &=& \frac{86}{29} &\leq & \frac{87}{29} = 3 \\
-1 \cdot \frac{32}{29} + 0 \cdot \frac{8}{29} + 3 \cdot \frac{30}{29} &=& \frac{58}{29} &\leq & \frac{58}{29} = 2 \\
2 \cdot \frac{32}{29} - 1 \cdot \frac{8}{29} + 2 \cdot \frac{30}{29} &=& \frac{116}{29} &\leq & \frac{116}{29} = 4 \\
2 \cdot \frac{32}{29} + 3 \cdot \frac{8}{29} - 1 \cdot \frac{30}{29} &=& \frac{58}{29} &\leq & \frac{58}{29} = 2
\end{alignat*}
Die erste Ungleichung ist nicht mit Gleichheit erfüllt, also muss $y_{1}^{*} = 0$ gelten. Da alle drei Variablen des primalen Problems größer $0$ sind, müssen alle Ungleichungen des dualen Problems mit Gleichheit erfüllt sein.
\begin{alignat*}{3}
1 \cdot 0 - 1 \cdot 1 + 2 \cdot 1 + 2 \cdot 2 &=& 5 &\geq & 5 \\
3 \cdot 0 + 0 \cdot 1 - 1 \cdot 1 + 3 \cdot 2 &=& 5 &\geq & 5 \\
1 \cdot 0 + 3 \cdot 1 + 2 \cdot 1 - 1 \cdot 2 &=& 3 &\geq & 3
\end{alignat*}
Wie zu erkennen ist, sind alle drei Ungleichungen mit Gleichheit erfüllt.D amit gelten die komplementären Schlupfbedingungen, womit bestätigt ist, dass die gefundenen Lösungen optimal sind.
\subsection{} %b
Das duale Problem (D):
\begin{alignat*}{3}
\text{minimiere}\; & 3y_{1} \,&+&\, y_{2} && \\
\multicolumn{6}{l}{\text{unter den Nebenbedingungen}} && \\
\;& y_{1} \,&-&\, y_{2} &\geq & 1 \\
\;& y_{1} \,&-&\, 3y_{2} &\geq & -9 \\
\;& 3y_{1} \,&-&\, 7y_{2} &\geq & -11 \\
\;& y_{1} \,&+&\, y_{2} &\geq & 3 \\
\multicolumn{4}{r}{$y_{1}, y_{2}$} \,&\geq &\, 0
\end{alignat*}
Ablesen einer optimalen Lösung ergibt: $(y_{1}^{*}, y_{2}^{*}) = (2, 1)$.
Durch Einsetzen der soeben ermittelten Lösung des dualen Problems in die Nebenbedingungen ergibt sich:
\begin{alignat*}{3}
1 \cdot 2 - 1 \cdot 1 = 1 &\geq & 1 \\
1 \cdot 2 - 3 \cdot 1 = -1 &\geq & -9 \\
3 \cdot 2 - 7 \cdot 1 = 2 &\geq & -11 \\
1 \cdot 2 + 1 \cdot 1 = 3 &\geq & 3
\end{alignat*}
Somit ist die ermittelte Lösung eine zulässige Lösung des dualen Problems.
\subsubsection{} %i
Der Zielfunktionswert für die optimale Lösung des primalen Problems ist $7$. Nach Einsetzen der ermittelten dualen Lösung in die Zielfunktion ergibt sich:
\[
3 \cdot 2 + 1 \cdot 1 = 7
\]
Da die Zielfunktionswerte übereinstimmen sind sowohl die primale Lösung als auch die duale Lösung nach Dualitätssatz für das jeweilige Problem optimal.
\subsubsection{} %ii
Einsetzen der primalen Lösung in die Nebenbedingungen des primalen Problems:
\begin{alignat*}{3}
1 \cdot 1 + 1 \cdot 0 + 3 \cdot 0 + 1 \cdot 2 &=& 3 &\leq & 3 \\
-1 \cdot 1 - 3 \cdot 0 - 7 \cdot 0 + 1 \cdot 2 &=& 1 &\leq & 1
\end{alignat*}
Es sind beide Ungleichungen mit Gleichheit erfüllt. Da $x_{1}$ und $x_{4}$ größer $0$ sind, müssen die erste und vierte Ungleichung des dualen Problems mit Gleichheit erfüllt sein.
\begin{alignat*}{3}
1 \cdot 2 - 1 \cdot 1 &=& 1 &\geq & 1 \\
1 \cdot 2 + 1 \cdot 1 &=& 3 &\geq & 3
\end{alignat*}
Da die beiden Ungleichungen mit Gleichheit erfüllt sind, gelten die komplementären Schlupfbedingungen für die ermittelte primale und duale Lösung. Daher sind beide für das jeweilige Problem die optimale Lösung.
\subsection{} %c
Das duale Problem (D):
\begin{alignat*}{4}
\text{minimiere}\; & 5y_{1} \,&-&\, 6y_{2} \,&-&\, 10y_{3} && \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
\;& y_{1} \,&-&\, 3y_{2} \,&-&\, 11y_{3} \,&\geq & -1 \\
\;& -y_{1} \,&-&\, y_{2} \,&-&\, y_{3} \,&\geq & -1 \\
\multicolumn{6}{r}{$y_{1}, y_{2}, y_{3}$} \,&\geq &\, 0
\end{alignat*}
Umformen in Maximierungsproblem:
\begin{alignat*}{4}
\text{maximiere}\; & -5y_{1} \,&+&\, 6y_{2} \,&+&\, 10y_{3} && \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
\;& -y_{1} \,&+&\, 3y_{2} \,&+&\, 11y_{3} \,&\leq & 1 \\
\;& y_{1} \,&+&\, y_{2} \,&+&\, y_{3} \,&\leq & 1 \\
\multicolumn{6}{r}{$y_{1}, y_{2}, y_{3}$} \,&\geq &\, 0
\end{alignat*}
\underline{Starttableau}:
\begin{alignat*}{5}
y_{4} \,&=&\, 1 \,&+&\, y_{1} \,&-&\, 3y_{2} \,&-&\, 11y_{3} \\
y_{5} \,&=&\, 1 \,&-&\, y_{1} \,&-&\, y_{2} \,&-&\, y_{3} \\ \cline{1 - 9}
w &=& &-&\, 5y_{1} \,&+&\, 6y_{2} \,&+&\, 10y_{3}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $y_{3}$\\
Ausgangsvariable: $y_{4}$
Es folgt
\begin{alignat*}{2}
3y_{2} \,&=&&\, 1 + y_{1} - 11y_{3} - y_{4} \\
y_{2} \,&=&&\, \frac{1}{3} + \frac{1}{3}y_{1} - \frac{11}{3}y_{3} - \frac{1}{3}y_{4} \\
y_{5} \,&=&&\, 1 - y_{1} - \left(\frac{1}{3} + \frac{1}{3}y_{1} - \frac{11}{3}y_{3} - \frac{1}{3}y_{4}\right) - y_{3} \\
&=&&\, 1 - y_{1} - \frac{1}{3} - \frac{1}{3}y_{1} + \frac{11}{3}y_{3} + \frac{1}{3}y_{4} - y_{3} \\
&=&&\, \frac{2}{3} - \frac{4}{3}y_{1} + \frac{8}{3}y_{3} + \frac{1}{3}y_{4} \\
w \,&=&&\, -5y_{1} + 6\left(\frac{1}{3} + \frac{1}{3}y_{1} - \frac{11}{3}y_{3} - \frac{1}{3}y_{4}\right) + 10y_{3} \\
&=&&\, -5y_{1} + 2 + 2y_{1} - 22y_{3} - 2y_{4} + 10y_{3} \\
&=&&\, 2 - 3y_{1} - 12y_{3} - 2y_{4}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{5}
y_{2} \,&=&\, \frac{1}{3} \,&+&\, \frac{1}{3}y_{1} \,&-&\, \frac{11}{3}y_{3} \,&-&\, \frac{1}{3}y_{4} \\
y_{5} \,&=&\, \frac{2}{3} \,&-&\, \frac{4}{3}y_{1} \,&+&\, \frac{8}{3}y_{3} \,&+&\, \frac{1}{3}y_{4} \\ \cline{1 - 9}
w &=& 2 \,&-&\, 3y_{1} \,&-&\, 12y_{3} \,&-&\, 2y_{4}
\end{alignat*}
Die optimale Lösung von (D) ist damit:
\[
y_{1} = 0, y_{2} = \frac{1}{3}, y_{3} = 0
\]
Mithilfe des letzten Tableaus lässt sich die optimale Lösung des primalen Problems ablesen:
\[
x_{1} = 2, x_{2} = 0
\]
\end{document}

View File

@ -0,0 +1,212 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usetikzlibrary{matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
% ensures that paragraphs are separated by empty lines
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
% define how the sections are rendered
\def\thesection{\arabic{section})}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
% some matrix magic
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\begin{document}
\author{Jan Branitz (6326955), Jim Martens (6420323),\\
Stephan Niendorf (6242417)}
\title{Hausaufgaben zum 2. Dezember}
\maketitle
\section{} %1
\subsection{} %a
LP-Problem (P):
\begin{alignat*}{4}
\text{maximiere}\; & 3x_{1} \,&+&\, x_{2} \,&+&\, 2x_{3} && \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
\;& x_{1} \,&+&\, x_{2} \,&+&\, 3x_{3} \,&\leq & 30 \\
\;& 2x_{1} \,&+&\, 2x_{2} \,&+&\, 5x_{3} \,&\leq & 24 \\
\;& 4x_{1} \,&+&\, x_{2} \,&+&\, 2x_{3} \,&\leq & 36 \\
\multicolumn{6}{r}{$x_{1}, x_{2}, x_{3}$} \,&\geq &\, 0
\end{alignat*}
Duales Problem (D):
\begin{alignat*}{4}
\text{minimiere}\; & 30y_{1} \,&+&\, 24y_{2} \,&+&\, 36y_{3} && \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
\;& y_{1} \,&+&\, 2y_{2} \,&+&\, 4y_{3} \,&\geq & 3 \\
\;& y_{1} \,&+&\, 2y_{2} \,&+&\, y_{3} \,&\geq & 1 \\
\;& 3y_{1} \,&+&\, 5y_{2} \,&+&\, 2y_{3} \,&\geq & 2 \\
\multicolumn{6}{r}{$y_{1}, y_{2}, y_{3}$} \,&\geq &\, 0
\end{alignat*}
Durch Einsetzen von $x_{1}^{*}, x_{2}^{*}, x_{3}^{*}$ in die erste Ungleichung von P ergibt sich:
\begin{alignat*}{2}
1 \cdot \frac{33}{4} + 1 \cdot 0 + 3 \cdot \frac{3}{2} &\leq & 30 \\
\frac{33}{4} + \frac{18}{4} &\leq & 30 \\
\frac{51}{4} &\leq & \frac{120}{4}
\end{alignat*}
Die erste Ungleichung ist nicht mit Gleichheit erfüllt, somit muss $y_{1}^{*} = 0$ gelten.
Einsetzen in die zweite Ungleichung ergibt:
\begin{alignat*}{2}
2 \cdot \frac{33}{4} + 2 \cdot 0 + 5 \cdot \frac{3}{2} &\leq & 24 \\
\frac{33}{2} + \frac{15}{2} &\leq & 24 \\
\frac{48}{2} &\leq & \frac{48}{2}
\end{alignat*}
Die zweite Ungleichung ist mit Gleichheit erfüllt, woraus sich keine Schlüsse ziehen lassen.
Einsetzen in die dritte Ungleichung ergibt:
\begin{alignat*}{2}
4 \cdot \frac{33}{4} + 1 \cdot 0 + 2 \cdot \frac{3}{2} &\leq & 36 \\
33 + 3 &\leq & 36 \\
36 &\leq & 36
\end{alignat*}
Auch die dritte Ungleichung ist mit Gleichheit erfüllt. Da $x_{1}^{*}$ und $x_{3}^{*}$ größer als $0$ sind, müssen die erste und dritte Ungleichung von D mit Gleichheit erfüllt sein.
Unter Berücksichtigung von $y_{1}^{*} = 0$ ergibt sich daraus:
\begin{alignat*}{2}
I \;& 2y_{2} + 4y_{3} &=& 3 \\
II \;& 2y_{2} + y_{3} &=& 1 \\
I - II \;& 3y_{3} &=& 2 \\
& y_{3} &=& \frac{2}{3} \\
\intertext{Einsetzen von $y_{3}$ in $II$}
II \;& 2y_{2} + \frac{2}{3} &=& 1 \\
& 2y_{2} &=& \frac{1}{3} \\
& y_{2} &=& \frac{1}{6}
\end{alignat*}
Demnach sind $y_{1}^{*} = 0, y_{2}^{*} = \frac{1}{6}, y_{3}^{*} = \frac{2}{3}$ eindeutig bestimmte Zahlen, die zusammen mit den x-Werten die komplementären Schlupfbedingungen erfüllen. Auffallend ist, dass dies die gleichen Werte sind, die bereits im ersten Beispiel auf Skript Seite 63 herauskamen. Da dort bereits überprüft wurde, ob die Zahlen eine zulässige Lösung von D sind und dies bestätigt wurde, kann diese Überprüfung hier ausgelassen werden.
Demnach ist $x_{1}^{*} = \frac{33}{4}, x_{2}^{*} = 0, x_{3}^{*} = \frac{3}{2}$ ebenso eine optimale Lösung für das LP-Problem.
\subsection{} %b
Zum Überprüfen der vorgeschlagenen Lösung werden die Werte zunächst in die Ungleichungen des LP-Problems eingesetzt.
Erste Ungleichung:
\begin{alignat*}{2}
5 + 2 &\leq & 7 \\
7 &\leq & 7
\end{alignat*}
Zweite Ungleichung:
\begin{alignat*}{2}
2 + 6 &\leq & 8 \\
8 &\leq & 8
\end{alignat*}
Dritte Ungleichung:
\begin{alignat*}{2}
2 \cdot 5 + 2 &\leq & 12 \\
12 &\leq & 12
\end{alignat*}
Da alle der Ungleichungen mit Gleichheit erfüllt sind, können keine Rückschlüsse auf y-Werte gezogen werden. Da alle x-Werte größer als 0 sind, müssen alle drei Ungleichungen von D mit Gleichheit erfüllt sein.
Das duale Problem:
\begin{alignat*}{4}
\text{minimiere}\; & 7y_{1} \,&+&\, 8y_{2} \,&+&\, 12y_{3} && \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
\;& y_{1} \,&& &+&\, 2y_{3} \,&\geq & 2 \\
\;& y_{1} \,&+&\, y_{2} \,&+&\, y_{3} \,&\geq & 3 \\
\;& &&\, y_{2} && &\geq & 2 \\
\multicolumn{6}{r}{$y_{1}, y_{2}, y_{3}$} \,&\geq &\, 0
\end{alignat*}
Aus der dritten Ungleichung lässt sich ablesen, dass $y_{2}^{*} = 2$ gilt. Es ergibt sich das folgende LGS:
\begin{alignat*}{2}
I \;& y_{1} + 2y_{3} &=& 2 \\
II \;& y_{1} + 2 + y_{3} &=& 3 \\
\;& y_{1} + y_{3} &=& 1 \\
I - II \;& y_{3} &=& 1 \\
\intertext{Einsetzen von $y_{3}$ in $I$}
I \;& y_{1} + 2 \cdot 1 &=& 2 \\
\;& y_{1} &=& 0
\end{alignat*}
Es ergeben sich somit die eindeutig bestimmten Zahlen $y_{1}^{*} = 0, y_{2}^{*} = 2, y_{3}^{*} = 1$. Diese Zahlen erfüllen zusammen mit der vorgeschlagenen Lösung die komplementären Schlupfbedingungen.
Schließlich muss noch geprüft werden, ob diese Zahlen auch eine zulässige Lösung des dualen Problems sind. Dafür werden diese eingesetzt:
Erste Ungleichung:
\begin{alignat*}{2}
2 \cdot 1 &\geq & 2 \\
2 &\geq & 2
\end{alignat*}
Zweite Ungleichung:
\begin{alignat*}{2}
2 + 1 &\geq & 3 \\
3 &\geq & 3
\end{alignat*}
Dritte Ungleichung:
\begin{alignat*}{2}
2 &\geq & 2
\end{alignat*}
Da alle drei Ungleichungen mit den herausgefundenen Zahlen gültig sind, stellen die gefundenen Zahlen eine zulässige Lösung des dualen Problems dar.
\section{} %2
Zunächst wird das eigentliche LP-Problem noch einmal aufgestellt:
\begin{alignat*}{7}
\text{maximiere}\; & 8x_{1} &+& 3x_{2} &+& 6x_{3} &+& 3x_{4} &+& 9x_{5} &+& 5x_{6} && \\
\multicolumn{14}{l}{\text{unter den Nebenbedingungen}} && \\
& x_{1} &+& x_{2} && && && && &\leq &\, 400 \\
& && && x_{3} &+& x_{4} && && &\leq &\, 480 \\
& && && && && x_{5} &+& x_{6} &\leq &\, 230 \\
& x_{1} && &+& x_{3} && &+& x_{5} && &\leq &\, 420 \\
& && x_{2} && &+& x_{4} && &+& x_{6} &\leq &\, 250 \\
\multicolumn{12}{r}{$x_{1}, x_{2}, x_{3}, x_{4}, x_{5}, x_{6}$} \,&\geq &\, 0
\end{alignat*}
Die vorgeschlagene Lösung ist $x_{1}^{*} = 400, x_{2}^{*} = 0, x_{3}^{*} = 10, x_{4}^{*} = 30, x_{5}^{*} = 10, x_{6}^{*} = 220$.
Es ist offensichtlich, dass die erste Ungleichung mit Gleichheit erfüllt ist. Die zweite Ungleichung ist ebenso offensichtlich nicht mit Gleichheit erfüllt ($10 + 30 = 40 < 480$). Die dritte Ungleichung ist mit Gleichheit erfüllt ($10 + 220 = 230$).
Die vierte Ungleichung ist ebenso mit Gleichheit erfüllt ($400 + 10 + 10 = 420$), wie die fünfte Ungleichung ($0 + 30 + 220 = 250$).
Daraus lässt sich schließen, dass $y_{2}^{*} = 0$ gelten muss. Ebenso müssen die erste, dritte, vierte, fünfte und sechste Ungleichung des dualen Problems mit Gleichheit erfüllt sein, da die entsprechenden Werte des primalen Problems größer $0$ sind.
Das duale Problem:
\begin{alignat*}{6}
\text{minimiere}\; & 400y_{1} &+& 480y_{2} &+& 230y_{3} &+& 420y_{4} &+& 250y_{5} && \\
\multicolumn{12}{l}{\text{unter den Nebenbedingungen}} && \\
& y_{1} && && &+& y_{4} && &\geq &\, 8 \\
& y_{1} && && && &+& y_{5} &\geq &\, 3 \\
& && y_{2} && &+& y_{4} && &\geq &\, 6 \\
& && y_{2} && && && y_{5} &\geq &\, 3 \\
& && && y_{3} &+& y_{4} && &\geq &\, 9 \\
& && && y_{3} && &+& y_{5} &\geq &\, 5 \\
\multicolumn{10}{r}{$y_{1}, y_{2}, y_{3}, y_{4}, y_{5}$} \,&\geq &\, 0
\end{alignat*}
Unter der Berücksichtigung, dass $y_{2}^{*} = 0$ gilt und alle außer die zweite Ungleichung mit Gleichheit erfüllt sein müssen, ergibt sich direkt $y_{4}^{*} = 6$ und $y_{5}^{*} = 3$.
Aufgrund dieser Werte lassen sich die restlichen Werte leicht errechnen:
\begin{alignat*}{2}
y_{1} + 6 &=& 8 \\
y_{1} &=& 2 \\
\intertext{Fünfte Ungleichung}
y_{3} + 6 &=& 9 \\
y_{3} &=& 3 \\
\intertext{Sechste Ungleichung}
y_{3} + 3 &=& 5 \\
y_{3} &=& 2
\end{alignat*}
Bei dem Errechnen von $y_{3}$ ergibt sich ein Widerspruch, denn $y_{3}$ kann nicht sowohl 2 als auch 3 sein. Eine Alternative gibt es hier nicht, da sowohl die fünfte als auch die sechste Ungleichung mit Gleichheit erfüllt sein müssen.
Da es somit keine eindeutig bestimmbaren Zahlen $y_{i}^{*}$ mit $i = \{1,2,3,4,5\}$ gibt, die zusammen mit der vorgeschlagenen Lösung die komplementären Schlupfbedingungen erfüllen, entspricht die vorgeschlagene Lösung nicht der optimalen Strategie.
\end{document}

View File

@ -0,0 +1,285 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usetikzlibrary{matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
% ensures that paragraphs are separated by empty lines
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
% define how the sections are rendered
\def\thesection{\arabic{section})}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
% some matrix magic
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\begin{document}
\author{Jan Branitz (6326955), Jim Martens (6420323),\\
Stephan Niendorf (6242417)}
\title{Hausaufgaben zum 9. Dezember}
\maketitle
\section{} %1
\subsection{} %a
\begin{alignat*}{4}
\text{minimiere}\; & y_{1} \,&+&\, 2y_{2} \,&+&\, 3y_{3} && \\
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
\;& 2y_{1} \,&+&\, 3y_{2} \,&+&\, y_{3} \,&\geq & 5 \\
\;& 3y_{1} \,&+&\, y_{2} \,&+&\, y_{3} \,&\geq & -7 \\
\;-& y_{1} \,&+&\, 4y_{2} \,&-&\, 2y_{3} \,&\geq & 3 \\
\;& y_{1} \,&-&\, 2y_{2} \,&-&\, y_{3} \,&=& 1 \\
\multicolumn{6}{r}{$y_{2}, y_{3}$} \,&\geq &\, 0
\end{alignat*}
\subsection{} %b
\begin{alignat*}{9}
\text{maximiere}\; -& y_{1} &+& 16y_{2} &+& 5y_{3} &+& 8y_{4} &+& y_{5} &-& 4y_{6} &-& 10y_{7} &+& 9y_{8} && \\
\multicolumn{18}{l}{\text{unter den Nebenbedingungen}} && \\
& 2y_{1} &+& y_{2} &+& y_{3} &+& 2y_{4} &+& y_{5} &+& 4y_{6} &-& 4y_{7} &+& y_{8} &\leq &\, -2 \\
-& 4y_{1} &+& 5y_{2} && &+& 4y_{4} &-& 3y_{5} &-& 3y_{6} &+& 3y_{7} &+& 2y_{8} &=&\, 3 \\
& y_{1} &+& y_{2} &+& y_{3} &-& y_{4} &+& y_{5} && &-& 5y_{7} &+& y_{8} &=&\, 22 \\
\multicolumn{16}{r}{$y_{4}, y_{5}, y_{6}, y_{7}$} \,&\geq &\, 0
\end{alignat*}
\section{} %2
\subsection{} %a
Das LP-Problem:
\begin{alignat*}{3}
\text{maximiere}\; & 40x_{1} \,&+&\, 70x_{2} && \\
\multicolumn{6}{l}{\text{unter den Nebenbedingungen}} && \\
\;& x_{1} \,&+&\, x_{2} \,&\leq & 100 \\
\;& 10x_{1} \,&+&\, 50x_{2} \,&\leq & 4000 \\
\multicolumn{4}{r}{$x_{1}, x_{2}$} \,&\geq &\, 0
\end{alignat*}
Das duale Problem:
\begin{alignat*}{3}
\text{minimiere}\; & 100y_{1} \,&+&\, 4000y_{2} && \\
\multicolumn{6}{l}{\text{unter den Nebenbedingungen}} && \\
\;& y_{1} \,&+&\, 10y_{2} \,&\geq & 40 \\
\;& y_{1} \,&+&\, 50y_{2} \,&\geq & 70 \\
\multicolumn{4}{r}{$y_{1}, y_{2}$} \,&\geq &\, 0
\end{alignat*}
\subsubsection{} %i
\underline{Starttableau}:
\begin{alignat*}{4}
x_{3} \,&=&\, 100 \,&-&\, x_{1} \,&-&\, x_{2} \\
x_{4} \,&=&\, 4000 \,&-&\, 10x_{1} \,&-&\, 50x_{2} \\ \cline{1 - 7}
z &=& &&\, 40x_{1} \,&+&\, 70x_{2}
\end{alignat*}
\underline{1. Iteration}:
Eingangsvariable: $x_{2}$\\
Ausgangsvariable: $x_{4}$
Es folgt
\begin{alignat*}{2}
50x_{2} \,&=&&\, 4000 - 10x_{1} - x_{4} \\
x_{2} \,&=&&\, 80 - \frac{1}{5}x_{1} - \frac{1}{50}x_{4} \\
x_{3} \,&=&&\, 100 - x_{1} - \left(80 - \frac{1}{5}x_{1} - \frac{1}{50}x_{4}\right) \\
&=&&\, 100 - x_{1} - 80 + \frac{1}{5}x_{1} + \frac{1}{50}x_{4} \\
&=&&\, 20 - \frac{4}{5}x_{1} + \frac{1}{50}x_{4} \\
z \,&=&&\, 40x_{1} + 70\left(80 - \frac{1}{5}x_{1} - \frac{1}{50}x_{4}\right) \\
&=&&\, 40x_{1} + 5600 - 14x_{1} - \frac{7}{5}x_{4} \\
&=&&\, 5600 + 26x_{1} - \frac{7}{5}x_{4}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{4}
x_{2} \,&=&\, 80 \,&-&\, \frac{1}{5}x_{1} \,&-&\, \frac{1}{50}x_{4} \\
x_{3} \,&=&\, 20 \,&-&\, \frac{4}{5}x_{1} \,&+&\, \frac{1}{50}x_{4} \\ \cline{1 - 7}
z &=& 5600 \,&+&\, 26x_{1} \,&-&\, \frac{7}{5}x_{4}
\end{alignat*}
\underline{2. Iteration}:
Eingangsvariable: $x_{1}$\\
Ausgangsvariable: $x_{3}$
Es folgt
\begin{alignat*}{2}
\frac{4}{5}x_{1} \,&=&&\, 20 + \frac{1}{50}x_{4} - x_{3} \\
x_{1} \,&=&&\, 25 + \frac{1}{40}x_{4} - \frac{5}{4}x_{3} \\
x_{2} \,&=&&\, 80 - \frac{1}{5}\left(25 + \frac{1}{40}x_{4} - \frac{5}{4}x_{3}\right) - \frac{1}{50}x_{4} \\
&=&&\, 80 - 5 + \frac{1}{200}x_{4} - \frac{1}{4}x_{3} - \frac{1}{50}x_{4} \\
&=&&\, 75 - \frac{3}{200}x_{4} - \frac{1}{4}x_{3} \\
z \,&=&&\, 5600 + 26\left(25 + \frac{1}{40}x_{4} - \frac{5}{4}x_{3}\right) - \frac{7}{5}x_{4} \\
&=&&\, 5600 + 650 + \frac{13}{20}x_{4} - \frac{65}{2}x_{3} - \frac{7}{5}x_{4} \\
&=&&\, 6250 - \frac{3}{4}x_{4} - \frac{65}{2}x_{3}
\end{alignat*}
\underline{Ergebnis der 2. Iteration}:
\begin{alignat*}{4}
x_{1} \,&=&\, 25 \,&-&\, \frac{1}{40}x_{4} \,&-&\, \frac{5}{4}x_{3} \\
x_{2} \,&=&\, 75 \,&-&\, \frac{3}{200}x_{4} \,&-&\, \frac{1}{4}x_{3} \\ \cline{1 - 7}
z &=& 6250 \,&-&\, \frac{3}{4}x_{4} \,&-&\, \frac{65}{2}x_{3}
\end{alignat*}
Wie hier deutlich wird, ist $x_{1}^{*} = 25, x_{2}^{*} = 75$ eine optimale Lösung des primalen Problems.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 100, x_{4} = 4000 \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 0, x_{2} = 80, x_{3} = 20, x_{4} = 0 \text{ mit } z = 5600
\]
\underline{Zulässige Basislösung nach der 2. Iteration}:
\[
x_{1} = 25, x_{2} = 75, x_{3} = 0, x_{4} = 0 \text{ mit } z = 6250
\]
Durch Einsetzen von $y_{1}^{*} = 32.5$ und $y_{2}^{*} = 0.75$ in die Zielfunktion des dualen Problems ergibt sich folgendes:
\[
100 \cdot \frac{65}{2} + 4000 \cdot \frac{3}{4} = 3250 + 3000 = 6250
\]
Die beiden Zielfunktionswerte stimmen überein. Nach dem Dualitätssatz folgt daraus, dass $y_{1}^{*} = 32.5, y_{2}^{*} = 0.75$ tatsächlich eine optimale Lösung für das duale Problem darstellt.
\subsubsection{} %ii
Zum Überprüfen der vorgeschlagenen Lösung werden die Werte zunächst in die Ungleichungen des LP-Problems eingesetzt.
Erste Ungleichung:
\begin{alignat*}{2}
25 + 75 &\leq & 100 \\
100 &\leq & 100
\end{alignat*}
Zweite Ungleichung:
\begin{alignat*}{2}
10 \cdot 25 + 50 \cdot 75 &\leq & 4000 \\
4000 &\leq & 4000
\end{alignat*}
Da beide Ungleichungen mit Gleichheit erfüllt sind, lassen sich keine Rückschlüsse auf $y$-Werte ziehen. Da beide $x$-Werte größer als $0$ sind, müssen beide Ungleichungen im dualen Problem mit Gleichheit erfüllt sein.
\begin{alignat*}{2}
I \;& y_{1} + 10y_{2} &=& 40 \\
II \;& y_{1} + 50y_{2} &=& 70 \\
II - I \;& 40y_{2} &=& 30 \\
\;& y_{2} &=& \frac{3}{4} \\
\intertext{Einsetzen von $y_{2}$ in $I$}
I \;& y_{1} + 10 \cdot \frac{3}{4} &=& 40 \\
\;& y_{1} + \frac{15}{2} &=& 40 \\
\;& y_{1} &=& \frac{65}{2}
\end{alignat*}
Es ergeben sich somit die eindeutig bestimmten Zahlen $y_{1}^{*} = \frac{65}{2}, y_{2}^{*} = \frac{3}{4}$. Diese Zahlen erfüllen zusammen mit der vorgeschlagenen Lösung die komplementären Schlupfbedingungen.
Schließlich muss noch geprüft werden, ob diese Zahlen auch eine zulässige Lösung des dualen Problems sind. Dafür werden diese eingesetzt:
Erste Ungleichung:
\begin{alignat*}{2}
1 \cdot \frac{65}{2} + 10 \cdot \frac{3}{4} &\geq & 40 \\
40 &\geq & 40
\end{alignat*}
Zweite Ungleichung:
\begin{alignat*}{2}
1 \cdot \frac{65}{2} + 50 \cdot \frac{3}{4} &\geq & 70 \\
70 &\geq & 70
\end{alignat*}
Da alle zwei Ungleichungen mit den herausgefundenen Zahlen gültig sind, stellen die gefundenen Zahlen eine zulässige Lösung des dualen Problems dar.
\subsection{} %b
\underline{Starttableau}:
\begin{alignat*}{4}
x_{3} \,&=&\, 100 \,&-&\, x_{1} \,&-&\, x_{2} \\
x_{4} \,&=&\, 4000 + t \,&-&\, 10x_{1} \,&-&\, 50x_{2} \\ \cline{1 - 7}
z &=& &&\, 40x_{1} \,&+&\, 70x_{2}
\end{alignat*}
\underline{1. Iteration}:
\textbf{Es wird vorausgesetzt, dass $0 \leq t \leq 1000$ gilt.} Für $t=0$ gilt im Folgenden genau das Gleiche wie in 2a i). Für $t=1000$ kann eine der Ausgangsvariablen nach Belieben gewählt werden, da beide potentiellen Ausgangsvariablen $x_{2}$ gleichermaßen beschränken. Da in den meisten Fällen jedoch $t$ kleiner als $1000$ ist, wird $x_{4}$ als Ausgangsvariable gewählt.
Eingangsvariable: $x_{2}$\\
Ausgangsvariable: $x_{4}$
Es folgt
\begin{alignat*}{2}
50x_{2} \,&=&&\, 4000 + t - 10x_{1} - x_{4} \\
x_{2} \,&=&&\, 80 + \frac{1}{50}t - \frac{1}{5}x_{1} - \frac{1}{50}x_{4} \\
x_{3} \,&=&&\, 100 - x_{1} - \left(80 + \frac{1}{50}t - \frac{1}{5}x_{1} - \frac{1}{50}x_{4}\right) \\
&=&&\, 100 - x_{1} - 80 - \frac{1}{50}t + \frac{1}{5}x_{1} + \frac{1}{50}x_{4} \\
&=&&\, 20 - \frac{1}{50}t - \frac{4}{5}x_{1} + \frac{1}{50}x_{4} \\
z \,&=&&\, 40x_{1} + 70\left(80 + \frac{1}{50}t - \frac{1}{5}x_{1} - \frac{1}{50}x_{4}\right) \\
&=&&\, 40x_{1} + 5600 + \frac{7}{5}t - 14x_{1} - \frac{7}{5}x_{4} \\
&=&&\, 5600 + \frac{7}{5}t + 26x_{1} - \frac{7}{5}x_{4}
\end{alignat*}
\underline{Ergebnis der 1. Iteration}:
\begin{alignat*}{4}
x_{2} \,&=&\, 80 + \frac{1}{50}t \,&-&\, \frac{1}{5}x_{1} \,&-&\, \frac{1}{50}x_{4} \\
x_{3} \,&=&\, 20 - \frac{1}{50}t \,&-&\, \frac{4}{5}x_{1} \,&+&\, \frac{1}{50}x_{4} \\ \cline{1 - 7}
z &=& 5600 + \frac{7}{5}t \,&+&\, 26x_{1} \,&-&\, \frac{7}{5}x_{4}
\end{alignat*}
\underline{2. Iteration}:
\textbf{Es wird vorausgesetzt, dass $t \leq 1000$ gilt.} Könnte $t$ größer sein, dann würde die Möglichkeit bestehen, dass $x_{3}$ in der Basislösung nach der ersten Iteration einen negativen Wert hat.
Eingangsvariable: $x_{1}$\\
Ausgangsvariable: $x_{3}$
Es folgt
\begin{alignat*}{2}
\frac{4}{5}x_{1} \,&=&&\, 20 - \frac{1}{50}t + \frac{1}{50}x_{4} - x_{3} \\
x_{1} \,&=&&\, 25 - \frac{1}{40}t + \frac{1}{40}x_{4} - \frac{5}{4}x_{3} \\
x_{2} \,&=&&\, 80 + \frac{1}{50}t - \frac{1}{5}\left(25 - \frac{1}{40}t + \frac{1}{40}x_{4} - \frac{5}{4}x_{3}\right) - \frac{1}{50}x_{4} \\
&=&&\, 80 + \frac{1}{50}t - 5 + \frac{1}{200}t - \frac{1}{200}x_{4} - \frac{1}{4}x_{3} - \frac{1}{50}x_{4} \\
&=&&\, 75 + \frac{1}{40}t - \frac{1}{40}x_{4} - \frac{1}{4}x_{3} \\
z \,&=&&\, 5600 + \frac{7}{5}t + 26\left(25 - \frac{1}{40}t + \frac{1}{40}x_{4} - \frac{5}{4}x_{3}\right) - \frac{7}{5}x_{4} \\
&=&&\, 5600 + \frac{7}{5}t + 650 - \frac{13}{20}t + \frac{13}{20}x_{4} - \frac{65}{2}x_{3} - \frac{7}{5}x_{4} \\
&=&&\, 6250 + \frac{3}{4}t - \frac{3}{4}x_{4} - \frac{65}{2}x_{3}
\end{alignat*}
\underline{Ergebnis der 2. Iteration}:
\begin{alignat*}{4}
x_{1} \,&=&\, 25 - \frac{1}{40}t \,&-&\, \frac{1}{40}x_{4} \,&-&\, \frac{5}{4}x_{3} \\
x_{2} \,&=&\, 75 + \frac{1}{40}t \,&-&\, \frac{1}{40}x_{4} \,&-&\, \frac{1}{4}x_{3} \\ \cline{1 - 7}
z &=& 6250 + \frac{3}{4}t \,&-&\, \frac{3}{4}x_{4} \,&-&\, \frac{65}{2}x_{3}
\end{alignat*}
Wie hier deutlich wird, ist $x_{1}^{*} = 25, x_{2}^{*} = 75$ eine optimale Lösung des primalen Problems.
\underline{Startlösung ("`zulässige Basislösung am Anfang"')}:
\[
x_{1} = 0, x_{2} = 0, x_{3} = 100, x_{4} = 4000 + t \text{ mit } z = 0
\]
\underline{Zulässige Basislösung nach der 1. Iteration}:
\[
x_{1} = 0, x_{2} = 80 + \frac{1}{50}t, x_{3} = 20 - \frac{1}{50}t, x_{4} = 0 \text{ mit } z = 5600 + \frac{7}{5}t
\]
\underline{Zulässige Basislösung nach der 2. Iteration}:
\[
x_{1} = 25 - \frac{1}{40}t, x_{2} = 75 + \frac{1}{40}t, x_{3} = 0, x_{4} = 0 \text{ mit } z = 6250 + \frac{3}{4}t
\]
Wie im Folgenden zu sehen ist, entsprechen die Werte der optimalen Lösung den in (7.24) auf Skriptseite 67 angenommenen Werten.
\[
x_{1} = 25 - \frac{1}{40}t = 25 - \frac{25}{1000}t = 25 - 0.025t
\]
\[
x_{2} = 75 + \frac{1}{40}t = 75 + \frac{25}{1000}t = 75 + 0.025t
\]
Im Folgenden ist zu sehen, dass tatsächlich ein zusätzlicher Gewinn von $0.75t$ erzielt wird.
\[
z = 6250 + \frac{3}{4}t = 6250 + \frac{75}{100}t = 6250 + 0.75t
\]
\end{document}

85
prosem/Outline.tex Executable file
View File

@ -0,0 +1,85 @@
\documentclass[10pt,a4paper,oneside,english,numbers=noenddot,titlepage]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usetikzlibrary{matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
% ensures that paragraphs are separated by empty lines
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
% define how the sections are rendered
%\def\thesection{\arabic{section})}
%\def\thesubsection{\alph{subsection})}
%\def\thesubsubsection{(\roman{subsubsection})}
% some matrix magic
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\addto{\captionsenglish}{\renewcommand{\refname}{Bibliography}}
\begin{document}
\author{Jim Martens}
\title{Outline about ``With what methods can we understand natural language to build dialog systems?''}
%\title{Outline about "Mit welchen Methoden können wir natürliche Sprache verstehen um Dialogsysteme aufzubauen?"}
\maketitle
\section*{Abstract}
This is a placeholder for the abstract.
\tableofcontents
\clearpage
\section{Introduction}
\begin{itemize}
\item two kinds of natural language: spoken language and written language
\item will concentrate on written language
\item important method for written language: parsing
\item different approaches for the kind of grammar being used
\end{itemize}
\section{Evaluation of approaches}
\subsection{CYK, PCFG, lexicalized PCFG, DCG}
\begin{itemize}
\item presents the context-free approach explained by Norvig and Russel\cite{Russel2010}
\end{itemize}
\subsection{Link Grammar}
\begin{itemize}
\item presents an alternative to PCFGs; referencing Sleator here\cite{Sleator1993}
\end{itemize}
\subsection{Dependency grammar}
\begin{itemize}
\item presents dependency grammar here, referencing Paskin\cite{Paskin2001}
\end{itemize}
\subsection{Categorial grammar}
\begin{itemize}
\item presents categorial grammars, using Clark\cite{Clark2004} here
\end{itemize}
\section{Critical discussion}
\begin{itemize}
\item compares the presented grammar approaches with each other
\end{itemize}
\section{Conclusion}
\begin{itemize}
\item summarizes the results of the critical discussion
\item depending on the results: may give an advice which approach is more useful/easier etc.
\end{itemize}
\clearpage
\bibliography{prosem-ki}
\bibliographystyle{ieeetr}
\addcontentsline{toc}{section}{Bibliography}
\end{document}

286
prosem/VortragProsem.tex Normal file
View File

@ -0,0 +1,286 @@
\documentclass[14pt]{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Meta informations:
\newcommand{\trauthor}{Horst Hansen}
\newcommand{\trtype}{} %{Proseminar} %{Seminar} %{Workshop}
\newcommand{\trcourse}{Knowledge Processing with Neural Networks}
\newcommand{\trtitle}{Neural Networks for Artificial Agents}
\newcommand{\trmatrikelnummer}{6543210}
\newcommand{\tremail}{hansen@informatik.uni-hamburg.de}
\newcommand{\trinstitute}{Dept. Informatik -- Knowledge Technology, WTM}
\newcommand{\trwebsiteordate}{{http://www.informatik.uni-hamburg.de/WTM/}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Languages:
% Falls die Ausarbeitung in Deutsch erfolgt:
% \usepackage[german]{babel}
% \usepackage[T1]{fontenc}
% \usepackage[latin1]{inputenc}
% \usepackage[latin9]{inputenc}
% \selectlanguage{german}
% If the thesis is written in English:
\usepackage[english]{babel}
\selectlanguage{english}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bind packages:
\usepackage{beamerthemesplit}
\usetheme{Boadilla}
%\usetheme{Copenhagen}
%\usetheme{Darmstadt}
%\usetheme{Frankfurt}
%\usetheme{Ilmenau}
%\usetheme{JuanLesPins}
%\usetheme{Madrid}
%\usetheme{Warsaw }
%\usecolortheme{dolphin}
%\setbeamertemplate{sections/subsections in toc}[sections numbered]
%\beamertemplatenavigationsymbolsempty
%\setbeamertemplate{headline}[default] % deaktiviert die Kopfzeile
\setbeamertemplate{navigation symbols}{}% deaktiviert Navigationssymbole
%\useinnertheme{rounded}
\usepackage{acronym} % Acronyms
\usepackage{algorithmic} % Algorithms and Pseudocode
\usepackage{algorithm} % Algorithms and Pseudocode
\usepackage{amsfonts} % AMS Math Packet (Fonts)
\usepackage{amsmath} % AMS Math Packet
\usepackage{amssymb} % Additional mathematical symbols
\usepackage{amsthm}
\usepackage{color} % Enables defining of colors via \definecolor
\usepackage{fancybox} % Gleichungen einrahmen
\usepackage{fancyhdr} % Paket zur schickeren der Gestaltung der
\usepackage{graphicx} % Inclusion of graphics
%\usepackage{latexsym} % Special symbols
\usepackage{longtable} % Allow tables over several parges
\usepackage{listings} % Nicer source code listings
\usepackage{lmodern}
\usepackage{multicol} % Content of a table over several columns
\usepackage{multirow} % Content of a table over several rows
\usepackage{rotating} % Alows to rotate text and objects
\usepackage[section]{placeins} % Ermoeglich \Floatbarrier fuer Gleitobj.
\usepackage[hang]{subfigure} % Allows to use multiple (partial) figures in a fig
%\usepackage[font=footnotesize,labelfont=rm]{subfig} % Pictures in a floating environment
\usepackage{tabularx} % Tables with fixed width but variable rows
\usepackage{url,xspace,boxedminipage} % Accurate display of URLs
\definecolor{uhhRed}{RGB}{254,0,0} % Official Uni Hamburg Red
\definecolor{uhhGrey}{RGB}{136,136,136} % Official Uni Hamburg Grey
\definecolor{uhhLightGrey}{RGB}{180,180,180} % Official Uni Hamburg LightGrey
\definecolor{uhhLightLightGrey}{RGB}{220,220,220} % Official Uni Hamburg LightLightGrey
\setbeamertemplate{itemize items}[ball]
\setbeamercolor{title}{fg=uhhRed,bg=white}
\setbeamercolor{title in head/foot}{bg=uhhRed}
\setbeamercolor{block title}{bg=uhhGrey,fg=white}
\setbeamercolor{block body}{bg=uhhLightLightGrey,fg=black}
\setbeamercolor{section in head/foot}{bg=black}
\setbeamercolor{frametitle}{bg=white,fg=uhhRed}
\setbeamercolor{author in head/foot}{bg=black,fg=white}
\setbeamercolor{author in footline}{bg=white,fg=black}
\setbeamercolor*{item}{fg=uhhRed}
\setbeamercolor*{section in toc}{fg=black}
\setbeamercolor*{separation line}{bg=black}
\setbeamerfont*{author in footline}{size=\scriptsize,series=\mdseries}
\setbeamerfont*{institute}{size=\footnotesize}
\newcommand{\opticalseperator}{0.0025\paperwidth}
\institute{Universit\"at Hamburg\\\trinstitute}
\title{\trtitle}
\subtitle{\trtype}
\author{\trauthor}
\date{}
\logo{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Configurationen:
%\hypersetup{pdfpagemode=FullScreen}
\hyphenation{whe-ther} % Manually use: "\-" in a word: Staats\-ver\-trag
%\lstloadlanguages{C} % Set the default language for listings
\DeclareGraphicsExtensions{.pdf,.svg,.jpg,.png,.eps} % first try pdf, then eps, png and jpg
\graphicspath{{./src/}} % Path to a folder where all pictures are located
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Costom Definitions:
\setbeamertemplate{title page}
{
\vbox{}
\vspace{0.4cm}
\begin{centering}
\begin{beamercolorbox}[sep=8pt,center,colsep=-4bp]{title}
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.20em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip0.4em
\begin{beamercolorbox}[sep=8pt,center,colsep=-4bp,rounded=true,shadow=true]{author}
\usebeamerfont{author}\insertauthor \\ \insertinstitute
\end{beamercolorbox}
\vfill
\begin{beamercolorbox}[ht=8ex,center]{}
\includegraphics[width=0.20\paperwidth]{wtmIcon.pdf}
\end{beamercolorbox}%
\begin{beamercolorbox}[sep=8pt,center,colsep=-4bp,rounded=true,shadow=true]{institute}
\usebeamerfont{institute}\trwebsiteordate
\end{beamercolorbox}
\vspace{-0.1cm}
\end{centering}
}
\setbeamertemplate{frametitle}
{
\begin{beamercolorbox}[wd=\paperwidth,ht=3.8ex,dp=1.2ex,leftskip=0pt,rightskip=4.0ex]{frametitle}%
\usebeamerfont*{frametitle}\centerline{\insertframetitle}
\end{beamercolorbox}
\vspace{0.0cm}
}
\setbeamertemplate{footline}
{
\leavevmode
\vspace{-0.05cm}
\hbox{
\begin{beamercolorbox}[wd=.32\paperwidth,ht=4.8ex,dp=2.7ex,center]{author in footline}
\hspace*{2ex}\usebeamerfont*{author in footline}\trauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.60\paperwidth,ht=4.8ex,dp=2.7ex,center]{author in footline}
\usebeamerfont*{author in footline}\trtitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.07\paperwidth,ht=4.8ex,dp=2.7ex,center]{author in footline}
\usebeamerfont*{author in footline}\insertframenumber{}
\end{beamercolorbox}
}
\vspace{0.15cm}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Additional 'theorem' and 'definition' blocks:
\newtheorem{axiom}{Axiom}[section]
%\newtheorem{axiom}{Fakt}[section] % Wenn in Deutsch geschrieben wird.
%Usage:%\begin{axiom}[optional description]%Main part%\end{fakt}
%Additional types of axioms:
\newtheorem{observation}[axiom]{Observation}
%Additional types of definitions:
\theoremstyle{remark}
%\newtheorem{remark}[section]{Bemerkung} % Wenn in Deutsch geschrieben wird.
\newtheorem{remark}[section]{Remark}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Provides TODOs within the margin:
\newcommand{\TODO}[1]{\marginpar{\emph{\small{{\bf TODO: } #1}}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Abbreviations and mathematical symbols
\newcommand{\modd}{\text{ mod }}
\newcommand{\RS}{\mathbb{R}}
\newcommand{\NS}{\mathbb{N}}
\newcommand{\ZS}{\mathbb{Z}}
\newcommand{\dnormal}{\mathit{N}}
\newcommand{\duniform}{\mathit{U}}
\newcommand{\erdos}{Erd\H{o}s}
\newcommand{\renyi}{-R\'{e}nyi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Display of TOCs:
\AtBeginSection[]
{
\setcounter{tocdepth}{2}
\frame
{
\frametitle{Outline}
\tableofcontents[currentsection]
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Document:
\begin{document}
\renewcommand{\arraystretch}{1.2}
\begin{frame}[plain] % plain => kein Rahmen
\titlepage
\end{frame}
%\setcounter{framenumber}{0}
\frame{
\frametitle{Outline}
\tableofcontents
}
%%%%%%%%%%%%%%
% Your Content
\section{Motivation and Question}
\frame[t]{
\frametitle{Motivation}
\begin{itemize}
\item Add your motivation here
\begin{itemize}
\item Maybe with some details
\begin{itemize}
\item but not too much
\end{itemize}
\end{itemize}
\item Use references \textsuperscript{[Author, 2010]}
\end{itemize}
}
\section{Basics and Definition}
\section{Approach}
\section{Results}
\section{Conclusion}
\frame[t]
{
\frametitle{Conclusion}
Novelty and contribution of this work:
\begin{itemize}
\item Sum up the approach
\item Sum op the results
\item ...
\item Show that it solves the question
\end{itemize}
\mbox{ }
Open Questions:
\begin{itemize}
\item Something
\item ... is always missing
\end{itemize}
}
%%%%%%%%%%%%%%
\frame[c]{
\frametitle{The End}
\begin{center}
Thank you for your attention.\\[1ex]
Any question?\\[5ex]
\end{center}
\footnotesize
Literature:
\begin{itemize}
\item Author , Author , Author, and Author. Name of the conference paper. \emph{In: Proceedings of the Conference Name}, 2008
\item Author, Author, and Author. Name of the Article. \emph{Name of the Journal}, 42:111-133, 2010
\item Author, and Author. \emph{Name of the Book}. Publisher, 2009
\end{itemize}
}
\end{document}

422
prosem/prosem-ki.bib Executable file
View File

@ -0,0 +1,422 @@
% This file was created with JabRef 2.9b2.
% Encoding: Cp1252
@INPROCEEDINGS{Brin1998,
author = {Brin, Sergey and Page, Lawrence},
title = {The Anatomy of a Large-Scale Hypertextual Web Search Engine},
booktitle = {Seventh World Wide Web Conference},
year = {1998},
keywords = {World Wide Web, Search Engines, Information Retrieval, PageRank, Google},
owner = {jim},
quality = {1},
timestamp = {2013.10.29}
}
@CONFERENCE{Clark2004,
author = {Clark, Stephen and Curran, James R.},
title = {Parsing the {WSJ} using {CCG} and Log-Linear Models},
booktitle = {Proceedings of the 42nd Annual Meeting of the Association for Computational
Linguistics},
year = {2004},
pages = {104-111},
owner = {jim},
quality = {1},
timestamp = {2013.10.29}
}
@INBOOK{Jurafsky2009,
chapter = {18},
pages = {617--644},
title = {Speech and Language Processing},
publisher = {Pearson},
year = {2009},
author = {Jurafsky, Daniel and Martin, James H.},
series = {Prentice-Hall series in artificial intelligence},
edition = {Second},
abstract = {Sentences get their meanings from the words they contain and the syntactic
order of the words. Therefore the meaning of a sentence is partially
based on the words and its syntactic structure. The composition of
meaning representation is guided by the syntactic components and
relations provided by grammars such as CFGs.
A meaning representation is generated by first sending the input through
a parser which results in the syntactic analysis and second passing
this analysis as input to a semantic analyzer.
In the syntax-driven semantic analysis it is assumed that syntactic,
lexical and anaphoric ambiguities are not a problem.
The semantic meanings are attached to the grammar rules and lexical
entries from which trees are generated in the first place. This is
called rule-to-rule hypothesis.
The semantic attachments are written in braces after the syntactic
rules themselves.
After the syntactic analysis has been created, every word receives
a FOL predicate and/or term. The semantic analyzer goes the tree
up until the complete FOL term has been created. On the way lambda
reduction is used to replace predicates and terms with their proper
meanings, received from other parts of the tree.},
booktitle = {Speech and Language Processing},
owner = {jim},
quality = {1},
timestamp = {2013.11.16}
}
@INBOOK{Jurafsky2009a,
chapter = {17},
pages = {579--616},
title = {Speech and Language Processing},
publisher = {Pearson},
year = {2009},
author = {Jurafsky, Daniel and Martin, James H.},
series = {Prentice-Hall series in artificial intelligence},
edition = {Second},
abstract = {Lambda notation is used to bind variables dynamically to later appearing
contents.
lambda x P(x)(y) results in P(y) after a lambda reduction as x has
been bound to y.
lambda P P(x)(lambda x Restaurant(x)) results in lambda x Restaurant(x)(x)
which results in Restaurant(x)},
booktitle = {Speech and Language Processing},
owner = {jim},
quality = {1},
timestamp = {2013.11.16}
}
@INBOOK{Jurafsky2009b,
chapter = {13},
pages = {461--492},
title = {Speech and Language Processing},
publisher = {Pearson},
year = {2009},
author = {Jurafsky, Daniel and Martin, James H.},
series = {Prentice-Hall series in artificial intelligence},
edition = {Second},
owner = {jim},
quality = {1},
timestamp = {2013.11.17}
}
@CONFERENCE{Kessler1997,
author = {Kessler, Brett and Nunberg, Geoffrey and Schuetze, Hinrich},
title = {Automatic Detection of Text Genre},
booktitle = {Proceedings of the 35th Annual Meeting of the Association for Computational
Linguistics},
year = {1997},
pages = {32-38},
owner = {jim},
quality = {1},
timestamp = {2013.10.29}
}
@CONFERENCE{Klein2003,
author = {Klein, Dan and Smarr, Joseph and Nguyen, Huy and Manning, Christopher
D.},
title = {Named Entity Recognition with Character-Level Models},
booktitle = {Conference on Natural Learning (CoNLL)},
year = {2003},
pages = {180-183},
owner = {jim},
quality = {1},
timestamp = {2013.10.29}
}
@TECHREPORT{Paskin2001,
author = {Paskin, Mark A.},
title = {Cubic-time Parsing and Learning Algorithms for Grammatical Bigram
Models},
institution = {University of California},
year = {2001},
number = {UCB/CSD-01-1148},
month = {June},
abstract = {In Dependency Grammar there are head words and dependents. Each phrase
has only one head word. The head word determines how all of its dependents
may be syntactically combined with other words to form a sentence.
A head word and all of its dependents form a constituent. In every
sentence there may be one or more dependency relationships with one
head word each.
Dependents that precede their head are called predependents and dependents
that follow their head are called postdependents.
A dependency parse consists of a set of dependency relationships that
satisfies three constraints: 1. Every word except one (the root)
is dependent to exactly one head. 2. The dependency relationships
are acyclic; no word is, through a sequence of dependency relationships,
dependent to itself. 3. When drawn as a graph above the sentence,
no two dependency relations cross - a property known as projectivity
or planarity.
The Grammatical Bigram Probability Model assumes that all the dependents
of a head word are independent of one another and their relative
order. This is a strong approximation as in full English there are
argument structure constraints that rely on the order of dependents.
This simplification allows for a reduced computational complexity
for parsing and learning. The grammar model falls into the class
of "Bilexical grammars".
A dependency parse consists of multiple spans. A span has at least
two words up to n words. Spans have one property: No word in the
span has a parent outside the span. Spans can be joined and closed.
To join the span one of them has to be connected (both end words
are connected with an edge) and both spans have to share one endword.
The new span will be connected if both subspans were connected. If
that is not the case, it can be closed by adding an edge between
the endwords of the new span.
Every dependency parse has a unique span decomposition. For joining
the left subspan has be simple. That means it has to have an edge
between its endwords or consist of two words only. Relying on this
ensures that each span is derived only once.
Every span has a signature. This signature states the indexes of its
endwords, if it is simple and whether the left or right endword have
parents within the span. Spans where both the left and right endword
have the parent within the string are called toplevel signatures
as such signatures characterize valid parses.
Parser operations take signatures as input rather than spans. They
produce signatures as well. SEED creates an unconnected and simple
span with two adjacent words. CLOSE-LEFT adds an edge between the
endwords and makes the left endword the parent of the right one.
CLOSE-RIGHT does the opposite and makes the right endword the parent
of the left one. These operators require that neither the left nor
the right endword have a parent within the span.
JOIN takes two input spans and joins them. It requires that the spans
share an endword (1.), the shared endword has one parent (2.) and
the left input is simple (3.). The JOIN rule applies only if the
left span doesn't start the sentence.
These operators constitute an algebra over span signatures called
span signature algebra. A derivation D is an expression in this algebra.
Like operations it evaluates to span signatures. These expressions
can be represented as trees where the nodes are operations. There
is an isomorphism between dependency parses and their corresponding
derivations.
Optimal derivation must consist of an operation over the results of
optimal sub-derivations. Therefore it is enough to record the parse
operation with the most likely derivation of a given signature in
order to reconstruct the most likely derivation of the entire sentence.
The chart-parse algorithm returns the optimal parse. It uses a subprocedure
called EXTRACT-OPT-PARSE that constructs the optimal parse by finding
the top-level signature (sigma) with maximum optimal probability
(pi*). It backtracks then recursively through the optimal derivation
defined by (omega*). If CLOSE operations are encountered edges are
recorded in the parse. The algorithm requires O(n<>) time and O(n<>)
space.},
owner = {jim},
quality = {1},
timestamp = {2013.10.29}
}
@INBOOK{Russel2010,
chapter = {23},
pages = {888--927},
title = {Artificial intelligence: A Modern Approach},
publisher = {Pearson},
year = {2009},
author = {Russel, Stuart J. and Norvig, Peter},
series = {Prentice-Hall series in artificial intelligence},
edition = {Third},
abstract = {The first method to understanding natural language is syntactic analysis
or parsing. The goal is to find the phrase structure of a sequence
of words according to the rules of the applied grammar.
A strict top-to-bottom or bottom-to-top parsing can be inefficient.
Given two sentences with the same first 10 words and a difference
only from the 11th word on, parsing from left-to-right would force
the parser to make a guess about the nature of the sentence. But
it doesn't know if it's right until the 11th word. From there it
had to backtrack and reanalyze the sentence.
To prevent that dynamic programming is used. Every analyzed substring
gets stored for later. Once it is discovered that for example "the
students in section 2 of Computer Science 101" is a noun phrase,
this information can be stored in a structure known as chart. Algorithms
that do such storing are called chart parsers. One of this chart
parsers is a bottom-up version called CYK algorithm after its inventors
John Cocke, Daniel Younger and Tadeo Kasami. This algorithm requires
a grammar in the Chomsky Normal Form. The algorithm takes O(n<>m)
space for the P table with n being the number of words in the sentence
and m the number of nonterminal symbols in the grammar. It takes
O(n<>m) time whereas m is constant for a particular grammar. That's
why it is commonly described as O(n<>). There is no faster algorithm
for general context-free grammars.
The CYK algorithm only co mputes the probability of the most probable
tree. The subtrees are all represented in P table.
PCFGs (Probabilistic context free grammars) have many rules with a
probability for each one of them. Learning the grammar from data
is better than a knowledge engineering approach. Learning is easiest
if we are given a corpus of correctly parsed sentences; commonly
known as a treebank. The best known treebank is the Penn Treebank
as it consists of 3 million words which have been annotated with
part of speech and parse-tree structure. Given an amount of trees,
a PCFG can be created just by counting and smoothing.
If no treebank is given it is still possible to learn the grammar
but it is more difficult. In such a case there are actually two problems:
First learning the structure of the grammar rules and second learning
the probabilities associated with them.
PCFGs have the problem that they are context-free. Combining a PCFG
and Markov model will get the best of both. This leads ultimately
to lexicalized PCFGs. But another problem of PCFGs is there preference
for short sentences.
Lexicalized PCFGs introduce so called head words. Such words are the
most important words in a phrase and the probabilities are calculated
between the head words. Example: "eat a banana" "eat" is the head
of the verb phrase "eat a banana", whereas "banana" is the head of
the noun phrase "a banana". Probability P1 now depends on "eat" and
"banana" and the result would be very high. If the head of the noun
phrase were "bandanna", the result would be significantly lower.
The next step are definite clause grammars. They can be used to parse
in a way of logical inference and makes it possible to reason about
languages and strings in many different ways. Furthermore augmentations
allow for distinctions in a single subphrase. For example the noun
phrase (NP) depends on the subject case and the person and number
of persons. A real world example would be "to smell". It is "I smell",
"you smell", "we smell", "you smell" and "they smell" but "he/she/it
smells". It depends on the person what version is taken.
Semantic interpretation is used to give sentences a meaning. This
is achieved through logical sentences. The semantics can be added
to an already augmented grammar (created during the previous step),
resulting in multiple augmentations at the same time. Chill is an
inductive logic programming program that can learn to achieve 70%
to 85% accuracy on various database query tasks.
But there are several complications as English is endlessly complex.
First there is the time at which things happened (present, past,
future). Second you have the so called speech act which is the speaker's
action that has to be deciphered by the hearer. The hearer has to
find out what type of action it is (a statement, a question, an order,
a warning, a promise and so on). Then there are so called long-distance
dependencies and ambiguity. The ambiguity can reach from lexical
ambiguity where a word has multiple usages, over syntactic ambiguity
where a sentence has multiple parses up to semantic ambiguity where
the meaning of and the same sentence can be different. Last there
is ambiguity between literal meaning and figurative meanings.
Finally there are four models that need to be combined to do disambiguation
properly: the world model, the mental model, the language model and
the acoustic model.
-- not so much an abstract of the specific content of that section
as an abstract about speech recognition in general --
The second method is speech recognition. It has the added difficulty
that the words are not clearly separated and every speaker can pronounce
the same sentence with the same meaning different. An example is
"The train is approaching". Another written form would be "The train's
approaching". Both convey the same meaning in the written language.
But if a BBC, a CNN and a german news anchor speeks this sentence
it will sound dramatically different. Speech recognition has to deal
with that problem to get the written text associated with the spoken
words. From the text the first method can than be used to analyze
the words and find a meaning. Finally this meaning can be used to
create some kind of action in a dialog system.
--
Some problems of speech recognition are segmentation, coarticulation
and homophones. Two used models are the acoustic model and the language
model. Another major model is the noisy channel model, named after
Claude Shannon (1948). He showed that the original message can always
be recovered in a noisy channel if the original message is encoded
in a redundant enough way.
The acoustic model in particular is used to get to the really interesting
parts. It is not interesting how words were spoken but more what
words where spoken. That means that not all available information
needs to be stored and a relative low sample rate is enough. 80 samples
at 8kHz with a frame length of about 10 milliseconds is enough for
that matter. To distinguish words so called phones are used. There
are 49 phones used in English. A phoneme is the smallest unit of
sound that has a distinct meaning to speakers of a particular language.
Back to the frames: every frame is summarized by a vector of features.
Features are important aspects of a speech signal. It can be compared
to listening to an orchestra and saying "here the French horns are
playing loudly and the violins are playing softly". Yet another difficulty
are dialect variations.
The language model should be learned from a corpus of transcripts
of spoken language. But such a thing is more difficult than building
an n-gram model of text, because it requires a hidden Markov model.
All in all speech recognition is most effective when used for a specific
task against a restricted set of options. A general purpose system
can only work accurately if it creates one model for every speaker.
Prominent examples like Apple's siri are therefore not very accurate.},
bookauthor = {Russel, Stuart J. and Norvig, Peter},
booktitle = {Artificial intelligence: A Modern Approach},
date = {December 11},
owner = {jim},
timestamp = {2013.10.24}
}
@INPROCEEDINGS{Sleator1993,
author = {Sleator, Daniel D. K. and Temperley, Davy},
title = {Parsing English with a Link Grammar},
booktitle = {Third Annual Workshop on Parsing technologies},
year = {1993},
owner = {jim},
quality = {1},
timestamp = {2013.10.29}
}
@CONFERENCE{Smith2008,
author = {Smith, David A. and Eisner, Jason},
title = {Dependency Parsing by Belief Propagation},
booktitle = {Conference on Empirical Methods in Natural Language Processing},
year = {2008},
pages = {145-156},
date = {October 25 - October 27},
owner = {jim},
quality = {1},
timestamp = {2013.10.29}
}

326
prosem/prosempaper.tex Executable file
View File

@ -0,0 +1,326 @@
\documentclass[12pt,twoside]{scrartcl}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Meta informations:
\newcommand{\trauthor}{Jim Martens}
\newcommand{\trtype}{Proseminar Paper} %{Seminararbeit} %{Proseminararbeit}
\newcommand{\trcourse}{Proseminar Artificial Intelligence}
\newcommand{\trtitle}{Methods for understanding natural language}
\newcommand{\trmatrikelnummer}{6420323}
\newcommand{\tremail}{2martens@informatik.uni-hamburg.de}
\newcommand{\trarbeitsbereich}{Knowledge Technology, WTM}
\newcommand{\trdate}{10.02.2014}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Languages:
% Falls die Ausarbeitung in Deutsch erfolgt:
% \usepackage[german]{babel}
% \usepackage[T1]{fontenc}
% \usepackage[latin1]{inputenc}
% \usepackage[latin9]{inputenc}
% \selectlanguage{german}
% If the thesis is written in English:
\usepackage[english]{babel}
\selectlanguage{english}
\addto{\captionsenglish}{\renewcommand{\refname}{Bibliography}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bind packages:
\usepackage{acronym} % Acronyms
\usepackage{algorithmic} % Algorithms and Pseudocode
\usepackage{algorithm} % Algorithms and Pseudocode
\usepackage{amsfonts} % AMS Math Packet (Fonts)
\usepackage{amsmath} % AMS Math Packet
\usepackage{amssymb} % Additional mathematical symbols
\usepackage{amsthm}
\usepackage{booktabs} % Nicer tables
%\usepackage[font=small,labelfont=bf]{caption} % Numbered captions for figures
\usepackage{color} % Enables defining of colors via \definecolor
\definecolor{uhhRed}{RGB}{254,0,0} % Official Uni Hamburg Red
\definecolor{uhhGrey}{RGB}{122,122,120} % Official Uni Hamburg Grey
\usepackage{fancybox} % Gleichungen einrahmen
\usepackage{fancyhdr} % Packet for nicer headers
%\usepackage{fancyheadings} % Nicer numbering of headlines
%\usepackage[outer=3.35cm]{geometry} % Type area (size, margins...) !!!Release version
%\usepackage[outer=2.5cm]{geometry} % Type area (size, margins...) !!!Print version
%\usepackage{geometry} % Type area (size, margins...) !!!Proofread version
\usepackage[outer=3.15cm]{geometry} % Type area (size, margins...) !!!Draft version
\geometry{a4paper,body={5.8in,9in}}
\usepackage{graphicx} % Inclusion of graphics
%\usepackage{latexsym} % Special symbols
\usepackage{longtable} % Allow tables over several parges
\usepackage{listings} % Nicer source code listings
\usepackage{multicol} % Content of a table over several columns
\usepackage{multirow} % Content of a table over several rows
\usepackage{rotating} % Alows to rotate text and objects
\usepackage[hang]{subfigure} % Allows to use multiple (partial) figures in a fig
%\usepackage[font=footnotesize,labelfont=rm]{subfig} % Pictures in a floating environment
\usepackage{tabularx} % Tables with fixed width but variable rows
\usepackage{url,xspace,boxedminipage} % Accurate display of URLs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Configurationen:
\hyphenation{whe-ther} % Manually use: "\-" in a word: Staats\-ver\-trag
\hyphenation{spe-ci-fies}
\hyphenation{spe-ci-fi-ca-tion}
%\lstloadlanguages{C} % Set the default language for listings
\DeclareGraphicsExtensions{.pdf,.svg,.jpg,.png,.eps} % first try pdf, then eps, png and jpg
\graphicspath{{./src/}} % Path to a folder where all pictures are located
\pagestyle{fancy} % Use nicer header and footer
% Redefine the environments for floating objects:
\setcounter{topnumber}{3}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4}
\renewcommand{\topfraction}{0.9} %Standard: 0.7
\renewcommand{\bottomfraction}{0.5} %Standard: 0.3
\renewcommand{\textfraction}{0.1} %Standard: 0.2
\renewcommand{\floatpagefraction}{0.8} %Standard: 0.5
% Tables with a nicer padding:
\renewcommand{\arraystretch}{1.2}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Additional 'theorem' and 'definition' blocks:
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
%\newtheorem{theorem}{Satz}[section] % Wenn in Deutsch geschrieben wird.
\newtheorem{axiom}{Axiom}[section]
%\newtheorem{axiom}{Fakt}[chapter] % Wenn in Deutsch geschrieben wird.
%Usage:%\begin{axiom}[optional description]%Main part%\end{fakt}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
%Additional types of axioms:
\newtheorem{lemma}[axiom]{Lemma}
\newtheorem{observation}[axiom]{Observation}
%Additional types of definitions:
\theoremstyle{remark}
%\newtheorem{remark}[definition]{Bemerkung} % Wenn in Deutsch geschrieben wird.
\newtheorem{remark}[definition]{Remark}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Provides TODOs within the margin:
\newcommand{\TODO}[1]{\marginpar{\emph{\small{{\bf TODO: } #1}}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Abbreviations and mathematical symbols
\newcommand{\modd}{\text{ mod }}
\newcommand{\RS}{\mathbb{R}}
\newcommand{\NS}{\mathbb{N}}
\newcommand{\ZS}{\mathbb{Z}}
\newcommand{\dnormal}{\mathit{N}}
\newcommand{\duniform}{\mathit{U}}
\newcommand{\erdos}{Erd\H{o}s}
\newcommand{\renyi}{-R\'{e}nyi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Document:
\begin{document}
\renewcommand{\headheight}{14.5pt}
\fancyhead{}
\fancyhead[LE]{ \slshape \trauthor}
\fancyhead[LO]{}
\fancyhead[RE]{}
\fancyhead[RO]{ \slshape \trtitle}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Cover Header:
\begin{titlepage}
\begin{flushleft}
Universit\"at Hamburg\\
Department Informatik\\
\trarbeitsbereich\\
\end{flushleft}
\vspace{3.5cm}
\begin{center}
\huge \trtitle\\
\end{center}
\vspace{3.5cm}
\begin{center}
\normalsize\trtype\\
[0.2cm]
\Large\trcourse\\
[1.5cm]
\Large \trauthor\\
[0.2cm]
\normalsize Matr.Nr. \trmatrikelnummer\\
[0.2cm]
\normalsize\tremail\\
[1.5cm]
\Large \trdate
\end{center}
\vfill
\end{titlepage}
%backsite of cover sheet is empty!
\thispagestyle{empty}
\hspace{1cm}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Abstract:
% Abstract gives a brief summary of the main points of a paper:
\section*{Abstract}
Syntactic parsing and semantic analysis are two important methods for understanding natural language. Each of them has their individual strengths and weaknesses. But both of them have major issues with ambiguity once a restricted environment is left. Understanding unrestricted natural language is therefore far from being reached.
% Lists:
\setcounter{tocdepth}{2} % depth of the table of contents (for Seminars 2 is recommented)
\tableofcontents
\pagenumbering{arabic}
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Content:
% the actual content, usually separated over a number of sections
% each section is assigned a label, in order to be able to put a
% crossreference to it
\section{Introduction}
\label{sec:introduction}
It's the dream of many Science-Fiction fans: A fully sentient AI. Let's ignore for a moment all the odds that are against it (morality, physics, etc.) and concentrate on one aspect that is mandatory for even much less ambitious dreams. Imagine a computer game in which you can talk natural language to the NPC counterparts so that they react appropriately to it. Well maybe that is still too ambitious. What about writing what you want to say? In that case the computer needs to understand what you are writing so that it can react to it.
This process of understanding natural language contains multiple methods. The first one is the syntactic parsing, the second one the semantic analysis. Syntactic parsing relies on a grammar that describes the set of possible input, also called syntax. The syntax specifies what are allowed sentence structures and how these are built.
The semantic analysis relies on the semantics of a given input. That means what the given input means. An example: ``You run around the bush''. The semantic meaning of this sentence is that you are running around a bush. The pragmatics define what is the intended meaning of an input. In this example it's not that you run around the bush but actually that you take a long time to get to the point in a discussion. It's a so called idiom. This difference between semantic meaning, where just the sentence as it is written is considered, and pragmatic meaning, where the intended meaning is considered, generates ambiguity that is easy for humans to resolve but difficult for computers. But even the pragmatics in this example are ambigious, because it depends on the context what it actually means. If two persons are walking around in a forest and one starts running around the bush, the sentence of this example, would have the semantic meaning as it's pragmatic meaning.
On top of that the semantic meaning itself isn't always clear either. Sometimes words have multiple meanings, so that even the semantic meaning can have different possible interpretations.
In this paper both syntactic parsing and semantic analysis are presented. After the presentation of the methods, they are critically discussed to finally come to a conclusion.
\section{Evaluation of methods}
\label{sec:evalMethods}
\subsection{Syntactic Parsing}
\label{subSec:syntacticParsing}
Syntactic Parsing is used to create parse trees. These can be used for grammar checks in a text editor: ``A sentence that cannot be parsed may have grammatical errors''\cite[p.~461]{Jurafsky2009b}. But they more likely ``serve as an important intermediate stage of representation for semantic analysis''\cite[p.~461]{Jurafsky2009b}. There are different algorithms available to create such trees. The CYK\footnote{named after inventors John Cocke, Daniel Younger and Tadeo Kasami} algorithm will be explained further. But before the CYK algorithm is explained, the reason for its existance is presented.
There are two classical ways of parsing a sentence. The one is bottom-up and the other one is top-down. Both approaches have their own advantages and disadvantages. In addition the ambiguity creates problems. To implement bottom-up and top-down search algorithms in the face of ambiguity, ``an agenda-based backtracking strategy''\cite[p.~468]{Jurafsky2009b} is used. The problem here is that every time the parser recognizes that the current parse tree is wrong, it has to backtrack and explore other parts of the sentence. This creates a huge amount of work duplication and is therefore inefficient.
A solution to these problems is offered by ``dynamic programming parsing methods''\cite[p.~469]{Jurafsky2009b}. The CYK algorithm is one of multiple algorithms based on dynamic programming.
The CYK does only work with grammars in the Chomsky Normal Form (CNF). Every context-free grammar can be converted to CNF without loss in expressiveness. Therefore this restriction does no harm but simplifies the parsing. For information on how context-free grammars can be converted to CNF, refer to Jurafsky\cite{Jurafsky2009b}.
CYK requires $\mathcal{O}(n^{2}m)$ space for the $P$ table (a table with probabilities), where ``$m$ is the number of nonterminal symbols in the grammar''\cite[p.~893]{Russel2010}, and uses $\mathcal{O}(n^{3}m)$ time. ``$m$ is constant for a particular grammar, [so it] is commonly described as $\mathcal{O}(n^{3})$''\cite[p.~893]{Russel2010}. There is no algorithm that is better than CYK for general context-free grammars\cite{Russel2010}.
But how does CYK work? CYK doesn't examine all parse trees. It just examines the most probable one and computes the probability of that tree. All the other parse trees are present in the $P$ table and could be enumerated with a little work (in exponential time). But the strength and beauty of CYK is, that they don't have to be enumerated. CYK defines ``the complete state space defined by the `apply grammar rule' operator''\cite[p.~894]{Russel2010}. You can search just a part of this space with $A^{*}$ search.\cite{Russel2010} ``With the $A^{*}$ algorithm [...] the first parse found will be the most probable''\cite[p.~895]{Russel2010}.
But these probabilities need to be learned from somewhere. This somewhere is usually a ``treebank''\cite[p.~895]{Russel2010}, which contains a corpus of correctly parsed sentences. The best known is the Penn Treebank\cite{Russel2010}, which ``consists of 3 million words which have been annotated with part of speech and parse-tree structure, using human labor assisted by some automated tools''\cite[p.~895]{Russel2010}. The probabilities are then computed by counting and smoothing in the given data.\cite{Russel2010} There are other ways to learn the probabilities that are more difficult. For more information refer to Russel\cite{Russel2010}.
\subsection{Semantic Analysis}
\label{subSec:semanticAnalysis}
Semantic analysis provides multiple approaches. In this paper the approach of ``syntax-driven semantic analysis''\cite[p.~617]{Jurafsky2009} is explained further. In this approach the output of a parser, the syntactic analysis, ``is passed as input to a semantic analyzer to produce a meaning representation''\cite[p.~618]{Jurafsky2009}.
Therefore context-free grammar rules are augmented with ``semantic attachments''\cite[p.~618]{Jurafsky2009}. Every word and syntactic structure in a sentence gets such a semantic attachment. The tree with syntactic components is now traversed in a bottom-up manner. On the way the semantic attachments are combined to finally produce ``First-Order Logic''\cite[p.~589]{Jurafsky2009a} that can be interpreted in a meaningful way. This procedure has some prerequisites that will be explained first.
The mentioned \textit{First-Order Logic} can be represented by a context-free grammar specification. It is beyond this paper to describe this specification completely. Jurafsky\cite{Jurafsky2009a} provides a detailed picture of the specification with all elements in figure 17.3. The most important aspects of this specification are explained here. The logic provides terms which can be functions, constants and variables. Functions have a term as argument. Syntactically they are the same as single-argument predicates. But functions represent one unique object.
Predicates can have multiple terms as arguments. In addition the logic provides quantifiers ($\forall, \exists$) and connectives ($\wedge, \vee, \Rightarrow$).
Another prerequisite is the ``lambda notation''\cite[p.~593]{Jurafsky2009a}. A simple example of this notation is an expression of the following form\footnote{examples taken from Jurafsky\cite[pp.~593-594]{Jurafsky2009a}}:
\[
\lambda x.P(x)
\]
The $\lambda$ can be reduced in a so called ``$\lambda$-reduction''\cite[p.~593]{Jurafsky2009a}. The expression above could be reduced in the following way:
\begin{alignat*}{2}
\lambda x.&P(x)&(A) \\
&P(A)&
\end{alignat*}
Those expressions can be extended to $n$ such $\lambda$s. An example is this expression:
\[
\lambda x.\lambda y.Near(x,y)
\]
This expression can be reduced in multiple steps.
\begin{alignat*}{1}
\lambda x.\lambda y.&Near(x,y)(Bacaro) \\
\lambda y.&Near(Bacaro, y)(Centro) \\
&Near(Bacaro, Centro)
\end{alignat*}
This technique is called ``currying''\cite[p.~594]{Jurafsky2009a} and is used to convert ``a predicate with multiple arguments into a sequence of single-argument predicates''\cite[p.~594]{Jurafsky2009a}.
After the prerequisites are now explained, it is time to start with the actual syntax-driven semantic analysis. It will be shown with an example provided by Jurafsky. Assume the sentence \textit{Every restaurant closed}. ``The target representation for this example should be the following''\cite[p.~621]{Jurafsky2009}.
\begin{equation}
\label{eq:tarRep}
\forall x \,Restaurant(x) \Rightarrow \exists e \,Closed(e) \wedge ClosedThing(e,x)
\end{equation}
The first step is to determine what the meaning representation of \textit{Every restaurant} should be. \textit{Every} is responsible for the $\forall$ quantifier and \textit{restaurant} specifies the category over which is quantified. This is called the ``restriction''\cite[p.~622]{Jurafsky2009} of the noun phrase. The meaning representation could be $\forall x\,Restaurant(x)$. It is a valid logical formula but it doesn't make much sense. ``It says that everything is a restaurant.''\cite[p.~622]{Jurafsky2009} ``Noun phrases like [this] are [usually] embedded in expressions that [say] something about the universally quantified variable. That is, we're probably trying to \textit{say something} about all restaurants. This notion is traditionally referred to as the \textit{NP}'s nuclear scope''\cite[p.~622]{Jurafsky2009}. In the given example, the nuclear scope is \textit{closed}. To represent this notion in the target representation, a dummy predicate $Q$ is added, which results in this expression:
\[
\forall x\,Restaurant(x) \Rightarrow Q(x)
\]
To replace $Q$ with something meaningful, the $\lambda$ notation is needed.
\[
\lambda Q.\forall x\,Restaurant(x) \Rightarrow Q(x)
\]
After more generalization, this is the result:
\[
\lambda P.\lambda Q.\forall x\,P(x) \Rightarrow Q(x)
\]
What happened? The descriptor \textit{every} gets this last expression as semantic attachment. The noun \textit{restaurant} gets $\lambda x.Restaurant(x)$. When combined, the second expression is the result. The verb is still missing. Therefore the verb \textit{closed} gets the following expression.
\[
\lambda x.\exists e\,Closed(e) \wedge ClosedThing(e,x)
\]
After combining the formulas of the verb and the noun phrase, the previously shown target representation\eqref{eq:tarRep} is the result.
This example is just one of many, but it shows how semantic meaning can be attached to syntactic components. Furthermore it should be clear now, how semantic analysis in a syntax-driven approach works.
\section{Critical discussion}
\label{sec:critDiscussion}
Now that both methods have been presented with one selected approach each, it is time to discuss them critically. The CYK algorithm solves many problems like ambiguity; at least to a certain degree. But it also is problematic, because of the restriction to CNF. While in theory every context-free grammar can be converted to CNF, in practice it poses ``some non-trivial problems''\cite[p.~475]{Jurafsky2009b}. One of this problems can be explored in conjunction with the second presented method (semantic analysis). ``[T]he conversion to CNF will complicate any syntax-driven approach to semantic analysis''\cite[p.~475]{Jurafsky2009b}. A solution to this problem is some kind of post-processing in which the trees are converted back to the original grammar.\cite{Jurafsky2009b} Another option is to use a more complex dynamic programming algorithm that accepts any kind of context-free grammar. Such an algorithm is the ``Earley Algorithm''\cite[p.~477]{Jurafsky2009b}.
The syntax-driven semantic analysis, as it has been presented, is a powerful method that is easy to understand. But it has one essential problem. It relies upon an existing set of grammar rules with semantic attachments to them. In a real world example such a table would contain thousands of grammar rules. While it is relatively easy to compute the final meaning representation with such a given table, it is very hard to create the table in the first place. The difficulty to create this table is split into two main issues. The first one being that you must find a grammar specification that fits all your use cases. This problem applies for the syntactic parsing as well. The second issue is that one has to find out the semantic attachments to the grammar rules.
This initial workload to create a state, in which the semantic analysis works, is a unique effort. In a restricted environment with a limited set of words and topics, this workload is of low importance. Even if it takes one month to create such a table by hand or by computing it, the subsequent analysis of input based on this table is rather quick and the initial workload is therefore acceptable. But this is only true for restricted environments. If someone tried to use syntax-driven semantic analysis for the complete language of modern English, the creation of such a table would outweigh any possible usage.
Comparing the complexity of the two methods it shows a mirror-like image. For the parsing the creation of the grammar is comparatively easy. The presented CYK algorithm works with context-free grammars which are a very restricted set compared to natural languages. But even within these context-free grammars there are ambiguities inside the texts themselves. The creation of the parse trees is therefore more of a problem.
Syntax-driven semantic analysis on the other hand requires a decent amount of work to add semantic attachments to grammar rules. But once this has been done, it works very fast.
Both methods require a unique work for one specific usage. This unique workload is the grammar creation for the parsing and the extension of the grammar with semantic attachments for the semantic analysis. The less restricted the usage environment, the more complex the initial workload becomes. The same is true for the recurring workload inside one specific usage.
Judging by the state-of-the-art of computer technology, parsing does still pose a significant challenge once the restricted field of programming languages is left. The semantic analysis as the second method in the chain has therefore even more problems to date. As the presented syntax-driven approach does only work with parse trees, a semantic analysis can only be undertaken once the syntactic parsing succeeds.
The ambiguity remains one of the bigges issues for both methods. Especially the syntax-driven semantic analysis does only consider the semantic meaning alone. It's not it's fault as the analysis doesn't know the context. The presented approach looks at each sentence in a sandbox. The generated meaning representations are therefore only of limited use for a less restricted grammar.
\section{Conclusion}
\label{sec:concl}
Syntactic parsing is an important method on the way to understand natural language. The usage of dynamic programming algorithms circumvents many of the issues that classical top-down or bottom-up parsing algorithms face. Ambiguity is the most prominent of those issues. The best algorithm for context-free grammars is the CYK algorithm, which is a dynamic programming algorithm. But in practice it is very restricted, because it only works with grammars in CNF. But there are more complex dynamic programming algorithms that allow any kind of context-free grammar.
Semantic analysis is the second method in the chain to understand natural language and therefore important as well. There are different approaches to the analysis. One of them is the syntax-driven approach that depends on parse trees. This dependency creates a delay effect: As long as a certain peace of text cannot be parsed, it definitely can't be analyzed for it's semantic meaning either. This is not an issue for restricted environments like programming languages or a very restricted subset of a natural language's grammar. But it is a major issue for real natural language, because there already the parsing does pose significant challenges.
Looking into the future both methods require substantial improvements on the algorithm side to reach a point where understanding non-restricted natural languages becomes possible. But as it is right now it is not possible to create dialog systems that interact fully natural with humans. To make any kind of language interaction, the set of possible words and sentence structures must be restricted. But even if that is given (like in a flight check-in automaton), the computer has only a finite set of possible cases. The programmer can add tons of if-clauses or comparable statements to check for different cases but in the end it's all finite so that many of the user inputs must lead to the same output or no output at all. This fact has led to the current situation in which the most interaction with a computer happens via a restricted interface in which the user can only choose from a limited set of options (by clicking on a button, selecting an item of a list, etc.).
In addition the ambiguity of natural language is a major issue. Going back to the example in the introduction, the syntax-driven semantic analysis does only work properly if the semantic meaning of the input has no ambiguity. But even than the generated meaning representation does not represent the pragmatic meaning. A dialog system is therefore far from being reached, because every input of a human can have dozens of different meanings. The intended meaning can sometimes depend on a thought that this human had while typing the input. As the computer doesn't have the ability to read thoughts, it would be impossible for the computer to determine the intended meaning of the input.
In a mission critical environment this ambiguity could lead to catastrophic results, because the computer, simply put, ``didn't get it''. This risk limits the usability of natural language communication with a computer for propably a long time to a very restricted set of use cases.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% hier werden - zum Ende des Textes - die bibliographischen Referenzen
% eingebunden
%
% Insbesondere stehen die eigentlichen Informationen in der Datei
% ``bib.bib''
%
\clearpage
\bibliography{prosem-ki}
\bibliographystyle{plain}
\addcontentsline{toc}{section}{Bibliography}% Add to the TOC
\end{document}

View File

@ -0,0 +1,184 @@
#lang racket
#|
SE 3 Funktional Blatt 2
Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
|#
; 1) Definitionen
(define miau 'Katze)
(define plueschi miau)
(define peter 'miau)
(define (welcherNameGiltWo PersonA PersonB)
(let ((PersonA 'Sam)
(PersonC PersonA))
PersonC))
(define xs1 '(0 1 2 miau plueschi))
(define xs3 (list miau plueschi))
(define xs2 (cons plueschi miau))
#| 1. zu 'Katze, da miau als 'Katze definiert wurde
2. zu 'Katze, da plueschi als miau definiert wurde,
welches als 'Katze definiert wurde
bei der Ausführung werden Symbole so lange ausgewertet, bis ein ' auftaucht
oder eine Zahl/ein String
3. zu 'miau, da peter als 'miau definiert wurde und ' die Auswertung von miau verhindert
4. zu 'plueschi, da die Funktion quote das Symbol selbst ohne Auswertung zurückgibt
5. zu 'Katze, da eval den Inhalt von peter auswertet, welcher das Symbol miau ist
6. wirft Fehler, da kein Symbol Katze definiert wurde, eben dieses aber in miau als Inhalt steht
durch eval wird nun versucht den Inhalt von miau auszuwerten, also den Inhalt von Katze zu finden
das geschieht, weil vor Ausführung von eval bereits plueschi zu 'Katze ausgewertet wird
7. zu 'Katze, da nun das Symbol plueschi selbst ausgewertet wird durch eval, was miau und damit 'Katze ergibt
8. zu 'Ich, da das Symbol Ich den Wert 'Sam zugewiesen bekommt und PersonC den Wert 'Ich
bei der anschließenden Rückgabe von PersonC wird daher 'Ich zurückgegeben
9. zu '(miau plueschi), da die ersten drei Listenglieder durch cdddr entfernt werden
und nur die verbleibende Liste zurückgegeben wird
10. zu 'Katze, da (cons plueschi miau) ein Paar mit den Werten 'Katze und 'Katze erzeugt
cdr gibt nun das zweite Element zurück
11. zu '(Katze), da (list plueschi miau) eine Liste '('Katze 'Katze) erzeugt
cdr schneidet das erste Element ab und gibt die verbleibende Liste zurück
12. zu 0.1411200080598672, da zunächst der Sinus von 3 berechnet wird
und eval einer Zahl eben diese zurückgibt
13. zu 'peter, da der Aufruf von welcherNameGiltWo 'peter zurückgibt
eval wird also mit ''peter aufgerufen; die Auswertung durch eval ergibt daher 'peter
14. zu 'miau, da der Aufruf von welcherNameGiltWo 'peter zurückgibt
eval wird also mit 'peter aufgerufen; eval wertet damit das Symbol peter aus, welches den Wert 'miau hat
|#
; 2.1
(define (fakultaet n)
(letrec (
; rekursive Hilfsfunktion
(helper (λ (x)
; 0! ergibt 1
(cond ([= 0 x] 1)
; ansonsten ergibt sich x! aus x*(x-1)!
(else (* x (helper (- x 1)))
)
)
)
)
)
; aufrufen der rekursiven Hilfsfunktion
(helper n)
)
)
; 2.2
(define (power r n)
(letrec (
; rekursive Hilfsfunktion
(helper (λ (x y)
; r⁰ ergibt immer 1
(cond ([= 0 y] 1)
; wenn y gerade ist, dann rechne (x^(y/2))²
([even? y]
(sqr (expt x (/ y 2)))
)
; ansonsten rechne x*x^(y-1)
(else
(* (expt x (- y 1)) x)
)
)
)
)
)
; aufrufen der rekursiven Hilfsfunktion
(helper r n)
)
)
; 2.3
; berechnen des Limits hier aus Gründen der Optimierung
(define limit (power 10 1000))
(define e
(letrec (
; rekursive Hilfsfunktion
(helper (λ (x y)
; wenn x kleiner als 1/(10^1000) ist, breche ab
(cond ([< x (/ 1 limit)] 0)
; ansonsten addiere x mit dem Ergebnis aus einem weiteren Aufruf
; der Hilfsfunktion
(else
(+ x (helper (/ 1 (fakultaet (+ y 1))) (+ y 1) ))
)
)
)
)
)
; aufrufen der Hilfsfunktion und multiplizieren des Ergebnisses mit
; 10^1001
(* (helper 1 0) 10 limit)
)
)
; 2.4
(define my-pi
(letrec (
; rekursive Hilfsfunktion
(helper (λ (x plus?)
; wenn x größer ist als 22000, breche ab
(cond ([> x 22000] 0)
; andernfalls fahre fort
(else
; und addiere 1/x
(cond (plus?
(+ (/ 1 x) (helper (+ x 2) #f))
)
; oder -1/x mit dem Ergebnis eines weiteren Aufrufs der Hilfsfunktion
(else
(+ (* -1 (/ 1 x)) (helper (+ x 2) #t))
)
)
)
)
)
))
; aufrufen der Hilfsfunktion und anschließendes Multiplizieren mit
; 4 und 10^1000
(* (* (helper 1 #t) 4) limit)
)
)
; 3
; Typbestimmung
(define (type-of input)
(cond ([boolean? input] 'boolean)
([list? input] 'list)
([pair? input] 'pair)
([symbol? input] 'symbol)
([number? input] 'number)
([char? input] 'char)
([string? input] 'string)
([vector? input] 'vector)
([procedure? input] 'procedure)
(else 'noneOfThem)
)
)
; Ausgaben
(display "(type-of (+ 3 7)): ")
(type-of (+ 3 7))
; zu 'number, da (+ 3 7) zunächst zu 10 und damit einer number ausgewertet wird
(display "(type-of type-of): ")
(type-of type-of)
; zu 'procedure, da type-of eine Funktion ist
(display "(type-of (type-of type-of)): ")
(type-of (type-of type-of))
; zu 'symbol, da (type-of type-of) 'procedure zurückgibt und dies ein Symbol ist
(display "(type-of (string-ref \"Schneewitchen_und_die_7_Zwerge\" 2)): ")
(type-of (string-ref "Schneewitchen_und_die_7_Zwerge" 2))
; zu 'char, da string-ref den char an der Position 2 zurückgibt
(display "(type-of (lambda (x) x)): ")
(type-of (lambda (x) x))
; zu 'procedure, da lambda eine Funktion erstellt
(define (id z) z)
(display "(type-of (id cos)): ")
(type-of (id cos))
; zu 'procedure, da id den Parameter zurückgibt, welcher eine Funktion ist
(display "(type-of '(1 2 3)): ")
(type-of '(1 2 3))
; zu 'list, da '(1 2 3) eine Liste ist
(display "(type-of '()): ")
(type-of '())
; zu 'list, da '() eine leere Liste ist

View File

@ -0,0 +1,117 @@
#lang racket
#|
SE 3 Funktional Blatt 3
Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
|#
; 1.1
; Diese Datenstruktur in Form einer Funktion erlaubt das Zurückgeben einer
; Liste, die an erster Stelle den Buchstaben und an zweiter Stelle dessen
; Zuordnung im Buchstabieralphabet als Symbol enthält.
; Die Rückgabe einer Liste mit dem Buchstaben an erster Stelle und einer
; Liste als zweitem Element, die wiederum den Schlüssel an erster Stelle
; enthält, erlaubt ein einfaches Auswerten der Zuordnung.
(define buchstabiertafel
'((#\A . Alfa)
(#\B . Bravo)
(#\C . Charlie)
(#\D . Delta)
(#\E . Echo)
(#\F . Foxtrott)
(#\G . Golf)
(#\H . Hotel)
(#\I . India)
(#\J . Juliett)
(#\K . Kilo)
(#\L . Lima)
(#\M . Mike)
(#\N . November)
(#\O . Oscar)
(#\P . Papa)
(#\Q . Quebec)
(#\R . Romeo)
(#\S . Sierra)
(#\T . Tango)
(#\U . Uniform)
(#\V . Viktor)
(#\W . Whiskey)
(#\X . X-ray)
(#\Y . Yankee)
(#\Z . Zulu)
(#\0 . Nadazero)
(#\1 . Unaone)
(#\2 . Bissotwo)
(#\3 . Terrathree)
(#\4 . Kartefour)
(#\5 . Pantafive)
(#\6 . Sosisix)
(#\7 . Setteseven)
(#\8 . Oktoeight)
(#\9 . Novenine)
(#\, . Decimal)
(#\. . Stop)
))
; 1.2
(define (char->schlüssel char tafel)
(cdr (assoc (char->upper char) tafel)))
; 1.3
(define (char->upper char)
(let ([charInt (char->integer char)])
(cond ([<= 96 charInt 122] (integer->char (- charInt 32)))
([<= 65 charInt 90] (integer->char charInt))
(else char))))
; 1.4
(define (buchstabiere text tafel)
(letrec ((rec (λ (xs)
(if (null? xs)
null
(cons (char->schlüssel (car xs) tafel)
(rec (cdr xs)))))))
(rec (string->list text))))
(require se3-bib/flaggen-module)
; 2.1
; Analoger Entwurf wie bei 1.1, diesmal mit den Flaggen.
(define flaggentafel
`((#\A . ,A)
(#\B . ,B)
(#\C . ,C)
(#\D . ,D)
(#\E . ,E)
(#\F . ,F)
(#\G . ,G)
(#\H . ,H)
(#\I . ,I)
(#\J . ,J)
(#\K . ,K)
(#\L . ,L)
(#\M . ,M)
(#\N . ,N)
(#\O . ,O)
(#\P . ,P)
(#\Q . ,Q)
(#\R . ,R)
(#\S . ,S)
(#\T . ,T)
(#\U . ,U)
(#\V . ,V)
(#\W . ,W)
(#\X . ,X)
(#\Y . ,Y)
(#\Z . ,Z)
(#\0 . ,Z0)
(#\1 . ,Z1)
(#\2 . ,Z2)
(#\3 . ,Z3)
(#\4 . ,Z4)
(#\5 . ,Z5)
(#\6 . ,Z6)
(#\7 . ,Z7)
(#\8 . ,Z8)
(#\9 . ,Z9)
))

View File

@ -0,0 +1,198 @@
#lang racket
#|
SE 3 Funktional Blatt 4
Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
|#
; 1)
; 1. (max (min 2 (- 2 5)) 0) -> 0
; zunächst wird (- 2 5) ausgeführt, was -3 ergibt
; als nächstes wird (min 2 -3) ausgeführt, was -3 ergibt
; dann kommt (max -3 0) mit dem Ergebnis 0
; 2. '(+ (- 2 13) 2) -> (+ (- 2 13) 2)
; das Quote verzögert die Auswertung, wodurch der Ausdruck nicht ausgewertet wird
; 3. (cadr '(Alle Jahre wieder)) -> 'Jahre
; zunächst wird (cdr '(Alle Jahre wieder)) ausgeführt mit dem Ergebnis '(Jahre wieder)
; anschließend wird (car '(Jahre wieder)) mit dem Ergebnis 'Jahre ausgeführt
; 4. (cddr '(kommt (das Weihnachtfest))) -> '()
; zunächst wird (cdr '(kommt (das Weihnachtfest))) ausgeführt mit dem Ergebnis '((das Weihnachtfest))
; anschließend wird (cdr '((das Weihnachtfest))) ausgeführt mit dem Ergebnis '()
; dies liegt an der doppelt geschachtelten Liste:
; (cons 'kommt (list (list 'das 'Weihnachtfest))) -> '(kommt (das Weihnachtfest))
; 5. (cons 'Listen '(ganz einfach und)) -> '(Listen ganz einfach und)
; da '(ganz einfach und) eine Liste ist, verkettet cons 'Listen schlichtweg mit der Liste
; 6. (cons 'Paare 'auch) -> '(Paare . auch)
; hier verkettet cons zwei einfache Elemente, wodurch ein Paar entsteht, welches keine Liste ist
; 7. (equal? (list 'Racket 'Prolog 'Java) '(Racket Prolog Java)) -> #t
; list erzeugt eine Liste mit den angegebenen Elementen und '(Racket Prolog Java) ist ebenfalls eine Liste mit den gleichen Elementen
; 8. (eq? (list 'Racket 'Prolog 'Java) (cons 'Racket '(Prolog Java))) -> #f
; list erzeugt wieder eine Liste und cons verknüpft hier ein einfaches Element mit einer Liste, wodurch wieder eine Liste entsteht;
; allerdings sind die beiden Listen nicht identisch, aber genau das prüft eq?
; 2)
; 1.
; <notmeldung> ::= <ueberschrift><notfallort><notfallart><hilfeleistung><peilzeichen><unterschrift><over>
; <ueberschrift> ::= <hierist><line-end><schiffname3mal><rufzeichen><line-end><summary><line-end>
; <summary> ::= "MAYDAY "<schiffname>" ICH BUCHSTABIERE "<snamechars>" "<rufzeichen>
; <snamechars> ::= <string>
; <schiffname3mal>::= <schiffname>" "<schiffname>" "<schiffname>
; <schiffname> ::= <word>
; <notfallort> ::= <standort><zeitpunkt>
; <notfallart> ::= <string><line-end>
; <hilfeleistung> ::= <string><line-end><lines>
; <peilzeichen> ::= "ICH SENDE DEN TRÄGER --"<line-end>
; <unterschrift> ::= <word>" "<rufzeichen><line-end>
; <rufzeichen> ::= <word>" "<word>" "<word>" "<word>
; <lines> ::= <string><line-end> | <string><line-end><lines>
; <standort> ::= "NOTALLPOSITION "<string><line-end>
; <zeitpunkt> ::= "NOTFALLZEIT "<time>" UTC"<line-end>
; <time> ::= <hour><minute>
; <hour> ::= "0"<digit> | "1"<digit> | "2"<hdigit>
; <minute> ::= "0"<digit> | "1"<digit> | "2"<digit> | "3"<digit> | "4"<digit> | "5"<digit>
; <digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
; <hdigit> ::= "0" | "1" | "2" | "3"
; <string> ::= <word> | <word>" "<string>
; <word> ::= <letter> | <letter><word>
; <line-end> ::= <EOL>
; <over> ::= "OVER"
; 2.2
(define buchstabiertafel
'((#\A . ALFA)
(#\B . BRAVO)
(#\C . CHARLIE)
(#\D . DELTA)
(#\E . ECHO)
(#\F . FOXTROTT)
(#\G . GOLF)
(#\H . HOTEL)
(#\I . INDIA)
(#\J . JULIETT)
(#\K . KILO)
(#\L . LIMA)
(#\M . MIKE)
(#\N . NOVEMBER)
(#\O . OSCAR)
(#\P . PAPA)
(#\Q . QUEBEC)
(#\R . ROMEO)
(#\S . SIERRA)
(#\T . TANGO)
(#\U . UNIFORM)
(#\V . VIKTOR)
(#\W . WHISKEY)
(#\X . X-RAY)
(#\Y . YANKEE)
(#\Z . ZULU)
(#\0 . NADAZERO)
(#\1 . UNAONE)
(#\2 . BISSOTWO)
(#\3 . TERRATHREE)
(#\4 . KARTEFOUR)
(#\5 . PANTAFIVE)
(#\6 . SOSISIX)
(#\7 . SETTESEVEN)
(#\8 . OKTOEIGHT)
(#\9 . NOVENINE)
(#\, . DECIMAL)
(#\. . STOP)
))
(define (char->schlüssel char tafel)
(cdr (assoc (char->upper char) tafel)))
(define (char->upper char)
(let ([charInt (char->integer char)])
(cond ([<= 96 charInt 122] (integer->char (- charInt 32)))
([<= 65 charInt 90] (integer->char charInt))
(else char))))
(define (liste->string liste)
(letrec ((rec (λ (string xs)
(if (null? xs)
string
(if (empty? string)
(rec (symbol->string (car xs)) (cdr xs))
(rec (string-append string " " (symbol->string (car xs))) (cdr xs)))))))
(rec "" liste)))
(define (buchstabiere text tafel)
(letrec ((rec (λ (xs)
(if (null? xs)
null
(cons (char->schlüssel (car xs) tafel)
(rec (cdr xs)))))))
(liste->string (rec (string->list text)))))
(define mayday "MAYDAY")
(define notposition "NOTFALLPOSITION")
(define notzeit "NOTFALLZEIT")
(define space " ")
(define linebreak "\n")
(define hierist "HIER IST")
(define buchstabieren "ICH BUCHSTABIERE")
(define ruf "RUFZEICHEN")
(define senden "ICH SENDE DEN TRÄGER --")
(define (generiereNotmeldung schiffname rufzeichen position weitereAngaben)
(display (string-append mayday space mayday space mayday linebreak
hierist linebreak
schiffname space schiffname space schiffname (buchstabiere rufzeichen buchstabiertafel) linebreak
mayday space schiffname space buchstabieren (buchstabiere schiffname buchstabiertafel) (buchstabiere rufzeichen buchstabiertafel) linebreak
ruf (buchstabiere rufzeichen buchstabiertafel) linebreak
notposition space position linebreak
weitereAngaben
senden linebreak
schiffname (buchstabiere rufzeichen buchstabiertafel) linebreak
"OVER")))
; 2.3
(display "BABETTE:\n")
(generiereNotmeldung "BABETTE" "DEJY" "UNGEFÄHR 10 SM NORDÖSTLICH LEUCHTTURM KIEL" "SCHWERER WASSEREINBRUCH WIR SINKEN\nKEINE VERLETZTEN\nVIER MANN GEHEN IN DIE RETTUNGSINSEL\nSCHNELLE HILFE ERFORDERLICH\n")
(display "\n\nAMIRA:\n")
(generiereNotmeldung "AMIRA" "AMRY" "57°46'N, 006°31'E\nNOTFALLZEIT 0640 UTC" "KENTERUNG WIR SINKEN\n9 MANN AN BORD\nSCHIFF 15 M LANG\nGRÜNER RUMPF\n")
; 3)
; bei innerer Reduktion werden die Terme von innen nach außen reduziert
; bei äußerer Reduktion werden die Terme von außen nach innen reduziert
; innere Reduktion:
; (hoch3 (* 3 (+ 1 (hoch3 2))))
; -> (hoch3 (* 3 (+ 1 (* 2 2 2)))) ; (hoch3)
; -> (hoch3 (* 3 (+ 1 8))) ; (*)
; -> (hoch3 (* 3 9)) ; (+)
; -> (hoch3 27) ; (*)
; -> (* 27 27 27) ; (hoch3)
; -> 19683 ; (*)
; äußere Reduktion:
; (* (* 3 (+ 1 (hoch3 2))) (* 3 (+ 1 (hoch3 2))) (* 3 (+ 1 (hoch3 2)))) ; (hoch3)
; -> (* (* 3 (+ 1 (* 2 2 2))) (* 3 (+ 1 (hoch3 2))) (* 3 (+ 1 (hoch3 2)))) ; (hoch3)
; -> (* (* 3 (+ 1 8)) (* 3 (+ 1 (hoch3 2))) (* 3 (+ 1 (hoch3 2)))) ; (*)
; -> (* (* 3 9) (* 3 (+ 1 (hoch3 2))) (* 3 (+ 1 (hoch3 2)))) ; (+)
; -> (* 27 (* 3 (+ 1 (hoch3 2))) (* 3 (+ 1 (hoch3 2)))) ; (*)
; -> (* 27 (* 3 (+ 1 (* 2 2 2))) (* 3 (+ 1 (hoch3 2)))) ; (hoch3)
; -> (* 27 (* 3 (+ 1 8)) (* 3 (+ 1 (hoch3 2)))) ; (*)
; -> (* 27 (* 3 9) (* 3 (+ 1 (hoch3 2)))) ; (+)
; -> (* 27 27 (* 3 (+ 1 (hoch3 2)))) ; (*)
; -> (* 27 27 (* 3 (+ 1 (* 2 2 2)))) ; (hoch3)
; -> (* 27 27 (* 3 (+ 1 8))) ; (*)
; -> (* 27 27 (* 3 9)) ; (+)
; -> (* 27 27 27) ; (*)
; -> 19683 ; (*)
; In Racket wird die strikte innere Reduktion für Funktionen angewendet.
; Für Spezialformen wird je nach Spezialform eine andere Strategie angewendet.
; Allgemein kann jedoch gesagt werden, dass dort von außen nach innen gegangen wird.
; Wenn Alyssa das Programm benutzt, dann entsteht eine Endlosschleife, da
; cond aufgrund der inneren Reduktion niemals aufgerufen wird. Pro Rekursionsaufruf
; werden zunächst alle drei Parameter ausgewertet. Ab dem fünften Rekursionsschritt
; wird (> counter max-count) zwar zu false ausgewertet, aber erst wenn der faculty
; Aufruf komplett ausgewertet ist, wird new-if aufgerufen. Da in jedem Rekursionsschritt
; faculty aufgerufen wird, entsteht eine Endlosschleife.
; Anhand dieses Beispiels wird deutlich, dass zunächst die Bedingung ausgewertet werden muss
; und abhängig von dieser dann entweder nur die then-clause oder nur die else-clause. Bei jeder Rekursion
; muss dies passieren, da sonst die Abbruchbedingung nie zum Abbruch führt.

View File

@ -0,0 +1,220 @@
#lang racket
#|
SE 3 Funktional Blatt 5
Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
|#
; 1)
; Folgende Teilprobleme sind zu lösen:
; - bestimmen der rezessiven Merkmale des Vaters
; - bestimmen der rezessiven Merkmale der Mutter
; - bestimmen der vererbten Merkmale des Vaters
; - bestimmen der vererbten Merkmale der Mutter
; - bestimmen der sichtbaren Merkmale von Kindern
; - anzeigen eines Schmetterlings
; - bestimmen von beliebig vielen Kindern
; Das Programm hat die Hauptfunktion mendel, die als Parameter die dominanten
; Merkmale des Vaters und der Mutter, sowie die Anzahl der Kinder bekommt.
; Davon ausgehend werden dann zufällig die rezessiven Merkmale des Vaters bzw. der Mutter
; gewählt. Dafür wird eine Funktion randomRezessiv benötigt, die ebendies bewerkstelligt.
; randomRezessiv greift auf die Dominanzliste zurück. Dafür wird eine Zugriffsfunktion
; key->wert benutzt. Zusätzlich wird eine Hilfsfunktion (randomList) benutzt, um
; von der Liste der dominierten Merkmale ein zufälliges Merkmal auszuwählen.
; randomSelection wählt aus gegebenen dominanten und rezessiven Merkmalen zufällig eine Liste
; an Merkmalen aus, die dann die vererbten Merkmale darstellen.
; sichtbar ermittelt bei gegebenen Merkmalen des Vaters und der Mutter
; die sichtbaren Elemente.
; zeigeSchmetterling zeigt einen Schmetterling bei gegebenen Merkmalen in einer Liste an.
; Die Datenstruktur zum Speichern des Genoms ist sehr einfach:
; Es ist eine Liste von Listen, deren erstes Element jeweils ein Merkmal darstellt
; und deren zweites Element jeweils eine Liste von Merkmalen darstellt,
; die von dem Merkmal an erster Stelle dominiert werden.
; Durch diesen Entwurf lassen sich die Teilprobleme leicht lösen und es
; wird eine optimale Anzahl an Funktionen erreicht, die nicht mehr aber auch
; nicht weniger machen, als benötigt wird.
; Datenstruktur der Dominanzabhängigkeiten, wobei der Wert immer eine Liste
; all jener Merkmale ist, die von dem key dominiert werden
(define dominanzliste
'((punkte . (streifen sterne))
(streifen . (sterne))
(sterne . (sterne))
(rot . (gruen blau gelb))
(gruen . (blau gelb))
(blau . (gelb))
(gelb . (gelb))
(gerade . (gekruemmt geschweift))
(gekruemmt . (geschweift))
(geschweift . (geschweift))
(rhombisch . (hexagonal elliptisch))
(hexagonal . (elliptisch))
(elliptisch . (elliptisch))
))
; Datenstruktur für Übersetzung, um show-butterfly korrekt aufzurufen
(define translationlist
'((punkte . dots)
(streifen . stripes)
(sterne . stars)
(rot . red)
(gruen . green)
(blau . blue)
(gelb . yellow)
(gerade . straight)
(gekruemmt . curved)
(geschweift . curly)
(rhombisch . rhomb)
(hexagonal . hexagon)
(elliptisch . ellipse)
))
; gibt den Wert von key in tafel zurück
(define (key->wert key tafel)
(cdr (assoc key tafel)))
; wählt ein zufälliges Element einer Liste aus
(define (randomListe xs)
(car (shuffle xs)))
; wählt zu einer gegebenen Liste an dominanten Merkmalen die rezessiven Merkmale aus
(define (randomRezessiv dominant)
(letrec ((help (λ (xs result)
(if (empty? xs)
result
(help
(cdr xs)
(cons
(randomListe (key->wert (car xs) dominanzliste))
result
))
))))
(reverse (help dominant '()))))
; wählt von den gegebenen Elementen zufällig eines aus
(define (randomElement x y)
(let ((r (random 2)))
(if (= r 0)
x
y)))
; wählt aus der Liste der dominanten und rezessiven Merkmale zufällig
; Merkmale aus
(define (randomSelection dominant rezessiv)
(letrec ((select (λ (xs ys result)
(if (empty? xs)
result
(select (cdr xs) (cdr ys) (cons (randomElement (car xs) (car ys))
result))
))))
(reverse (select dominant rezessiv '()))))
; bestimmt aus den zufälligen Merkmalen des Vaters und der Mutter die sichtbaren Elemente
; beim Kind
(define (sichtbar vaterMerkmale mutterMerkmale)
(letrec ((rec (λ (xs ys result)
(if (empty? xs)
result
(if (empty? (filter (λ (x) (equal? x (car ys))) (key->wert (car xs) dominanzliste)))
(rec (cdr xs) (cdr ys) (cons (car ys) result))
(rec (cdr xs) (cdr ys) (cons (car xs) result))
)))))
(reverse (rec vaterMerkmale mutterMerkmale '()))))
(require se3-bib/butterfly-module)
(define (zeigeSchmetterling merkmale)
(show-butterfly (key->wert (cadr merkmale) translationlist)
(key->wert (car merkmale) translationlist)
(key->wert (caddr merkmale) translationlist)
(key->wert (cadddr merkmale) translationlist)
))
; zeigt (in dieser Reihenfolge) den Vater, die Mutter und die Kinder
(define (mendel vaterDominant mutterDominant anzahlKinder)
(let ((vaterRezessiv (randomRezessiv vaterDominant))
(mutterRezessiv (randomRezessiv mutterDominant))
)
(letrec ((rec (λ (counter result)
(if (= 0 counter)
result
(rec (- counter 1)
(cons (sichtbar
(randomSelection vaterDominant vaterRezessiv)
(randomSelection mutterDominant mutterRezessiv))
result))))))
(map zeigeSchmetterling (cons vaterDominant (cons mutterDominant (rec anzahlKinder '()))))
)
)
)
; Austesten des Falles von einem Vater, der als dominante Merkmale die absolut
; dominantesten Merkmale hat und einer Mutter, die als dominante Merkmale die absolut
; schwächsten Merkmale hat
; diese Daten testen einen möglichen Extremfall
; bei diesem Fall sind die vererbten Merkmale der Mutter immer dieselben
; ein Merkmal der Mutter wird sich daher nur durchsetzen, wenn der Vater dies als
; rezessives Merkmal hat und das rezessive Merkmal vom Vater vererbt wird
(mendel '(punkte rot gerade rhombisch) '(sterne gelb geschweift elliptisch) 2)
; Austesten des Falles, dass sowohl Vater als auch Mutter die schwächsten Merkmale
; als dominante Merkmale haben
; bei diesem Extremfall sehen die Kinder genau gleich aus (alle von 1 bis n)
(mendel '(sterne gelb geschweift elliptisch) '(sterne gelb geschweift elliptisch) 2)
; Austesten des Falles, dass beide Elternteile die dominantesten Merkmale
; als dominante Merkmale haben. Die Kinder können hier die größten Unterschiede aufweisen.
; In den meisten Fällen werden sie aber so aussehen, wie die Eltern.
(mendel '(punkte rot gerade rhombisch) '(punkte rot gerade rhombisch) 2)
; 2)
; überprüft, ob ein Element in einer Liste ist
(define (in-list? element list)
(if (pair? (member element list))
#t
#f))
(define erbbarliste
'((punkte . (punkte streifen sterne))
(streifen . (streifen sterne))
(sterne . (sterne))
(rot . (rot gruen blau gelb))
(gruen . (gruen blau gelb))
(blau . (blau gelb))
(gelb . (gelb))
(gerade . (gerade gekruemmt geschweift))
(gekruemmt . (gekruemmt geschweift))
(geschweift . (geschweift))
(rhombisch . (rhombisch hexagonal elliptisch))
(hexagonal . (hexagonal elliptisch))
(elliptisch . (elliptisch))
))
; überprüft, ob das Kind von den Eltern abstammen kann
(define (testeElternschaft sichtbarVater sichtbarMutter sichtbarKind)
(letrec ((rec (λ (xs ys zs valid)
(if (or (not valid) (empty? xs))
valid
(rec (cdr xs)
(cdr ys)
(cdr zs)
(or (in-list? (car zs) (key->wert (car xs) erbbarliste))
(in-list? (car zs) (key->wert (car ys) erbbarliste))
))
))))
(rec sichtbarVater sichtbarMutter sichtbarKind #t)))
(display "\nKönnen Anton und Antonia die Eltern von Toni sein:")
(testeElternschaft '(sterne gruen geschweift rhombisch) '(streifen blau gekruemmt hexagonal) '(sterne rot gekruemmt rhombisch))
(display "\nKönnen Anton und Antonia die Eltern von Tini sein:")
(testeElternschaft '(sterne gruen geschweift rhombisch) '(streifen blau gekruemmt hexagonal) '(punkte gruen gerade rhombisch))
(display "\nKönnen Anton und Antonia die Eltern von Tina sein:")
(testeElternschaft '(sterne gruen geschweift rhombisch) '(streifen blau gekruemmt hexagonal) '(streifen gelb geschweift elliptisch))

View File

@ -0,0 +1,115 @@
#lang racket
#|
SE 3 Funktional Blatt 6
Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
|#
; 1)
;
; kopfstueck ist eine lineare Rekursion, da pro else-Aufruf,
; die Funktion nur einmal sich selbst aufruft.
; Daher kann kopfstueck keine Baumrekursion sein.
; kopfstueck wird auch nicht als Argument für kopfstueck verwendet,
; womit auch geschachtelte Rekursion mit nein zu beantworten ist.
; Da sich kopfstueck direkt rekursiv aufruft, ist es eine direkte
; und keine indirekte Rekursion.
; endstueck ist ebenso linear, keine Baumrekursion, keine geschachtelte
; Rekursion, eine direkte Rekursion und keine indirekte Rekursion.
; merge ist eine lineare Rekursion, da pro Fallunterscheidung
; merge nur einmal aufgerufen wird. Demnach ist es keine Baumrekursion.
; Es ist ebenso wenig eine geschachtelte Rekursion, da es sich selbst
; nicht als Argument übergeben wird.
; merge ist eine direkte Rekursion, da es sich direkt aufruft.
; Deswegen ist merge keine indirekte Rekursion.
; merge-sort ist keine lineare Rekursion, da es in jeder Fallunterscheidung
; zweimal aufgerufen wird. merge-sort ist keine geschachtelte Rekursion,
; da es sich selbst nicht als Argument übergeben wird.
; merge-sort ist eine direkte Rekursion, da es sich direkt aufruft.
; Demnach ist merge-sort keine indirekte Rekursion.
; ___________________________________________________________________________________________________________________
; | | lineare Rekursion | Baumrekursion | geschachtelte Rekursion | direkte Rekursion | indirekte Rekursion|
; |____________|___________________|_______________|_________________________|___________________|____________________|
; | kopfstueck | ja | nein | nein | ja | nein |
; | endstueck | ja | nein | nein | ja | nein |
; | merge | ja | nein | nein | ja | nein |
; | merge-sort | nein | ja | nein | ja | nein |
; --------------------------------------------------------------------------------------------------------------------
; 2)
(require 2htdp/image)
(require lang/posn)
; erzeugt einen Tannenbaum mit n Ebenen
(define (tannenbaum n)
(letrec ((leaves (λ (width x result)
(if [= x 0]
result
; rekursiver Aufruf, um die nächsthöhere Ebene zu generieren
(leaves
(/ width 1.5)
(- x 1)
(cons
; erzeugt ein Trapez, welches als eine Ebene fungiert
(polygon
(list (make-posn 0 0)
(make-posn width 0)
(make-posn (+ (/ width 2) (* (/ width 2) 0.2)) (* -1 (/ width 4)))
(make-posn (- (/ width 2) (* (/ width 2) 0.2)) (* -1 (/ width 4))))
"solid"
"darkgreen")
result)))
)))
; Anwenden von above/align auf alle Blätter, den Stamm und den Stern
(apply above/align
(cons "center"
(cons (star-polygon 20 5 2 "solid" "gold")
(leaves 180 n `(,(rectangle 30 30 "solid" "brown") . ()))
)))
))
; erzeugt einen Monitor
(define (monitor content)
(above/align
"center"
(overlay
(text content 24 "red")
(rectangle 160 90 "solid" "blue")
(rectangle 165 95 "solid" "gray")
)
(polygon
(list (make-posn 0 0)
(make-posn 80 0)
(make-posn 55 -10)
(make-posn 25 -10))
"solid"
"gray")
))
; erzeugt ein Star Citizen Poster
(define scPoster (overlay
(above
(text "Star Citizen" 34 "gold")
(text "Squadron 42" 28 "gold"))
(rectangle 185 85 "solid" "royalblue")
(rectangle 200 100 "solid" "black")))
; linker Tannenbaum
(display (tannenbaum 8))
; Monitor
(display (monitor "cout << 0x2a;"))
; Abstand zwischen Monitor und Poster
(display " ")
; Star Citizen Poster
(display scPoster)
; Abstand zwischen Monitor und Poster
(display " ")
; Monitor
(display (monitor "6.12.13"))
; rechter Tannenbaum
(display (tannenbaum 8))

219
se3/blatt1.rkt Normal file
View File

@ -0,0 +1,219 @@
#lang racket
#|
SE 3 Funktional Blatt 1
Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
|#
; 1.1
; degrees ist eine positive Zahl in Grad
(define (degreeToRadian degrees)
(/ (* degrees pi) 180)
)
; radians ist eine Zahl in Bogenmaß
(define (radianToDegree radians)
(/ (* radians 180) pi)
)
; 1.2
(define (my-acos cosinus)
; berechnen von alpha
(atan
; berechnen des tangens
(/
; berechnen des Sinus
(sqrt (- 1 (sqr cosinus)))
cosinus
)
)
)
; 1.3
; nauticMiles ist eine positive Zahl in nautischen Meilen
(define (nmToKM nauticMiles)
(* nauticMiles 1.852)
)
; 2.1
; Helferfunktion, um dG in Bogenmaß zu errechnen
(define (calculateDG widthARad widthBRad distanceLengthRad)
; ausrechnen von dG im Bogenmaß
(acos
; ausrechnen von cos dG im Bogenmaß
(+ (*
(sin widthARad)
(sin widthBRad)
)
(* (cos widthARad)
(cos widthBRad)
(cos distanceLengthRad)
)
)
)
)
; Helferfunktion, um Differenz der Länge in Bogenmaß zu errechnen
(define (calculateDistanceLengthRad lengthA lengthB)
; Differenz geographische Längen
(define distanceLength
(- lengthB lengthA)
)
; Differenz in Radiant umrechnen
(degreeToRadian distanceLength)
)
; breiteA laengeA breiteB laengeB alle in Grad angegeben
; westliche Länge und südliche Breite negativ angeben
(define (distanzAB breiteA laengeA breiteB laengeB)
; Parameter in Radiant umrechnen
(define breiteARad (degreeToRadian breiteA))
(define breiteBRad (degreeToRadian breiteB))
(define distanzLaengeRad (calculateDistanceLengthRad laengeA laengeB))
(define dG (calculateDG breiteARad breiteBRad distanzLaengeRad))
; umrechen in Kilometer
(nmToKM
; ermitteln der Entfernung in Seemeilen
(* 60
; umwandeln in Grad
(radianToDegree dG)
)
)
)
; ausrechnen der Entfernung zwischen den angegebenen Städten
(display "Entfernung Oslo - Hongkong (in km): ")
(distanzAB 59.93 10.75 22.2 114.1)
(display "Entfernung San Francisco - Honolulu (in km): ")
(distanzAB 37.75 -122.45 21.32 -157.83)
(display "Entfernung Osterinsel - Lima (in km): ")
(distanzAB -27.1 -109.4 -12.1 -77.05)
; 2.2
; breiteA laengeA breiteB laengeB alle in Grad angegeben
; westliche Länge und südliche Breite negativ angeben
(define (kurswinkel breiteA laengeA breiteB laengeB)
; benötigte Variablen bereitstellen
(define distanzLaengeRad (calculateDistanceLengthRad laengeA laengeB))
(define breiteARad (degreeToRadian breiteA))
(define breiteBRad (degreeToRadian breiteB))
(define dG (calculateDG breiteARad breiteBRad distanzLaengeRad))
; cos alpha r errechnen
(define cosAlphaR (/
(- (sin breiteBRad)
(* (cos dG)
(sin breiteARad)
)
)
(* (cos breiteARad)
(sin dG)
)
)
)
; alpha R bestimmen und in Grad umrechnen.
(define alphaR (acos cosAlphaR))
(define alphaRGrad (radianToDegree alphaR))
; bestimmen, ob Kurs nach Osten geht
(define isEastboundA (if (> laengeB laengeA) true false))
(define checkNecessary (> 0
(* laengeA
laengeB)
)
)
; überprüfen, ob offensichtliche Richtung tatsächlich kürzer ist
(define isEastbound (if checkNecessary
(if (> (- 360
(+ (abs laengeB)
(abs laengeA)
)
)
(+ (abs laengeB)
(abs laengeA)
)
)
isEastboundA
(not isEastboundA)
)
isEastboundA
)
)
; abhängig von der Richtung den Kurswinkel bestimmen
(if isEastbound alphaRGrad (- 360
alphaRGrad)
)
)
; ausrechnen der Kurswinkel auf den angegebenen Routen
(display "Kurswinkel Oslo - Hongkong: ")
(kurswinkel 59.93 10.75 22.2 114.1)
(display "Kurswinkel San Francisco - Honolulu: ")
(kurswinkel 37.75 -122.45 21.32 -157.83)
(display "Kurswinkel Osterinsel - Lima: ")
(kurswinkel -27.1 -109.4 -12.1 -77.05)
; 2.3
; winkelGrad darf maximal eine Nachkommastelle haben und muss in Grad
; angegeben sein
(define (gradToHimmelsrichtung winkelGrad)
; N=0,NNE=22.5,NE=45,ENE=67.5,E=90,ESE=112.5,SE=135,SSE=157.5,S=180
; SSW=202.5,SW=225,WSW=247.5,W=270,WNW=292.5,NW=315,NNW=337.5,N=360
; ein Kurswinkel ist also immer maximal 11.25 Grad von der nächsten fest
; definierten Himmelsrichtung entfernt
(define winkelGradModuloReady (* 10 winkelGrad))
(define abstand (/ (modulo winkelGradModuloReady 225) 10.0))
(define aufrunden (>= abstand 11.25))
(define richtungGrad1 (- winkelGrad abstand))
(define richtungGrad (if aufrunden
(+ richtungGrad1 22.5)
richtungGrad1
)
)
(case richtungGrad
[(0) "N"]
[(22.5) "NNE"]
[(45) "NE"]
[(67.5) "ENE"]
[(90) "E"]
[(112.5) "ESE"]
[(135) "SE"]
[(157.5) "SSE"]
[(180) "S"]
[(202.5) "SSW"]
[(225) "SW"]
[(247.5) "WSW"]
[(270) "W"]
[(292.5) "WNW"]
[(315) "NW"]
[(337.5) "NNW"]
[(360) "N"]
)
)
; ausgeben der Himmelsrichtungen für die eben berechneten Kurswinkel
(display "Flugrichtung Oslo - Hongkong: ")
(gradToHimmelsrichtung 67.4)
(display "Flugrichtung San Francisco - Honolulu: ")
(gradToHimmelsrichtung 251.8)
(display "Flugrichtung Osterinsel - Lima: ")
(gradToHimmelsrichtung 70.0)
; richtung muss als String in Form einer Himmelsrichtung gegeben werden
(define (himmelsrichtungToGrad richtung)
(case richtung
[("N") 0]
[("NNE") 22.5]
[("NE") 45]
[("ENE") 67.5]
[("E") 90]
[("ESE") 112.5]
[("SE") 135]
[("SSE") 157.5]
[("S") 180]
[("SSW") 202.5]
[("SW") 225]
[("WSW") 247.5]
[("W") 270]
[("WNW") 292.5]
[("NW") 315]
[("NNW") 337.5]
)
)

View File

@ -0,0 +1,136 @@
\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
%\usepackage{paralist}
\useoutertheme{infolines}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{listings}
\usetheme{Berkeley}
\pagenumbering{arabic}
\def\thesection{\arabic{section})}
\def\thesubsection{\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
\setbeamertemplate{navigation symbols}{}
\graphicspath{ {src/} }
\lstset{language=PHP}
\begin{document}
\author{Jim Martens}
\title{Warum sich ein eigenes CMS lohnt}
\section{Situation}
\begin{frame}{Situation}
\begin{itemize}
\item Wordpress erhielt 2009 den Overall Best Open Source CMS Award
\item 2010 folgte Hall of Fame CMS
\item gilt als eines der beliebtesten CMS weltweit
\end{itemize}
\end{frame}
\begin{frame}
\centering
Warum man dennoch ein eigenes CMS schreiben sollte?
\end{frame}
\begin{frame}[fragile]{Darum}
aus wp-login.php Zeile 207 ff. (etwas HTML ausgelassen, gekennzeichnet durch Kommentar)
\begin{lstlisting}
function login_footer($input_id = '') {
global $interim_login;
if ( ! $interim_login ): ?>
<p id="backtoblog"><!-- something --></p>
<?php endif; ?>
\end{lstlisting}
\end{frame}
\begin{frame}
\centering
Warum ist der gezeigte Code nicht so toll?
\end{frame}
\begin{frame}{Deswegen}
\begin{itemize}
\item \texttt{global} is Bad Practice
\begin{itemize}
\item stammt aus PHP 4 Zeiten
\item nicht objektorientiert
\end{itemize}
\item keine Trennung zwischen Businesslogik und Ausgabe
\end{itemize}
\end{frame}
\section{Verbesserung}
\begin{frame}
\centering
Wie kann man es besser machen?
\end{frame}
\begin{frame}{So kann man es besser machen}
\begin{itemize}
\item OOP-Framework wie Symfony 2 nutzen
\begin{itemize}
\item[$\rightarrow$] klare Trennung zwischen Businesslogik und Ausgabe
\item[$\rightarrow$] Object-Relational Mapping (Doctrine)
\item[$\rightarrow$] Templateengine (Twig)
\item[$\rightarrow$] Dependency Management (Composer)
\item[$\rightarrow$] einfache Konfigurierbarkeit
\item[$\rightarrow$] Unterstützung für Unit- und Integrationstests (PHPUnit)
\item[$\rightarrow$] hohe Code Coverage der Unittests
\end{itemize}
\end{itemize}
\end{frame}
\section{Call for Action}
\begin{frame}
\centering
Warum erzähle ich euch das eigentlich alles?
\end{frame}
\begin{frame}{Planung}
\begin{itemize}
\item habe bereits ein CMS auf Basis des WoltLab Community Framework (WCF) entwickelt
\item das wird vsl. Januar/Februar RC-Status erreichen (Betaseite: beta.plugins-zum-selberbauen.de)
\item nächstes Projekt: WCF-Funktionen mit Symfony mergen
\begin{itemize}
\item ACP, Paketsystem, einfache Installation
\item Mehrsprachigkeit, User und Benutzergruppen
\item flexibles Stilsystem, Event Listener
\end{itemize}
\item und dann, ja dann: CMS mit Symfony und WCF-Erweiterungen
\end{itemize}
\end{frame}
\begin{frame}
\centering
Warum interessiert euch das?
\end{frame}
\begin{frame}{Anforderungsprofil}
\begin{itemize}
\item praktische Erfahrung sammeln mit OOP-Entwicklung
\item Voraussetzungen: PHP-Kenntnis (>= 5.3), OOP-Kenntnis, Bereitschaft sich einzuarbeiten, Coding-Standards einhalten
\item Git als VCS (github.com/frmwrk123/symfony-wcf)
\item Lizenz: LGPL
\item keine Zeitvorgabe - it's done when it's done
\end{itemize}
\end{frame}
\section{Fertig}
\begin{frame}{Ich habe fertig}
\centering
Vielen Dank für Eure Aufmerksamkeit!
\end{frame}
\section{Quellen}
\begin{frame}{Quellen}
\begin{itemize}
\item http://webdesign.about.com/b/2010/11/22/wordpress-wins-best-cms-award.html
\item http://wordpress.org/news/2009/11/wordpress-wins-cms-award/
\item http://symfony.com/doc/master
\end{itemize}
\end{frame}
\end{document}