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

9 Commits

5 changed files with 939 additions and 11 deletions

View File

@ -0,0 +1,104 @@
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{bytefield}
\usepackage{paralist}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage{textcomp}
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
\usepackage{tikz}
\usepackage{algorithm}
\usepackage{algorithmic}
\usetikzlibrary{automata,matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
\usepackage{polynom}
\polyset{style=C, div=:,vars=x}
\pgfplotsset{compat=1.8}
\pagenumbering{arabic}
\def\thesection{\arabic{section})}
\def\thesubsection{(\alph{subsection})}
\def\thesubsubsection{(\roman{subsubsection})}
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\parskip 12pt plus 1pt minus 1pt
\parindent 0pt
\begin{document}
\author{Reinhard Köhler (6425686), Tronje Krabbe (6435002), \\
Jim Martens (6420323)}
\title{Hausaufgaben zum 4. Dezember}
\subtitle{Gruppe 8}
\maketitle
\section{} %1
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{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{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{verbatim}
function berechneDurchmesser(G)
longestPath = 0
current = G.wurzel
queue.enqueue(current.getChilds())
while (!empty(queue))
current = queue.dequeue()
parent = current.parent
// wähle eines von beiden, abhängig davon,
// ob die Länge sich auf die Kanten oder die Gewichtungen bezieht (TBD)
distance = parent.getDistance() + w(parent,current)
distance = parent.getDistance() + 1
if (distance > longestPath)
longestPath = distance
childs = current.getChilds()
if (!empty(childs))
queue.enqueue(current.getChilds())
\end{verbatim}
\subsection{} %b
\section{} %5
\subsection{} %a
\subsection{} %b
\section{} %6
\end{document}

View File

@ -58,7 +58,11 @@
RID INT(10) NOT NULL,
OID INT(10) NOT NULL,
Platz INT(3) NOT NULL,
CONSTRAINT pk_platzierung PRIMARY KEY (RID, OID)
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
@ -174,13 +178,15 @@
\begin{tikzpicture}[shorten >=1pt,node distance=1.1cm,on grid]
\node (proj) {$\pi_{Person.PNR, Person.Vorname, Person.Nachname}$};
\node (sel) [below=2.0 of proj] {$\sigma_{Obst.Sorte\text{ LIKE 'K\%'}}$};
\node (join) [below=2.0 of sel] {$\underset{Person.Lieblingsobst = Obst.ONR}{\bowtie}$};
\node (person) [below left=2.0 and 2.0 of join] {Person};
\node (obst) [below right=2.0 and 2.0 of join] {Obst};
\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} (join)
(join) edge node [left] {2000} (person)
(join) edge node [right] {25} (obst);
(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:\\
@ -196,5 +202,5 @@
(sel) edge node [right] {25} (obst);
\end{tikzpicture}
Der zweite Operatorbaum ist klar performanter, da die Selektion der Obstsorte bereits vor dem Join stattfindet.
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}

View File

@ -8,5 +8,7 @@ Feedback zu Vortrag Elektronische Demokratie
* 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?)

View File

@ -0,0 +1,619 @@
\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} 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*}{3}
d_{1} & & &=& 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} 2 \\ 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 = 2$; für $t = 2$ gilt $\begin{pmatrix} 2 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}1 \\ 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 3 \\ 8 \end{pmatrix}$, Ausgangsvariable ist $x_{3}$.
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
$x_{B}^{*} = \begin{pmatrix} x_{1}^{*} \\ x_{4}^{*} \\ x_{5}^{*} \end{pmatrix} = \begin{pmatrix} 2 \\ 3 \\ 8 \end{pmatrix}$ und $B = \begin{pmatrix} x_{1} & x_{4} & x_{5} \\ 1 & 0 & 0 \\ 1 & 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} &+& y_{2} && &=& 2 \\
&& y_{2} && &=& 0 \\
&& && y_{3} &=& 0
\end{alignat*}
Also gilt $y^{T} = \begin{pmatrix} 2 & 0 & 0 \end{pmatrix}$.
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
Es gilt $A_{N} = \begin{pmatrix} x_{3} & x_{2} \\ 1 & -4 \\ 0 & 0 \\ 0 & 1 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 2 & -8 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 3 \end{pmatrix}$. Also kommt nur die zweite 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*}{4}
d_{1} && && &=& -4 \\
d_{1} &+& d_{2} && &=& 0 \\
&& && d_{3} &=& 1
\end{alignat*}
Es folgt $d = \begin{pmatrix}-4 \\ 4 \\ 1 \end{pmatrix}$.
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 2 \\ 3 \\ 8\end{pmatrix} - t \begin{pmatrix}-4 \\ 4 \\ 1 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = \frac{3}{4}$; für $t = \frac{3}{4}$ gilt $\begin{pmatrix} 2 \\ 3 \\ 8\end{pmatrix} - t \begin{pmatrix}-4 \\ 4 \\ 1 \end{pmatrix} = \begin{pmatrix} 5 \\ 0 \\ \frac{29}{4} \end{pmatrix}$, Ausgangsvariable ist $x_{4}$.
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
$x_{B}^{*} = \begin{pmatrix} x_{1}^{*} \\ x_{2}^{*} \\ x_{5}^{*} \end{pmatrix} = \begin{pmatrix} 5 \\ \frac{3}{4} \\ \frac{29}{4} \end{pmatrix}$ und $B = \begin{pmatrix} x_{1} & x_{2} & x_{5} \\ 1 & -4 & 0 \\ 1 & 0 & 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 & 3 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
\begin{alignat*}{4}
y_{1} &+& y_{2} && &=& 2 \\
-4y_{1} && &+& y_{3} &=& 3 \\
&& && y_{3} &=& 0
\end{alignat*}
Also gilt $y^{T} = \begin{pmatrix} -\frac{3}{4} & \frac{11}{4} & 0 \end{pmatrix}$.
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
Es gilt $A_{N} = \begin{pmatrix} x_{3} & x_{4} \\ 1 & 0 \\ 0 & 1 \\ 0 & 0 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} -\frac{3}{4} & \frac{11}{4} \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 0 \end{pmatrix}$. Also kommt nur die erste 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} &-& 4d_{2} && &=& 1\\
d_{1} && && &=& 0 \\
&& d_{2} &+& d_{3} &=& 0
\end{alignat*}
Es folgt $d = \begin{pmatrix} 0 \\ -\frac{1}{4} \\ \frac{1}{4} \end{pmatrix}$.
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 5 \\ \frac{3}{4} \\ \frac{29}{4}\end{pmatrix} - t \begin{pmatrix}0 \\ -\frac{1}{4} \\ \frac{1}{4} \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 3$; für $t = 3$ gilt $\begin{pmatrix} 5 \\ \frac{3}{4} \\ \frac{29}{4}\end{pmatrix} - t \begin{pmatrix} 0 \\ -\frac{1}{4} \\ \frac{1}{4} \end{pmatrix} = \begin{pmatrix} 5 \\ 0 \\ \frac{13}{2} \end{pmatrix}$, Ausgangsvariable ist $x_{2}$.
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
$x_{B}^{*} = \begin{pmatrix} x_{1}^{*} \\ x_{3}^{*} \\ x_{5}^{*} \end{pmatrix} = \begin{pmatrix} 5 \\ 3 \\ \frac{13}{2} \end{pmatrix}$ und $B = \begin{pmatrix} x_{1} & x_{3} & x_{5} \\ 1 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \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 & 0 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
\begin{alignat*}{4}
y_{1} &+& y_{2} && &=& 2 \\
y_{1} && && &=& 0 \\
&& && y_{3} &=& 0
\end{alignat*}
Also gilt $y^{T} = \begin{pmatrix} 0 & 2 & 0 \end{pmatrix}$.
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
Es gilt $A_{N} = \begin{pmatrix} x_{2} & x_{4} \\ -4 & 0 \\ 0 & 1 \\ 1 & 0 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 0 & 2 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 3 & 0 \end{pmatrix}$. Also kommt nur die erste 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*}{4}
d_{1} &+& d_{2} && &=& -4\\
d_{1} && && &=& 0 \\
&& && d_{3} &=& 1
\end{alignat*}
Es folgt $d = \begin{pmatrix} 0 \\ -4 \\ 1 \end{pmatrix}$.
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 5 \\ 3 \\ \frac{13}{2}\end{pmatrix} - t \begin{pmatrix}0 \\ -4 \\ 1 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = \frac{13}{2}$; für $t = \frac{13}{2}$ gilt $\begin{pmatrix} 5 \\ 3 \\ \frac{13}{2}\end{pmatrix} - t \begin{pmatrix} 0 \\ -4 \\ 1 \end{pmatrix} = \begin{pmatrix} 5 \\ 29 \\ 0 \end{pmatrix}$, Ausgangsvariable ist $x_{5}$.
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
$x_{B}^{*} = \begin{pmatrix} x_{1}^{*} \\ x_{3}^{*} \\ x_{2}^{*} \end{pmatrix} = \begin{pmatrix} 5 \\ 29 \\ \frac{13}{2} \end{pmatrix}$ und $B = \begin{pmatrix} x_{1} & x_{3} & x_{2} \\ 1 & 1 & -4 \\ 1 & 0 & 0 \\ 0 & 0 & 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} 2 & 0 & 3 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
\begin{alignat*}{4}
y_{1} &+& y_{2} && &=& 2 \\
y_{1} && && &=& 0 \\
-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_{5} & x_{4} \\ 0 & 0 \\ 0 & 1 \\ 1 & 0 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 3 & 2 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 0 \end{pmatrix}$. Wegen $3 \geq 0, 2 \geq 0$ ist die aktuelle Lösung optimal. Die optimale Lösung lautet $x_{1}^{*} = 5, x_{2}^{*} = \frac{13}{2}$ mit $z^{*} = 2x_{1}^{*} + 3x_{2}^{*} = \frac{59}{2}$.
\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}

View 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)