mirror of
https://github.com/2martens/uni.git
synced 2026-05-07 03:46:25 +02:00
Compare commits
37 Commits
opti_blatt
...
ad_blatt_5
| Author | SHA1 | Date | |
|---|---|---|---|
| dad77a8dff | |||
| d013e0533e | |||
| 5bdf5a2487 | |||
| f5e1a36683 | |||
| 6507d7a749 | |||
| eb6256a57f | |||
| a324b8291d | |||
| 6afc457d64 | |||
| f768bb15bf | |||
| f589ab47c7 | |||
| 2b0d06f6ea | |||
| 300490a93b | |||
| abf82e25d7 | |||
| d7c4eed8f1 | |||
| 36556eb9b4 | |||
| a051729612 | |||
| 3b2a28a11d | |||
| 9913b6fc95 | |||
| 7818e3b603 | |||
| 88562703a2 | |||
| da05933c8d | |||
| 4cbbe10194 | |||
| 99ca499a0a | |||
| 4d8389eba9 | |||
| a6ed748153 | |||
| 758f40ea1f | |||
| 26fda0ddb4 | |||
| 347f0584a0 | |||
| 240dd113ab | |||
| 7fb91df76f | |||
| 542da545e2 | |||
| 8743f36082 | |||
| 02da1f0144 | |||
| 44ab3e4e0b | |||
| 7913205597 | |||
| 1f552564c9 | |||
| b3df21b7d1 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -26,6 +26,7 @@
|
||||
*.pdf
|
||||
*.pdfsync
|
||||
*.ps
|
||||
*.pyg
|
||||
*.snm
|
||||
*.synctex.gz
|
||||
*.toc
|
||||
|
||||
11
README.md
11
README.md
@ -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.
|
||||
|
||||
@ -137,16 +137,19 @@ Jim Martens (6420323)}
|
||||
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
|
||||
return (valid && (farben.getAnzahl() == 2))
|
||||
}
|
||||
\end{verbatim}
|
||||
\subsubsection{} %iii
|
||||
@ -228,7 +231,21 @@ Jim Martens (6420323)}
|
||||
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}
|
||||
@ -251,10 +268,35 @@ Jim Martens (6420323)}
|
||||
\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
|
||||
|
||||
300
ad/AD-Gruppe_8_Koehler_Krabbe_Martens_Blatt5.tex
Normal file
300
ad/AD-Gruppe_8_Koehler_Krabbe_Martens_Blatt5.tex
Normal file
@ -0,0 +1,300 @@
|
||||
\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}
|
||||
\usepackage{minted}
|
||||
\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
|
||||
Dieser folgende Pseudocode beschreibt eine leichte Abänderung, die vorzeitig abbricht, wenn sich nach einem kompletten Durchlauf aller Kanten nichts geändert hat. Nach $m$ Durchläufen hat der Algorithmus alle kürzeste Pfade mit maximal $m$ Kanten entdeckt. In einem weiteren Durchlauf wird sich dann nichts mehr ändern, da keine neuen kürzesten Pfade mehr gefunden werden können, wodurch die geänderte Variante abbricht. Um die Abbruchbedingung zu erreichen muss $m$ nicht bekannt sein, da nach $m+1$ Durchläufen die Abbruchbedingung immer gegeben ist.
|
||||
\begin{minted}{python}
|
||||
function BellmanFord(G,s)
|
||||
InitializeSingleSource(G,s)
|
||||
for i = 1, ... |V| - 1
|
||||
changed = false
|
||||
for all edges (u,v) in E
|
||||
changedTmp = Relax(u,v)
|
||||
if (!changed)
|
||||
changed = changedTmp
|
||||
if (!changed)
|
||||
break
|
||||
for all edges (u,v) in E
|
||||
if v.dist > u.dist + w(u,v)
|
||||
return false
|
||||
return true
|
||||
\end{minted}
|
||||
% \begin{verbatim}
|
||||
% function BellmanFord(G,s)
|
||||
% InitializeSingleSource(G,s)
|
||||
% for i = 1, ... |V| - 1
|
||||
% changed = false
|
||||
% for all edges (u,v) in E
|
||||
% changedTmp = Relax(u,v)
|
||||
% if (!changed)
|
||||
% changed = changedTmp
|
||||
% if (!changed)
|
||||
% break
|
||||
% for all edges (u,v) in E
|
||||
% if v.dist > u.dist + w(u,v)
|
||||
% return false
|
||||
% return true
|
||||
% \end{verbatim}
|
||||
\section{} %2
|
||||
\begin{minted}{python}
|
||||
function DAG-SP(G,s)
|
||||
sort vertices topologically
|
||||
InitializeSingleSource(G,s)
|
||||
for each u in V in topological sort order
|
||||
for each v in Adj(u)
|
||||
Relax(u,v)
|
||||
\end{minted}
|
||||
% \begin{verbatim}
|
||||
% function DAG-SP(G,s)
|
||||
% sort vertices topologically
|
||||
% InitializeSingleSource(G,s)
|
||||
% for each u in V in topological sort order
|
||||
% for each v in Adj(u)
|
||||
% Relax(u,v)
|
||||
% \end{verbatim}
|
||||
\section{} %3
|
||||
Wir wissen, dass der Dijkstra-Algorithmus für rein positive Kantengewichte funktioniert. Es bleibt also nur zu zeigen, dass die kürzesten Wege zu den Knoten korrekt berechnet werden, die eine Kante von dem Startknoten entfernt sind. Ferner ist bekannt, dass Dijkstra zuerst den Knoten besucht, der am billigsten zu erreichen ist. Damit geht der Algorithmus die Kante mit dem kleinsten Gewicht zu erst (einschließlich negative Gewichte). Der somit erreichte Knoten kann also gar nicht billiger zu erreichen sein, da jeder andere Pfad dorthin aus mindestens zwei Kanten besteht, die zusammen bestenfalls das gleiche Gewicht haben wie die gegangene Kante.
|
||||
|
||||
Dies ist so, da die erste Kante vom Startknoten zu einem anderen Knoten minimal so klein sein kann, wie die zuerst gegangene Kante, da andernfalls die zuerst gegangene Kante nicht das geringste Gewicht gehabt hätte. Die zweite Kante muss mindestens 0 als Gewicht haben, womit nur ein gleich großes oder größeres Gesamtgewicht entstehen kann, als durch die zuerst gegangene Kante verwendet wurde.
|
||||
\section{} %4
|
||||
\subsection{} %a
|
||||
In einem Baum gibt es keine Zyklen. Daher gibt es genau einen direkten Weg (ohne Umwege mit mehrmaligem Besuchen eines Knotens) zu jedem Knoten von dem Wurzelknoten aus. Demnach müssen einfach vom Wurzelknoten aus alle Knoten besucht werden. Dabei wird ähnlich wie in der Breitensuche vorgegangen, indem zunächst alle Knoten, die direkt mit dem Wurzelknoten per Kante verbunden sind, besucht werden und anschließend alle Knoten, die zwei Kanten vom Wurzelknoten entfernt sind, etc. Dabei wird eine Variable zu Beginn auf 0 gesetzt und bei jedem Knoten wird geschaut, ob seine Entfernung zum Wurzelknoten größer ist als diese Variable. Wenn dem so ist, dann wird die Variable entsprechend angepasst. Nach einmaligem Besuchen jedes Knotens hat man damit die längste Entfernung eines Knotens von dem Wurzelknoten ermittelt.
|
||||
|
||||
In Pseudocode sieht das dann so aus:
|
||||
|
||||
\begin{minted}{python}
|
||||
function berechneDurchmesser(G)
|
||||
longestPath = 0
|
||||
current = G.root
|
||||
queue.enqueue(current.getChilds())
|
||||
while (!empty(queue))
|
||||
current = queue.dequeue()
|
||||
parent = current.parent
|
||||
distance = parent.getDistance() + w(parent,current)
|
||||
current.setDistance(distance)
|
||||
if (distance > longestPath)
|
||||
longestPath = distance
|
||||
|
||||
childs = current.getChilds()
|
||||
if (!empty(childs))
|
||||
queue.enqueue(current.getChilds())
|
||||
\end{minted}
|
||||
% \begin{verbatim}
|
||||
% function berechneDurchmesser(G)
|
||||
% longestPath = 0
|
||||
% current = G.root
|
||||
% queue.enqueue(current.getChilds())
|
||||
% while (!empty(queue))
|
||||
% current = queue.dequeue()
|
||||
% parent = current.parent
|
||||
% distance = parent.getDistance() + w(parent,current)
|
||||
% current.setDistance(distance)
|
||||
% if (distance > longestPath)
|
||||
% longestPath = distance
|
||||
|
||||
% childs = current.getChilds()
|
||||
% if (!empty(childs))
|
||||
% queue.enqueue(current.getChilds())
|
||||
% \end{verbatim}
|
||||
\subsection{} %b
|
||||
\begin{minted}{python}
|
||||
def Durchmesser(G):
|
||||
laengsterWeg = 0
|
||||
for v1 in G.kanten:
|
||||
for v2 in G.kanten with v1 != v2:
|
||||
P = findeKuerzestenWeg(v1, v2)
|
||||
if P.laenge() > laengsterWeg:
|
||||
laengsterWeg = P.laenge()
|
||||
return laengsterWeg
|
||||
\end{minted}
|
||||
% \begin{verbatim}
|
||||
% Diam(G)
|
||||
% longestPath = 0
|
||||
% for each v1 in G.vertices
|
||||
% for each v2 in G.vertices with v1 != v2
|
||||
% find shortest path P from v1 to v2
|
||||
% if P.length > longestPath
|
||||
% longestPath = P.length
|
||||
% return longestPath
|
||||
% \end{verbatim}
|
||||
|
||||
Die Laufzeit dieses Algorithmus beträgt $\mathcal{O}(|V|^3)$.
|
||||
\section{} %5
|
||||
\subsection{} %a
|
||||
Man konstruiert einen vollständigen Graphen aus der Matrix, in welchem die Knoten Währungen repräsentieren, und als Kantengewichte die Werte verwendet werden.
|
||||
Gibt es nun in diesem Graphen einen Zyklus, in dem das Produkt aller Kantengewichte ungleich 1 ist, existiert Währungsarbitrage. Ansonsten ist dies nicht der Fall.
|
||||
\subsection{} %b
|
||||
Nein, unsere Lösung kann nicht zu negativen Zyklen führen, denn dafür müssten negative Werte in der Matrix vorhanden sein.
|
||||
Würden solche Zyklen existieren, bedeuteten sie, man verliere all sein Geld bei einem Tausch, und müsste außerdem eine Strafe zahlen.
|
||||
\section{} %6
|
||||
\begin{tikzpicture}[shorten >=1pt,node distance=1.1cm]
|
||||
\node[state] (s) {s};
|
||||
\node[state] (a) [above right=1.5 and 1.0 of s] {A};
|
||||
\node[state] (b) [below right=1.5 and 1.0 of s] {B};
|
||||
\node[state] (d) [above right=1.0 and 1.0 of a] {D};
|
||||
\node[state] (c) [right=of a] {C};
|
||||
\node[state] (f) [below right=1.0 and 1.25 of a] {F};
|
||||
\node[state] (e) [right=1.0 of c] {E};
|
||||
\node[state] (g) [right=of f] {G};
|
||||
|
||||
\path[every node/.style={font=\scriptsize},->]
|
||||
(s) edge node [above] {30} (a)
|
||||
(s) edge node [below] {18} (b)
|
||||
(a) edge node [above] {21} (c)
|
||||
(a) edge node [above] {38} (d)
|
||||
(a) edge node [below] {22} (f)
|
||||
(c) edge node [right] {22} (f)
|
||||
(c) edge node [above] {20} (e)
|
||||
(f) edge node [above] {9} (g)
|
||||
(b) edge node [left] {30} (a);
|
||||
\end{tikzpicture}
|
||||
|
||||
Da dies ein gerichteter Graph ohne Zyklen ist und auch keine negativen Kantengewichte vorkommen, kann der Dijkstra-Algorithmus angewendet werden. Da von 9 bis 17 Uhr Fahrer bezahlt werden müssen, kommen nur die Pfade in Betrachtung, die zu einer Senke führen. Senken sind D, E und G. Derjenige dieser Knoten welcher als erster vom Algorithmus gefunden wird (über den eindeutig bestimmbaren Weg), ist auch der kürzeste Pfad vom Startknoten aus, der die Bedingungen erfüllt.
|
||||
|
||||
Es ergibt sich folgende Abfolge:
|
||||
\begin{verbatim}
|
||||
S = {s}
|
||||
d(s) = 0
|
||||
while 1.
|
||||
U = {A, B}
|
||||
for all u in U -> u = A
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = s
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 0 + 30
|
||||
for all u in U -> u = B
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = s
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 0 + 18
|
||||
u* = B
|
||||
d(u*) = 18
|
||||
S = {s, B}
|
||||
while 2.
|
||||
U = {A}
|
||||
for all u in U -> u = A
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = s
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 0 + 30
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = B
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 18 + 30
|
||||
u* = A
|
||||
d(u*) = 30
|
||||
S = {S, B, A}
|
||||
while 3.
|
||||
U = {D, C, F}
|
||||
for all u in U -> u = D
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 38
|
||||
for all u in U -> u = C
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 21
|
||||
for all u in U -> u = F
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 22
|
||||
u* = C
|
||||
d(u*) = 51
|
||||
S = {s, B, A, C}
|
||||
while 4.
|
||||
U = {D, F, E}
|
||||
for all u in U -> u = D
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 38
|
||||
for all u in U -> u = F
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 22
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = C
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 51 + 22
|
||||
for all u in U -> u = E
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = C
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 51 + 20
|
||||
u* = F
|
||||
d(u*) = 52
|
||||
S = {s, B, A, C, F}
|
||||
while 5.
|
||||
U = {D, E, G}
|
||||
for all u in U -> u = D
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 38
|
||||
for all u in U -> u = E
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = C
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 51 + 20
|
||||
for all u in U -> u = G
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = F
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 52 + 9
|
||||
u* = G
|
||||
d(u*) = 61
|
||||
S = {s, B, A, C, F, G}
|
||||
while 6.
|
||||
U = {D, E}
|
||||
for all u in U -> u = D
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 38
|
||||
for all u in U -> u = E
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = C
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 51 + 22
|
||||
u* = D
|
||||
d(u*) = 68
|
||||
S = {s, B, A, C, F, G, D}
|
||||
while 7.
|
||||
U = {E}
|
||||
for all u in U -> u = E
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = C
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 51 + 20
|
||||
u* = E
|
||||
d(u*) = 71
|
||||
S = {s, B, A, C, F, G, D, E}
|
||||
\end{verbatim}
|
||||
|
||||
Wie zu sehen ist wird die Senke G zuerst erreicht. Folgt man dem Weg zu G, so ergibt sich, dass der kürzeste Pfad von s über A und F nach G führt. Weniger Kosten als 61 sind daher nicht möglich.
|
||||
\end{document}
|
||||
206
gdb/G62B4_Dittrich-Lindemann-Martens.tex
Normal file
206
gdb/G62B4_Dittrich-Lindemann-Martens.tex
Normal file
@ -0,0 +1,206 @@
|
||||
\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),
|
||||
CONSTRAINT fk_rennfahrer FOREIGN KEY (RID)
|
||||
REFERENCES Rennfahrer (RID) ON DELETE CASCADE,
|
||||
CONSTRAINT fk_rennort FOREIGN KEY (OID)
|
||||
REFERENCES Rennort (OID) ON DELETE CASCADE
|
||||
);
|
||||
\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 (sel2) [below=2.0 of sel] {$\sigma_{Obst.ONR=Person.Lieblingsobst}$};
|
||||
\node (catProd) [below=2.0 of sel2] {x};
|
||||
\node (person) [below left=2.0 and 2.0 of catProd] {Person};
|
||||
\node (obst) [below right=2.0 and 2.0 of catProd] {Obst};
|
||||
\path (proj) edge node [right] {400} (sel)
|
||||
(sel) edge node [right] {2000} (sel2)
|
||||
(sel2) edge node [right] {50000} (catProd)
|
||||
(catProd) edge node [left] {2000} (person)
|
||||
(catProd) 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 und das kartesische Produkt und die zweite Selektion zu einem Join verbunden wurde.
|
||||
\end{document}
|
||||
@ -107,8 +107,7 @@
|
||||
font=\footnotesize,
|
||||
},
|
||||
erbt/.style={
|
||||
isosceles triangle, isosceles triangle apex angle=60,
|
||||
shape border rotate=-90,
|
||||
regular polygon, regular polygon sides=6,
|
||||
draw, black, very thick, minimum size=3em
|
||||
},
|
||||
% Layout fuer referenzgraphen
|
||||
|
||||
296
mk/VortragElektronischeDemokratie.tex
Normal file
296
mk/VortragElektronischeDemokratie.tex
Normal 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}
|
||||
14
mk/feedback.txt
Normal file
14
mk/feedback.txt
Normal file
@ -0,0 +1,14 @@
|
||||
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
|
||||
* mehr Strukturierung im Vortrag (eigenes Feedback) -> sonst zu schnell fertig und zu viel Ausgedachtes
|
||||
* Überblick mithilfe von unterschiedlichen Quellen zur Verfügung stellen
|
||||
* Klare Differenzierung zwischen E-Democracy und E-Government
|
||||
* sinnvolle Beispiele (was hat Star Citizen/Crowdfunding auch nur annähernd mit der vorgestellten Elektronischen Demokratie zu tun?)
|
||||
@ -267,7 +267,7 @@
|
||||
% Insbesondere stehen die eigentlichen Informationen in der Datei
|
||||
% ``bib.bib''
|
||||
%
|
||||
\clearpage
|
||||
%\clearpage
|
||||
\bibliography{bib}
|
||||
\bibliographystyle{ieeetr}
|
||||
\addcontentsline{toc}{section}{Literatur}% Add to the TOC
|
||||
|
||||
117
optimierung/Uebungsblatt10.tex
Normal file
117
optimierung/Uebungsblatt10.tex
Normal file
@ -0,0 +1,117 @@
|
||||
\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}
|
||||
\usepackage{multirow}
|
||||
\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 6. Januar}
|
||||
\maketitle
|
||||
\section{} %1
|
||||
\section{} %2
|
||||
\subsection{} %a
|
||||
\begin{alignat*}{9}
|
||||
\text{minimiere}\; & 67w &+& 120k &+& 100h &+& 60f &+& 97b &+& 124n &+& 22s &+& 62m && \\
|
||||
\multicolumn{18}{l}{\text{unter den Nebenbedingungen}} && \\
|
||||
& 8w &+& 25k &+& 30h &+& 22f &+& 3b &+& 8n &+& 6s && &\geq &\, 75 \\
|
||||
& w &+& 35k &+& 8h &+& f && &+& 33n &+& 13s &+& 98m &\geq &\, 90 \\
|
||||
& 54w && && && &+& 42b &+& 4n &+& 63s && &\geq &\, 300 \\
|
||||
\multicolumn{16}{r}{$w, k, h, f, b, n, s, m$} \,&\geq &\, 0
|
||||
\end{alignat*}
|
||||
\subsection{} %b
|
||||
In das verlinkte Tool wird folgendes eingegeben:
|
||||
\begin{verbatim}
|
||||
Minimize p = 67w + 120k + 100h + 60f + 97b + 124n + 22s + 62m subject to
|
||||
8w + 25k + 30h + 22f + 3b + 8n + 6s + 0m >= 75
|
||||
w + 35k + 8h + f + 0b + 33n + 13s + 98m >= 90
|
||||
54w + 0k + 0h + 0f + 42b + 4n + 63s + 0m >= 300
|
||||
w >= 0
|
||||
k >= 0
|
||||
h >= 0
|
||||
f >= 0
|
||||
b >= 0
|
||||
n >= 0
|
||||
s >= 0
|
||||
m >= 0
|
||||
\end{verbatim}
|
||||
Die Ausgabe ist:
|
||||
\begin{verbatim}
|
||||
Optimal Solution: p = 6801/28; w = 0, k = 0, h = 0, f = 87/56,
|
||||
b = 0, n = 0, s = 381/56, m = 0
|
||||
\end{verbatim}
|
||||
\subsection{} %c
|
||||
In das verlinkte Tool wird folgendes eingegeben:
|
||||
\begin{verbatim}
|
||||
Minimize p = 3x1 + 24x2 + 13x3 + 9x4 + 20x5 + 19x6 subject to
|
||||
110x1 + 205x2 + 160x3 + 160x3 + 420x5 + 260x6 >= 2000
|
||||
4x1 + 32x2 + 13x3 + 8x4 + 4x5 + 14x6 >= 55
|
||||
2x1 + 12x2 + 54x3 + 285x4 + 22x5 + 80x6 >= 800
|
||||
x1 <= 4
|
||||
x2 <= 3
|
||||
x3 <= 2
|
||||
x4 <= 8
|
||||
x5 <= 2
|
||||
x6 <= 2
|
||||
x1 >= 0
|
||||
x2 >= 0
|
||||
x3 >= 0
|
||||
x4 >= 0
|
||||
x5 >= 0
|
||||
x6 >= 0
|
||||
\end{verbatim}
|
||||
Die Ausgabe ist:
|
||||
\begin{verbatim}
|
||||
Optimal Solution: p = 46621/380; x1 = 4, x2 = 0, x3 = 5/4,
|
||||
x4 = 347/190, x5 = 2, x6 = 2
|
||||
\end{verbatim}
|
||||
\subsection{} %d
|
||||
In das verlinkte Tool wird folgendes eingegeben:
|
||||
\begin{verbatim}
|
||||
Maximize p = 8a1 + 3a2 + 6b1 + 3b2 + 9c1 + 5c2 subject to
|
||||
a1 + a2 <= 400
|
||||
b1 + b2 <= 480
|
||||
c1 + c2 <= 230
|
||||
a1 + b1 + c1 <= 420
|
||||
a2 + b2 + c2 <= 250
|
||||
a1 >= 0
|
||||
a2 >= 0
|
||||
b1 >= 0
|
||||
b2 >= 0
|
||||
c1 >= 0
|
||||
c2 >= 0
|
||||
\end{verbatim}
|
||||
Die Ausgabe ist:
|
||||
\begin{verbatim}
|
||||
Optimal Solution: p = 4550; a1 = 400, a2 = 0, b1 = 0, b2 = 40,
|
||||
c1 = 20, c2 = 210
|
||||
\end{verbatim}
|
||||
\end{document}
|
||||
285
optimierung/Uebungsblatt8.tex
Normal file
285
optimierung/Uebungsblatt8.tex
Normal 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{1}{40}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{1}{40}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}
|
||||
561
optimierung/Uebungsblatt9.tex
Normal file
561
optimierung/Uebungsblatt9.tex
Normal file
@ -0,0 +1,561 @@
|
||||
\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}
|
||||
\usepackage{multirow}
|
||||
\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 16. Dezember}
|
||||
\maketitle
|
||||
\section{} %1
|
||||
\subsection{} %a
|
||||
\begin{alignat*}{3}
|
||||
\text{maximiere}\; & 2x_{1} \,&+&\, 3x_{2} && \\
|
||||
\multicolumn{6}{l}{\text{unter den Nebenbedingungen}} && \\
|
||||
\;& x_{1} \,&-&\, 4x_{2} \,&\leq & 2 \\
|
||||
\;& x_{1} \,&&\, \,&\leq & 5 \\
|
||||
\;& \,&&\, x_{2} \,&\leq & 8 \\
|
||||
\multicolumn{4}{r}{$x_{1}, x_{2}$} \,&\geq &\, 0
|
||||
\end{alignat*}
|
||||
|
||||
\underline{Eingangsdaten}:
|
||||
\begin{alignat*}{2}
|
||||
A &=& \begin{pmatrix}
|
||||
x_{1} & x_{2} & x_{3} & x_{4} & x_{5} \\
|
||||
1 & -4 & 1 & 0 & 0 \\
|
||||
1 & 0 & 0 & 1 & 0 \\
|
||||
0 & 1 & 0 & 0 & 1
|
||||
\end{pmatrix} \\
|
||||
c^{T} &=& \begin{pmatrix}
|
||||
x_{1} & x_{2} & x_{3} & x_{4} & x_{5} \\
|
||||
2 & 3 & 0 & 0 & 0
|
||||
\end{pmatrix} \\
|
||||
b &=& \begin{pmatrix}
|
||||
2 \\
|
||||
5 \\
|
||||
8
|
||||
\end{pmatrix}
|
||||
\end{alignat*}
|
||||
|
||||
\underline{Initialisierung}:
|
||||
\begin{alignat*}{2}
|
||||
x_{B}^{*} &=& \begin{pmatrix}
|
||||
x_{3}^{*} \\
|
||||
x_{4}^{*} \\
|
||||
x_{5}^{*}
|
||||
\end{pmatrix}
|
||||
=
|
||||
\begin{pmatrix}
|
||||
2 \\
|
||||
5 \\
|
||||
8
|
||||
\end{pmatrix} \\
|
||||
B &=& \begin{pmatrix}
|
||||
x_{3} & x_{4} & x_{5} \\
|
||||
1 & 0 & 0 \\
|
||||
0 & 1 & 0 \\
|
||||
0 & 0 & 1
|
||||
\end{pmatrix}
|
||||
\end{alignat*}
|
||||
|
||||
\underline{1. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 0 & 0 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{3}
|
||||
y_{1} & & &=& 0 \\
|
||||
& y_{2} & &=& 0 \\
|
||||
& & y_{3} &=& 0
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 0 & 0 & 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{1} & x_{2} \\ 1 & -4 \\ 1 & 0 \\ 0 & 1 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 0 & 0 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 2 & 3 \end{pmatrix}$. Also kommt jede Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} -4 \\ 0 \\ 1 \end{pmatrix}$; die Eingangsvariable ist $x_{2}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{3}
|
||||
d_{1} & & &=& -4 \\
|
||||
& d_{2} & &=& 0 \\
|
||||
& & d_{3} &=& 1
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix}-4 \\ 0 \\ 1 \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 2 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}-4 \\ 0 \\ 1 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 8$; für $t = 8$ gilt $\begin{pmatrix} 2 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}-4 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 34 \\ 5 \\ 0 \end{pmatrix}$, Ausgangsvariable ist $x_{5}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{3}^{*} \\ x_{4}^{*} \\ x_{2}^{*} \end{pmatrix} = \begin{pmatrix} 34 \\ 5 \\ 8 \end{pmatrix}$ und $B = \begin{pmatrix} x_{3} & x_{4} & x_{2} \\ 1 & 0 & -4 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$.
|
||||
|
||||
\underline{2. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 2 & 0 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{4}
|
||||
y_{1} && &-& 4y_{3} &=& 34 \\
|
||||
&& y_{2} && &=& 5 \\
|
||||
&& && y_{3} &=& 8
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 66 & 5 & 8 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{1} & x_{5} \\ 1 & 0 \\ 1 & 0 \\ 0 & 1 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 71 & 8 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 2 & 0 \end{pmatrix}$. Also kommt nur die erste Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 1 \\ 1 \\ 0 \end{pmatrix}$; die Eingangsvariable ist $x_{1}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{4}
|
||||
d_{1} && &-& 4d_{3} &=& 1 \\
|
||||
&& d_{2} && &=& 1 \\
|
||||
&& && d_{3} &=& 0
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix}1 \\ 1 \\ 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 34 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}1 \\ 1 \\ 0 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 5$; für $t = 5$ gilt $\begin{pmatrix} 34 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}1 \\ 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 29 \\ 0 \\ 8 \end{pmatrix}$, Ausgangsvariable ist $x_{4}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{3}^{*} \\ x_{1}^{*} \\ x_{2}^{*} \end{pmatrix} = \begin{pmatrix} 29 \\ 5 \\ 8 \end{pmatrix}$ und $B = \begin{pmatrix} x_{3} & x_{1} & x_{2} \\ 1 & 1 & -4 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$.
|
||||
|
||||
\underline{3. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 0 & 2 & 3 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{4}
|
||||
y_{1} && && &=& 0 \\
|
||||
y_{1} &+& y_{2} && &=& 2 \\
|
||||
-4y_{1} && &+& y_{3} &=& 3
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 0 & 2 & 3 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{4} & x_{5} \\ 0 & 0 \\ 1 & 0 \\ 0 & 1 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 2 & 3 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 0 \end{pmatrix}$. Wegen $2 \geq 0, 3 \geq 0$ ist die aktuelle Lösung optimal. Die optimale Lösung lautet $x_{1}^{*} = 5, x_{2}^{*} = 8$ mit $z^{*} = 2x_{1}^{*} + 3x_{2}^{*} = 34$.
|
||||
\subsection{} %b
|
||||
\begin{alignat*}{4}
|
||||
\text{maximiere}\; & 3x_{1} \,&+&\, 2x_{2} \,&+&\, 2x_{3} && \\
|
||||
\multicolumn{8}{l}{\text{unter den Nebenbedingungen}} && \\
|
||||
\;& x_{1} \,&&\, \,&+&\, x_{3} \,&\leq & 8 \\
|
||||
\;& x_{1} \,&+&\, x_{2} \,&&\, \,&\leq & 7 \\
|
||||
\;& x_{1} \,&+&\, 2x_{2} \,&&\, \,&\leq & 12 \\
|
||||
\multicolumn{6}{r}{$x_{1}, x_{2}, x_{3}$} \,&\geq &\, 0
|
||||
\end{alignat*}
|
||||
|
||||
\underline{Eingangsdaten}:
|
||||
\begin{alignat*}{2}
|
||||
A &=& \begin{pmatrix}
|
||||
x_{1} & x_{2} & x_{3} & x_{4} & x_{5} & x_{6} \\
|
||||
1 & 0 & 1 & 1 & 0 & 0 \\
|
||||
1 & 1 & 0 & 0 & 1 & 0\\
|
||||
1 & 2 & 0 & 0 & 0 & 1
|
||||
\end{pmatrix} \\
|
||||
c^{T} &=& \begin{pmatrix}
|
||||
x_{1} & x_{2} & x_{3} & x_{4} & x_{5} & x_{6} \\
|
||||
3 & 2 & 2 & 0 & 0 & 0
|
||||
\end{pmatrix} \\
|
||||
b &=& \begin{pmatrix}
|
||||
8 \\
|
||||
7 \\
|
||||
12
|
||||
\end{pmatrix}
|
||||
\end{alignat*}
|
||||
|
||||
\underline{Initialisierung}:
|
||||
\begin{alignat*}{2}
|
||||
x_{B}^{*} &=& \begin{pmatrix}
|
||||
x_{4}^{*} \\
|
||||
x_{5}^{*} \\
|
||||
x_{6}^{*}
|
||||
\end{pmatrix}
|
||||
=
|
||||
\begin{pmatrix}
|
||||
8 \\
|
||||
7 \\
|
||||
12
|
||||
\end{pmatrix} \\
|
||||
B &=& \begin{pmatrix}
|
||||
x_{4} & x_{5} & x_{6} \\
|
||||
1 & 0 & 0 \\
|
||||
0 & 1 & 0 \\
|
||||
0 & 0 & 1
|
||||
\end{pmatrix}
|
||||
\end{alignat*}
|
||||
|
||||
\underline{1. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 0 & 0 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{3}
|
||||
y_{1} & & &=& 0 \\
|
||||
& y_{2} & &=& 0 \\
|
||||
& & y_{3} &=& 0
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 0 & 0 & 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{1} & x_{2} & x_{3} \\ 1 & 0 & 1 \\ 1 & 1 & 0 \\ 1 & 2 & 0 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 0 & 0 & 0 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 3 & 2 & 2 \end{pmatrix}$. Also kommt jede Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix}$; die Eingangsvariable ist $x_{1}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{3}
|
||||
d_{1} & & &=& 1 \\
|
||||
& d_{2} & &=& 1 \\
|
||||
& & d_{3} &=& 1
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix}1 \\ 1 \\ 1 \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 8 \\ 7 \\ 12\end{pmatrix} - t \begin{pmatrix}1 \\ 1 \\ 1 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 7$; für $t = 7$ gilt $\begin{pmatrix} 8 \\ 7 \\ 12\end{pmatrix} - t \begin{pmatrix}1 \\ 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 5 \end{pmatrix}$, Ausgangsvariable ist $x_{5}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{4}^{*} \\ x_{1}^{*} \\ x_{6}^{*} \end{pmatrix} = \begin{pmatrix} 1 \\ 7 \\ 5 \end{pmatrix}$ und $B = \begin{pmatrix} x_{4} & x_{1} & x_{6} \\ 1 & 1 & 0 \\ 0 & 1 & 0 \\ 0 & 1 & 1 \end{pmatrix}$.
|
||||
|
||||
\underline{2. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 0 & 3 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{4}
|
||||
y_{1} && && &=& 0 \\
|
||||
y_{1} &+& y_{2} &+& y_{3} &=& 3 \\
|
||||
&& && y_{3} &=& 0
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 0 & 3 & 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{5} & x_{2} & x_{3} \\ 0 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 2 & 0 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 3 & 3 & 0 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 2 & 2 \end{pmatrix}$. Also kommt nur die dritte Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}$; die Eingangsvariable ist $x_{3}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{4}
|
||||
d_{1} &+& d_{2} && &=& 1 \\
|
||||
&& d_{2} && &=& 0 \\
|
||||
&& d_{2} &+& d_{3} &=& 0
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix}1 \\ 0 \\ 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 1 \\ 7 \\ 5\end{pmatrix} - t \begin{pmatrix}1 \\ 0 \\ 0 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 1$; für $t = 1$ gilt $\begin{pmatrix} 1 \\ 7 \\ 5\end{pmatrix} - t \begin{pmatrix}1 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 7 \\ 5 \end{pmatrix}$, Ausgangsvariable ist $x_{4}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{3}^{*} \\ x_{1}^{*} \\ x_{6}^{*} \end{pmatrix} = \begin{pmatrix} 1 \\ 7 \\ 5 \end{pmatrix}$ und $B = \begin{pmatrix} x_{3} & x_{1} & x_{6} \\ 1 & 1 & 0 \\ 0 & 1 & 0 \\ 0 & 1 & 1 \end{pmatrix}$.
|
||||
|
||||
\underline{3. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 2 & 1 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{4}
|
||||
y_{1} && && &=& 2 \\
|
||||
y_{1} &+& y_{2} &+& y_{3} &=& 1 \\
|
||||
&& && y_{3} &=& 0
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 2 & -1 & 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{5} & x_{2} & x_{4} \\ 0 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 2 & 0 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} -1 & -1 & 2 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 2 & 0\end{pmatrix}$. Also kommen nur die ersten beiden Spalten von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 0 \\ 1 \\ 2 \end{pmatrix}$; die Eingangsvariable ist $x_{2}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{4}
|
||||
d_{1} &+& d_{2} && &=& 0\\
|
||||
&& d_{2} && &=& 1 \\
|
||||
&& d_{2} &+& d_{3} &=& 2
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix} -1 \\ 1 \\ 1 \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 1 \\ 7 \\ 5\end{pmatrix} - t \begin{pmatrix}-1 \\ 1 \\ 1 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 5$; für $t = 5$ gilt $\begin{pmatrix} 1 \\ 7 \\ 5\end{pmatrix} - t \begin{pmatrix} -1 \\ 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 6 \\ 2 \\ 0 \end{pmatrix}$, Ausgangsvariable ist $x_{6}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{3}^{*} \\ x_{1}^{*} \\ x_{2}^{*} \end{pmatrix} = \begin{pmatrix} 6 \\ 2 \\ 5 \end{pmatrix}$ und $B = \begin{pmatrix} x_{3} & x_{1} & x_{2} \\ 1 & 1 & 0 \\ 0 & 1 & 1 \\ 0 & 1 & 2 \end{pmatrix}$.
|
||||
|
||||
\underline{4. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 2 & 3 & 2 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{4}
|
||||
y_{1} && && &=& 2 \\
|
||||
y_{1} &+& y_{2} &+& y_{3} &=& 3 \\
|
||||
&& y_{2} &+& 2y_{3} &=& 2
|
||||
\end{alignat*}
|
||||
Es ergibt sich dieses LGS:
|
||||
\begin{alignat*}{3}
|
||||
I & y_{2} &+& y_{3} &=& 1 \\
|
||||
II & y_{2} &+& 2y_{3} &=& 2 \\
|
||||
II - I & && y_{3} &=& 1
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 2 & 0 & 1 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{5} & x_{6} & x_{4} \\ 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 0 & 1 & 2 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 0 & 0\end{pmatrix}$. Wegen $0 \geq 0, 1 \geq 0, 2 \geq 0$ ist die aktuelle Lösung optimal. Die optimale Lösung lautet $x_{1}^{*} = 2, x_{2}^{*} = 5, x_{3}^{*} = 6$ mit $z^{*} = 3x_{1}^{*} + 2x_{2}^{*} + 2x_{3}^{*} = 28$.
|
||||
\section{} %2
|
||||
\begin{alignat*}{5}
|
||||
\text{maximiere}\; & 5x_{1} \,&+&\, 6x_{2} \,&+&\, 9x_{3} \,&+&\, 8x_{4} && \\
|
||||
\multicolumn{10}{l}{\text{unter den Nebenbedingungen}} && \\
|
||||
\;& x_{1} \,&+&\, 2x_{2} \,&+&\, 3x_{3} \,&+&\, x_{4} \,&\leq & 5 \\
|
||||
\;& x_{1} \,&+&\, x_{2} \,&+&\, 2x_{3} \,&+&\, 3x_{4} \,&\leq & 3 \\
|
||||
\multicolumn{8}{r}{$x_{1}, x_{2}, x_{3}, x_{4}$} \,&\geq &\, 0
|
||||
\end{alignat*}
|
||||
|
||||
\underline{Eingangsdaten}:
|
||||
\begin{alignat*}{2}
|
||||
A &=& \begin{pmatrix}
|
||||
x_{1} & x_{2} & x_{3} & x_{4} & x_{5} & x_{6} \\
|
||||
1 & 2 & 3 & 1 & 1 & 0 \\
|
||||
1 & 1 & 2 & 3 & 0 & 1\\
|
||||
\end{pmatrix} \\
|
||||
c^{T} &=& \begin{pmatrix}
|
||||
x_{1} & x_{2} & x_{3} & x_{4} & x_{5} & x_{6} \\
|
||||
5 & 6 & 9 & 8 & 0 & 0
|
||||
\end{pmatrix} \\
|
||||
b &=& \begin{pmatrix}
|
||||
5 \\
|
||||
3
|
||||
\end{pmatrix}
|
||||
\end{alignat*}
|
||||
|
||||
\underline{Initialisierung}:
|
||||
\begin{alignat*}{2}
|
||||
x_{B}^{*} &=& \begin{pmatrix}
|
||||
x_{5}^{*} \\
|
||||
x_{6}^{*}
|
||||
\end{pmatrix}
|
||||
=
|
||||
\begin{pmatrix}
|
||||
5 \\
|
||||
3
|
||||
\end{pmatrix} \\
|
||||
B &=& \begin{pmatrix}
|
||||
x_{5} & x_{6} \\
|
||||
1 & 0 \\
|
||||
0 & 1
|
||||
\end{pmatrix}
|
||||
\end{alignat*}
|
||||
|
||||
\underline{1. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 0 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{2}
|
||||
y_{1} & &=& 0 \\
|
||||
& y_{2} &=& 0
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 0 & 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{1} & x_{2} & x_{3} & x_{4} \\ 1 & 2 & 3 & 1 \\ 1 & 1 & 2 & 3 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 0 & 0 & 0 & 0\end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 5 & 6 & 9 & 8 \end{pmatrix}$. Also kommt jede Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 3 \\ 2 \end{pmatrix}$; die Eingangsvariable ist $x_{3}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{2}
|
||||
d_{1} & &=& 3 \\
|
||||
& d_{2} &=& 2
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix}3 \\ 2 \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 5 \\ 3 \end{pmatrix} - t \begin{pmatrix}3 \\ 2 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = \frac{3}{2}$; für $t = \frac{3}{2}$ gilt $\begin{pmatrix} 5 \\ 3 \end{pmatrix} - t \begin{pmatrix}3 \\ 2 \end{pmatrix} = \begin{pmatrix} \frac{1}{2} \\ 0 \end{pmatrix}$, Ausgangsvariable ist $x_{6}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{5}^{*} \\ x_{3}^{*} \end{pmatrix} = \begin{pmatrix} \frac{1}{2} \\ \frac{3}{2} \end{pmatrix}$ und $B = \begin{pmatrix} x_{5} & x_{3} \\ 1 & 3 \\ 0 & 2 \end{pmatrix}$.
|
||||
|
||||
\underline{2. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 0 & 9 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{3}
|
||||
y_{1} && &=& 0 \\
|
||||
3y_{1} &+& 2y_{2} &=& 9
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 0 & \frac{9}{2} \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{1} & x_{2} & x_{6} & x_{4} \\ 1 & 2 & 1 & 1 \\ 1 & 1 & 0 & 3 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} \frac{9}{2} & \frac{9}{2} & 0 & \frac{27}{2} \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 5 & 6 & 0 & 8 \end{pmatrix}$. Also kommen nur die ersten beiden Spalten von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 2 \\ 1 \end{pmatrix}$; die Eingangsvariable ist $x_{2}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{3}
|
||||
d_{1} &+& 3d_{2} &=& 2 \\
|
||||
&& 2d_{2} &=& 1
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix}\frac{1}{2} \\ \frac{1}{2}\end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} \frac{1}{2} \\ \frac{3}{2}\end{pmatrix} - t \begin{pmatrix}\frac{1}{2} \\ \frac{1}{2} \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 1$; für $t = 1$ gilt $\begin{pmatrix} \frac{1}{2} \\ \frac{3}{2}\end{pmatrix} - t \begin{pmatrix}\frac{1}{2} \\ \frac{1}{2} \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$, Ausgangsvariable ist $x_{5}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{2}^{*} \\ x_{3}^{*} \end{pmatrix} = \begin{pmatrix} 1 \\ 1 \end{pmatrix}$ und $B = \begin{pmatrix} x_{2} & x_{3} \\ 2 & 3 \\ 1 & 2 \end{pmatrix}$.
|
||||
|
||||
\underline{3. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 6 & 9 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{3}
|
||||
2y_{1} &+& y_{2} &=& 6 \\
|
||||
3y_{1} &+& 2y_{2} &=& 9
|
||||
\end{alignat*}
|
||||
Daraus ergibt sich dieses LGS:
|
||||
\begin{alignat*}{3}
|
||||
I & 2y_{1} &+& y_{2} &=& 6 \\
|
||||
II & 3y_{1} &+& 2y_{2} &=& 9 \\
|
||||
II - I & y_{1} &+& y_{2} &=& 3 \\
|
||||
\Leftrightarrow & y_{1} && &=& 3 - y_{2} \\
|
||||
\intertext{Einsetzen in I}
|
||||
\Rightarrow & 2(3 - y_{2}) &+& y_{2} &=& 6 \\
|
||||
\Leftrightarrow & 6 - 2y_{2} &+& y_{2} &=& 6 \\
|
||||
\Leftrightarrow & &-& y_{2} &=& 0 \\
|
||||
\intertext{Einsetzen in I}
|
||||
\Rightarrow & 2y_{1} && &=& 6 \\
|
||||
\Leftrightarrow & y_{1} && &=& 3 \\
|
||||
\intertext{Einsetzen in II}
|
||||
\Rightarrow & 3 \cdot 3 && &=& 9 \\
|
||||
\Leftrightarrow & 9 && &=& 9
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 3 & 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{1} & x_{6} & x_{5} & x_{4} \\ 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 3 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 3 & 0 & 3 & 3 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 5 & 0 & 0 & 8\end{pmatrix}$. Also kommen nur die erste und die letzte Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 1 \\ 3 \end{pmatrix}$; die Eingangsvariable ist $x_{4}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{3}
|
||||
2d_{1} &+& 3d_{2} &=& 1\\
|
||||
d_{1} &+& 2d_{2} &=& 3
|
||||
\end{alignat*}
|
||||
Daraus ergibt sich dieses LGS:
|
||||
\begin{alignat*}{3}
|
||||
I & 2d_{1} &+& 3d_{2} &=& 1 \\
|
||||
II & d_{1} &+& 2d_{2} &=& 3 \\
|
||||
I - II & d_{1} &+& d_{2} &=& -2 \\
|
||||
\Leftrightarrow & d_{1} && &=& -2 - d_{2} \\
|
||||
\intertext{Einsetzen in II}
|
||||
\Rightarrow & -2 - d_{2} &+& 2d_{2} &=& 3 \\
|
||||
\Leftrightarrow & && d_{2} &=& 5 \\
|
||||
\intertext{Einsetzen in I}
|
||||
\Rightarrow & 2d_{1} &+& 3 \cdot 5 &=& 1 \\
|
||||
\Leftrightarrow & 2d_{1} && &=& - 14 \\
|
||||
\Leftrightarrow & d_{1} && &=& -7 \\
|
||||
\intertext{Einsetzen in II}
|
||||
\Rightarrow & -7 &+& 2 \cdot 5 &=& 3 \\
|
||||
\Leftrightarrow & -7 &+& 10 &=& 3 \\
|
||||
\Leftrightarrow & && 3 &=& 3
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix} -7 \\ 5 \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 1 \\ 1 \end{pmatrix} - t \begin{pmatrix}-7 \\ 5 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = \frac{1}{5}$; für $t = \frac{1}{5}$ gilt $\begin{pmatrix} 1 \\ 1\end{pmatrix} - t \begin{pmatrix} -7 \\ 5 \end{pmatrix} = \begin{pmatrix} \frac{12}{5} \\ 0 \end{pmatrix}$, Ausgangsvariable ist $x_{3}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{2}^{*} \\ x_{4}^{*} \end{pmatrix} = \begin{pmatrix} \frac{12}{5} \\ \frac{1}{5} \end{pmatrix}$ und $B = \begin{pmatrix} x_{2} & x_{4} \\ 2 & 1 \\ 1 & 3 \end{pmatrix}$.
|
||||
|
||||
\underline{4. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 6 & 8 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{3}
|
||||
2y_{1} &+& y_{2} &=& 6 \\
|
||||
y_{1} &+& 3y_{2} &=& 8
|
||||
\end{alignat*}
|
||||
Es ergibt sich dieses LGS:
|
||||
\begin{alignat*}{3}
|
||||
I & 2y_{1} &+& y_{2} &=& 6 \\
|
||||
II & y_{1} &+& 3y_{2} &=& 8 \\
|
||||
II & y_{1} && &=& 8 - 3y_{2} \\
|
||||
\intertext{Einsetzen in I}
|
||||
\Rightarrow & 2(8 - 3y_{2}) &+& y_{2} &=& 6 \\
|
||||
\Leftrightarrow & 16 - 6y_{2} &+& y_{2} &=& 6 \\
|
||||
\Leftrightarrow & &-& 5y_{2} &=& -10 \\
|
||||
\Leftrightarrow & && y_{2} &=& 2 \\
|
||||
\intertext{Einsetzen in II}
|
||||
\Rightarrow & y_{1} &+& 3 \cdot 2 &=& 8 \\
|
||||
\Leftrightarrow & y_{1} && &=& 2
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 2 & 2 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{1} & x_{5} & x_{6} & x_{3} \\ 1 & 1 & 0 & 3 \\ 1 & 0 & 1 & 2 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 4 & 2 & 2 & 10 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 5 & 0 & 0 & 8\end{pmatrix}$. Also kommt nur die erste Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 1 \\ 1 \end{pmatrix}$; die Eingangsvariable ist $x_{1}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{3}
|
||||
2d_{1} &+& d_{2} &=& 1\\
|
||||
d_{1} &+& 3d_{2} &=& 1
|
||||
\end{alignat*}
|
||||
Daraus ergibt sich dieses LGS:
|
||||
\begin{alignat*}{3}
|
||||
I & 2d_{1} &+& d_{2} &=& 1 \\
|
||||
II & d_{1} &+& 3d_{2} &=& 1 \\
|
||||
II & d_{1} && &=& 1 - 3d_{2} \\
|
||||
\intertext{Einsetzen in I}
|
||||
\Rightarrow & 2(1 - 3d_{2}) &+& d_{2} &=& 1 \\
|
||||
\Leftrightarrow & 2 - 6d_{2} &+& d_{2} &=& 1 \\
|
||||
\Leftrightarrow & &-& 5d_{2} &=& -1 \\
|
||||
\Leftrightarrow & && d_{2} &=& \frac{1}{5} \\
|
||||
\intertext{Einsetzen in II}
|
||||
\Rightarrow & d_{1} &+& 3 \cdot \frac{1}{5} &=& 1 \\
|
||||
\Leftrightarrow & d_{1} && &=& \frac{2}{5} \\
|
||||
\intertext{Einsetzen in I}
|
||||
\Rightarrow & 2 \cdot \frac{2}{5} &+& \frac{1}{5} &=& 1 \\
|
||||
\Leftrightarrow & \frac{4}{5} &+& \frac{1}{5} &=& 1 \\
|
||||
\Leftrightarrow & && 1 &=& 1
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix} \frac{2}{5} \\ \frac{1}{5} \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} \frac{12}{5} \\ \frac{1}{5} \end{pmatrix} - t \begin{pmatrix} \frac{2}{5} \\ \frac{1}{5} \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 1$; für $t = 1$ gilt $\begin{pmatrix} \frac{12}{5} \\ \frac{1}{5}\end{pmatrix} - t \begin{pmatrix} \frac{2}{5} \\ \frac{1}{5} \end{pmatrix} = \begin{pmatrix} 2 \\ 0 \end{pmatrix}$, Ausgangsvariable ist $x_{4}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{2}^{*} \\ x_{1}^{*} \end{pmatrix} = \begin{pmatrix} 2 \\ 1 \end{pmatrix}$ und $B = \begin{pmatrix} x_{2} & x_{1} \\ 2 & 1 \\ 1 & 1 \end{pmatrix}$.
|
||||
|
||||
\underline{5. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 6 & 5 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{3}
|
||||
2y_{1} &+& y_{2} &=& 6 \\
|
||||
y_{1} &+& y_{2} &=& 5
|
||||
\end{alignat*}
|
||||
Es ergibt sich dieses LGS:
|
||||
\begin{alignat*}{3}
|
||||
I & 2y_{1} &+& y_{2} &=& 6 \\
|
||||
II & y_{1} &+& y_{2} &=& 5 \\
|
||||
I - II & y_{1} && &=& 1 \\
|
||||
\intertext{Einsetzen in II}
|
||||
\Rightarrow & 1 &+& y_{2} &=& 5 \\
|
||||
\Leftrightarrow & && y_{2} &=& 4 \\
|
||||
\intertext{Einsetzen in I}
|
||||
\Rightarrow & 2 \cdot 1 &+& 4 &=& 6 \\
|
||||
\Leftrightarrow & && 6 &=& 6
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 1 & 4 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{4} & x_{5} & x_{6} & x_{3} \\ 1 & 1 & 0 & 3 \\ 3 & 0 & 1 & 2 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 13 & 1 & 4 & 11 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 8 & 0 & 0 & 9\end{pmatrix}$. Wegen $13 \geq 8, 1 \geq 0, 4 \geq 0, 11 \geq 9$ ist die aktuelle Lösung optimal. Die optimale Lösung lautet $x_{1}^{*} = 1, x_{2}^{*} = 2, x_{3}^{*} = 0, x_{4}^{*} = 0$ mit $z^{*} = 5x_{1}^{*} + 6x_{2}^{*} + 9x_{3}^{*} + 8x_{4}^{*} = 21$.
|
||||
|
||||
\end{document}
|
||||
286
prosem/VortragProsem.tex
Normal file
286
prosem/VortragProsem.tex
Normal 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}
|
||||
@ -182,12 +182,6 @@ Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
|
||||
#t
|
||||
#f))
|
||||
|
||||
; negiert ein Prädikat
|
||||
(define (not pred)
|
||||
(if pred
|
||||
#f
|
||||
#t))
|
||||
|
||||
(define erbbarliste
|
||||
'((punkte . (punkte streifen sterne))
|
||||
(streifen . (streifen sterne))
|
||||
@ -218,9 +212,9 @@ Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
|
||||
))))
|
||||
(rec sichtbarVater sichtbarMutter sichtbarKind #t)))
|
||||
|
||||
(display "\nSind Anton und Antonia die Eltern von Toni:")
|
||||
(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 "\nSind Anton und Antonia die Eltern von Tini:")
|
||||
(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 "\nSind Anton und Antonia die Eltern von Tina:")
|
||||
(display "\nKönnen Anton und Antonia die Eltern von Tina sein:")
|
||||
(testeElternschaft '(sterne gruen geschweift rhombisch) '(streifen blau gekruemmt hexagonal) '(streifen gelb geschweift elliptisch))
|
||||
115
se3/G08_B06_Jim-2martens_Britta-2noack_Jan-Simon-0giesel.rkt
Normal file
115
se3/G08_B06_Jim-2martens_Britta-2noack_Jan-Simon-0giesel.rkt
Normal 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))
|
||||
197
se3/G08_B07_Jim-2martens_Britta-2noack_Jan-Simon-0giesel.rkt
Normal file
197
se3/G08_B07_Jim-2martens_Britta-2noack_Jan-Simon-0giesel.rkt
Normal file
@ -0,0 +1,197 @@
|
||||
#lang racket
|
||||
|
||||
#|
|
||||
SE 3 Funktional Blatt 7
|
||||
Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
|
||||
|#
|
||||
|
||||
; 1)
|
||||
|
||||
; allgemeine rekursive Version
|
||||
(define (produkt1 n f)
|
||||
(letrec ((rec (λ (xs r)
|
||||
(if [empty? xs]
|
||||
r
|
||||
(rec
|
||||
(cdr xs)
|
||||
(cons (* (car xs) f) r))))))
|
||||
(reverse (rec n '()))))
|
||||
|
||||
; endrekursive Version
|
||||
(define (produkt2 n f)
|
||||
(let ((revList (reverse n)))
|
||||
(letrec ((rec (λ (xs acc)
|
||||
(if (empty? xs)
|
||||
acc
|
||||
(rec
|
||||
(cdr xs)
|
||||
(cons (* (car xs) f) acc)
|
||||
)
|
||||
))))
|
||||
(rec revList '()))))
|
||||
|
||||
; Funktionen höherer Ordnung
|
||||
(define (produkt3 n f)
|
||||
(map (curryr * f) n))
|
||||
|
||||
; 2)
|
||||
|
||||
; 2.1
|
||||
; Eine Liste mit sieben Elementen, die je eine Leuchtdiode
|
||||
; repräsentieren. Jedes Element ist entweder #f oder #t.
|
||||
; -1-
|
||||
;| |
|
||||
;2 3
|
||||
;| |
|
||||
; -4-
|
||||
;| |
|
||||
;5 6
|
||||
;| |
|
||||
; -7-
|
||||
|
||||
; Die Leuchtdioden werden in dieser Reihenfolge in der Liste
|
||||
; angegeben.
|
||||
|
||||
; Die möglichen Zustände für die Zahlen 0-9 werden mithilfe
|
||||
; einer Liste von oben beschriebenen Listen realisiert.
|
||||
|
||||
(define zustandstabelle
|
||||
'((0 . (#t #t #t #f #t #t #t))
|
||||
(1 . (#f #f #t #f #f #t #f))
|
||||
(2 . (#t #f #t #t #t #f #t))
|
||||
(3 . (#t #f #t #t #f #t #t))
|
||||
(4 . (#f #t #t #t #f #t #f))
|
||||
(5 . (#t #t #f #t #f #t #t))
|
||||
(6 . (#t #t #f #t #t #t #t))
|
||||
(7 . (#t #f #t #f #f #t #f))
|
||||
(8 . (#t #t #t #t #t #t #t))
|
||||
(9 . (#t #t #t #t #f #t #t))))
|
||||
|
||||
(define (key->value key tabelle)
|
||||
(cdr (assoc key tabelle)))
|
||||
|
||||
; 2.2
|
||||
(require 2htdp/image)
|
||||
|
||||
; erzeugte ein senkrechtes Segment
|
||||
(define (zeichneSegmentSenkrecht active)
|
||||
(if active
|
||||
(rectangle 10 80 "solid" "Red")
|
||||
(rectangle 10 80 "solid" "DimGray")
|
||||
))
|
||||
|
||||
; erzeugt ein waagerechtes Segment
|
||||
(define (zeichneSegmentWaagerecht active)
|
||||
(if active
|
||||
(rectangle 80 10 "solid" "Red")
|
||||
(rectangle 80 10 "solid" "DimGray")
|
||||
))
|
||||
|
||||
; zeichnet die Segmente
|
||||
(define (zeichneSegmente zustand)
|
||||
(beside
|
||||
; Segmente 2 und 5
|
||||
(above
|
||||
(zeichneSegmentSenkrecht (cadr zustand))
|
||||
(rectangle 10 10 "solid" "Black")
|
||||
(zeichneSegmentSenkrecht (cadddr (cdr zustand)))
|
||||
)
|
||||
; Segmente 1, 4 und 7
|
||||
(above
|
||||
(zeichneSegmentWaagerecht (car zustand))
|
||||
(rectangle 80 80 "solid" "Black")
|
||||
(zeichneSegmentWaagerecht (cadddr zustand))
|
||||
(rectangle 80 80 "solid" "Black")
|
||||
(zeichneSegmentWaagerecht (cadddr (cdddr zustand)))
|
||||
)
|
||||
; Segmente 3 und 6
|
||||
(above
|
||||
(zeichneSegmentSenkrecht (caddr zustand))
|
||||
(rectangle 10 10 "solid" "Black")
|
||||
(zeichneSegmentSenkrecht (cadddr (cddr zustand)))
|
||||
)
|
||||
))
|
||||
|
||||
; zeigt eine Sieben-Segment-Anzeige
|
||||
(define (zeigeSiebenSegment zustand)
|
||||
(overlay
|
||||
(zeichneSegmente zustand)
|
||||
(rectangle 100 200 "solid" "Black")
|
||||
))
|
||||
|
||||
; 2.3
|
||||
(define (zeige-7segment t)
|
||||
(let ((zustand (floor (/ t 28))))
|
||||
(if (and [exact? zustand]
|
||||
[< zustand 10])
|
||||
(zeigeSiebenSegment (key->value zustand zustandstabelle))
|
||||
(zeigeSiebenSegment (key->value (- zustand 10) zustandstabelle)))))
|
||||
|
||||
(require 2htdp/universe)
|
||||
; zum Animieren auskommentieren
|
||||
;(animate zeige-7segment)
|
||||
|
||||
; 2.4
|
||||
; Für die Darstellung von 6 Anzeigen müssen 6 Zustands-
|
||||
; variablen eingeführt werden, die den Zustand für jede
|
||||
; der sechs Anzeigen repräsentieren.
|
||||
|
||||
; Dazu muss die eben definierte Funktion dahingehend
|
||||
; erweitert werden.
|
||||
|
||||
; Die Anzeigen seien von links nach rechts mit 1 bis 6 bezeichnet.
|
||||
; modT entspricht dem Rest der Division t durch 2419200.
|
||||
; Anzeige 6 schaltet auf 1, wenn modT 28 ist und auf 2 wenn modT 56 ist, etc.
|
||||
; Anzeige 5 schaltet auf 1, wenn Anzeige 1 auf 10 ist und
|
||||
; auf 2 wenn 6 auf 20 ist, etc.
|
||||
; Anzeige 4 schaltet auf 1, wenn Anzeige 5 auf 6 ist und
|
||||
; auf 2 wenn 5 auf 12 ist, etc.
|
||||
; Anzeige 3 schaltet auf 1, wenn Anzeige 4 auf 10 ist und
|
||||
; auf 2 wenn 4 auf 20 ist, etc.
|
||||
; Anzeige 2 schaltet auf 1, wenn Anzeige 3 auf 6 ist und
|
||||
; auf 2 wenn 3 auf 12 ist, etc.
|
||||
; Anzeige 1 schaltet auf 1, wenn Anzeige 2 auf 10 ist und
|
||||
; auf 2 wenn 2 auf 20 ist, etc.
|
||||
|
||||
(define trenner
|
||||
(underlay/xy
|
||||
(underlay/xy
|
||||
(rectangle 100 200 'solid 'black)
|
||||
40
|
||||
70
|
||||
(rectangle 20 20 'solid 'red)
|
||||
)
|
||||
40
|
||||
140
|
||||
(rectangle 20 20 'solid 'red)
|
||||
))
|
||||
|
||||
(define trenner2
|
||||
(rectangle 10 200 "solid" "Black"))
|
||||
|
||||
; diese Funktion wird bis 99h 59m 59s zählen und dann wieder bei 0
|
||||
; anfangen
|
||||
(define (zeigedauer t)
|
||||
(let* ((modT (modulo t 10080000)) ; 10080000 entspricht 100h
|
||||
(zustand6 (floor (/ modT 28)))
|
||||
(zustand5 (floor (/ zustand6 10)))
|
||||
(zustand4 (floor (/ zustand5 6)))
|
||||
(zustand3 (floor (/ zustand4 10)))
|
||||
(zustand2 (floor (/ zustand3 6)))
|
||||
(zustand1 (floor (/ zustand2 10))))
|
||||
(beside
|
||||
(zeigeSiebenSegment (key->value (modulo zustand1 10) zustandstabelle))
|
||||
trenner2
|
||||
(zeigeSiebenSegment (key->value (modulo zustand2 10) zustandstabelle))
|
||||
trenner
|
||||
(zeigeSiebenSegment (key->value (modulo zustand3 6) zustandstabelle))
|
||||
trenner2
|
||||
(zeigeSiebenSegment (key->value (modulo zustand4 10) zustandstabelle))
|
||||
trenner
|
||||
(zeigeSiebenSegment (key->value (modulo zustand5 6) zustandstabelle))
|
||||
trenner2
|
||||
(zeigeSiebenSegment (key->value (modulo zustand6 10) zustandstabelle)))
|
||||
))
|
||||
|
||||
; zum Animieren auskommentieren
|
||||
; (animate zeigedauer)
|
||||
Reference in New Issue
Block a user