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

26 Commits

Author SHA1 Message Date
300490a93b AD-5: Aufgabe 4a mit Pseudocode ergänzt. 2013-12-15 12:50:47 +01:00
abf82e25d7 AD-5: Aufgabe 4a bearbeitet. 2013-12-14 16:16:12 +01:00
d7c4eed8f1 SE3-7: Aufgabe 2.4 korrigiert. 2013-12-14 11:15:13 +01:00
36556eb9b4 AD-5: Aufgaben 1-3 bearbeitet. 2013-12-12 18:04:45 +01:00
a051729612 GDB-4: Aufgabe 2 korrigiert. 2013-12-12 16:01:41 +01:00
3b2a28a11d GDB-4: Aufgabe 4 korrigiert. 2013-12-12 15:34:07 +01:00
9913b6fc95 SE3: Blatt 7 ohne Zusatzaufgabe bearbeitet. 2013-12-12 15:23:44 +01:00
7818e3b603 MATH2-Inf-9: Aufgabenblatt komplett bearbeitet. 2013-12-11 17:08:35 +01:00
88562703a2 MK: Feedback ergänzt. 2013-12-10 11:54:53 +01:00
da05933c8d MK: Feedback hinzugefügt. 2013-12-09 16:41:41 +01:00
4cbbe10194 SE3-6: Zusätzlichen MoniMonitor zum Weihnachtsbild hinzugefügt. 2013-12-07 13:09:57 +01:00
99ca499a0a GDB-4: Aufgabe 3 und 4 bearbeitet. 2013-12-07 12:01:42 +01:00
4d8389eba9 GDB-4: Blatt 4 Aufgaben 1 und 2 bearbeitet. 2013-12-05 20:19:27 +01:00
a6ed748153 GDB: vsis-gdb.sty angepasst. 2013-12-05 18:42:41 +01:00
758f40ea1f SE3-6: Blatt 6 bearbeitet.
* Weihnachtsbild muss eventuell noch verbessert werden.
2013-12-05 17:52:41 +01:00
26fda0ddb4 Readme angepasst. 2013-12-05 11:57:07 +01:00
347f0584a0 README aufgrund eines aktuellen Anlasses angepasst. 2013-12-05 11:55:09 +01:00
240dd113ab SE3-5: Aufgabe 2 anhand der Rückmeldungen verbessert. 2013-12-04 21:07:48 +01:00
7fb91df76f MATH2-Inf-8: Aufgabenblatt komplett bearbeitet. 2013-12-04 16:54:04 +01:00
542da545e2 fixed 4a 2013-12-03 23:11:19 +01:00
8743f36082 AD-4: Absätze korrigiert. 2013-12-03 14:16:09 +01:00
02da1f0144 added 3d, 3e and 4a 2013-12-03 12:10:46 +01:00
44ab3e4e0b AD-4: Algorithmus 2b ii korrigiert. 2013-12-03 10:51:17 +01:00
7913205597 MK: Vortrag fertig ausgearbeitet. 2013-12-03 10:13:27 +01:00
1f552564c9 Prosem: Grundstruktur Vortrag hinzugefügt. 2013-12-02 21:11:53 +01:00
b3df21b7d1 MK: Vortragsausarbeitung begonnen. Unnötiger Seitenumbruch in Paper entfernt. 2013-12-02 21:11:15 +01:00
14 changed files with 2190 additions and 24 deletions

View File

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

View File

@ -137,16 +137,19 @@ Jim Martens (6420323)}
IST_2FAERBUNG(G) { IST_2FAERBUNG(G) {
kanten = E(G) kanten = E(G)
valid = true valid = true
farben = new Set()
foreach kante in kanten { foreach kante in kanten {
knoten1 = kante.knoten1 knoten1 = kante.knoten1
knoten2 = kante.knoten2 knoten2 = kante.knoten2
farben.add(knoten1.farbe)
farben.add(knoten2.farbe)
if (knoten1.farbe == knoten2.farbe) { if (knoten1.farbe == knoten2.farbe) {
valid = false valid = false
break break
} }
} }
return valid return (valid && (farben.getAnzahl() == 2))
} }
\end{verbatim} \end{verbatim}
\subsubsection{} %iii \subsubsection{} %iii
@ -228,7 +231,21 @@ Jim Martens (6420323)}
G_{2}: 1, 3, 4, 7, 5, 2, 6 G_{2}: 1, 3, 4, 7, 5, 2, 6
\] \]
\subsection{} %d \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 \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 \subsection{} %f
starke Zusammenhangskomponenten von $G_{1}:$ starke Zusammenhangskomponenten von $G_{1}:$
\begin{alignat*}{2} \begin{alignat*}{2}
@ -251,10 +268,35 @@ Jim Martens (6420323)}
\subsection{} %a \subsection{} %a
% Senken finden (alle Senken infiltrieren, dadurch werden alle Module eliminiert) % Senken finden (alle Senken infiltrieren, dadurch werden alle Module eliminiert)
% Algorithmus aus Vorlesung benutzen % 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} \begin{verbatim}
function eliminiereMCP() { 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} \end{verbatim}
\subsection{} %b \subsection{} %b

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

@ -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}

View File

@ -107,8 +107,7 @@
font=\footnotesize, font=\footnotesize,
}, },
erbt/.style={ erbt/.style={
isosceles triangle, isosceles triangle apex angle=60, regular polygon, regular polygon sides=6,
shape border rotate=-90,
draw, black, very thick, minimum size=3em draw, black, very thick, minimum size=3em
}, },
% Layout fuer referenzgraphen % Layout fuer referenzgraphen

View File

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

14
mk/feedback.txt Normal file
View 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?)

View File

@ -267,7 +267,7 @@
% Insbesondere stehen die eigentlichen Informationen in der Datei % Insbesondere stehen die eigentlichen Informationen in der Datei
% ``bib.bib'' % ``bib.bib''
% %
\clearpage %\clearpage
\bibliography{bib} \bibliography{bib}
\bibliographystyle{ieeetr} \bibliographystyle{ieeetr}
\addcontentsline{toc}{section}{Literatur}% Add to the TOC \addcontentsline{toc}{section}{Literatur}% Add to the TOC

View File

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

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}

286
prosem/VortragProsem.tex Normal file
View File

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

View File

@ -182,12 +182,6 @@ Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
#t #t
#f)) #f))
; negiert ein Prädikat
(define (not pred)
(if pred
#f
#t))
(define erbbarliste (define erbbarliste
'((punkte . (punkte streifen sterne)) '((punkte . (punkte streifen sterne))
(streifen . (streifen sterne)) (streifen . (streifen sterne))
@ -218,9 +212,9 @@ Abgebende: Jim 2martens, Britta 2noack, Jan-Simon 0giesel
)))) ))))
(rec sichtbarVater sichtbarMutter sichtbarKind #t))) (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)) (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)) (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)) (testeElternschaft '(sterne gruen geschweift rhombisch) '(streifen blau gekruemmt hexagonal) '(streifen gelb geschweift elliptisch))

View File

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

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)