\documentclass[a4paper,12pt]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage{graphicx} %BIlder einbinden
\usepackage{amsmath} %erweiterte Mathe-Zeichen
\usepackage{amsfonts} %weitere fonts
\usepackage[utf8]{inputenc} %Umlaute & Co
\usepackage{hyperref} %Links
\usepackage{ifthen} %ifthenelse
\usepackage{enumerate}
\usepackage{stmaryrd}
\usepackage{color}
\usepackage{algpseudocode} %Pseudocode
\usepackage{dsfont} % schöne Zahlenräumezeichen
\usepackage{amssymb, amsthm} %noch stärker erweiterte Mathe-Zeichen
\usepackage{tikz} %TikZ ist kein Zeichenprogramm
\usetikzlibrary{trees,automata,arrows,shapes}
\usepackage{pgfplots}
\pagestyle{empty}
\topmargin-50pt
\newcounter{aufgabe}
\def\tand{&}
\newcommand{\makeTableLine}[2][0]{%
\setcounter{aufgabe}{1}%
\whiledo{\value{aufgabe} < #1}%
{%
#2\tand\stepcounter{aufgabe}%
}
}
\newcommand{\aufgTable}[1]{
\def\spalten{\numexpr #1 + 1 \relax}
\begin{tabular}{|*{\spalten}{p{1cm}|}}
\makeTableLine[\spalten]{E\theaufgabe}$\Sigma$~~\\ \hline
\rule{0pt}{15pt}\makeTableLine[\spalten]{}\\
\end{tabular}
}
\def\header#1#2#3#4#5#6#7{\pagestyle{empty}
\begin{minipage}[t]{0.47\textwidth}
\begin{flushleft}
{\bf #4}\\
#5
\end{flushleft}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\begin{flushright}
#6 \vspace{0.5cm}\\
% Number of Columns Definition of Columns second empty line
% \begin{tabular}{|*{5}{C{1cm}|}}\hline A1&A2&A3&A4&$\Sigma$\\\hline&&&&\\\hline\end{tabular}\\\vspace*{0.1cm}
\aufgTable{#7}
\end{flushright}
\end{minipage}
\vspace{1cm}
\begin{center}
{\Large\bf Sheet #1}
{(Hand in #3)}
\end{center}
}
%counts the exercisenumber
\newcounter{n}
%Kommando für Aufgaben
%\Aufgabe{AufgTitel}{Punktezahl}
\newcommand{\Aufgabe}[2]{\stepcounter{n}
\textbf{Exercise \arabic{n}: #1} (#2 Points)}
\newcommand{\textcorr}[1]{\textcolor{red}{#1}}
\newenvironment{corr}{\color{red}}{\color{black}\newline}
\newcommand{\ok}{\begin{corr}
$\checkmark$
\end{corr}}
\newcommand{\enot}[2]{#1 \cdot 10^{#2}}
\begin{document}
%\header{BlattNr}{Tutor}{Abgabedatum}{Vorlesungsname}{Namen}{Semester}{Anzahl Aufgaben}
\header{8}{}{2015-12-06}{Kommunikationsnetze}{\textit{Jonas Jaszkowic, 3592719}\\\textit{Jan-Peter Hohloch, 3908712}}{WS 15/16}{4}
\vspace{1cm}
\Aufgabe{ALOHA, CSMA and CSMA/CD}{5+5+5+5}
\begin{enumerate}
\item ALOHA with timeout $2 \cdot t_0$
\item nonpersistent CSMA with timeout $2 \cdot t_0$
\item nonpersistent CSMA/CD with minimum waiting time $t_0$
\item $0.5$-persistent CSMA/CD with slot length $2 \cdot t_0$
\end{enumerate}
\Aufgabe{Code Division Multiple Access(CDMA)}{10+10+10}
\begin{enumerate}
\item Generate Walsh-Tables for $n=8$:\\
\begin{math}
W_1=\begin{pmatrix}
-1
\end{pmatrix},\ W_2=\begin{pmatrix}
-1 & -1\\
-1 & 1
\end{pmatrix},\ W_4=\begin{pmatrix}
-1 & -1 & -1 & -1\\
-1 & 1 & -1 & 1\\
-1 & -1 & 1 & 1\\
-1 & 1 & 1 & -1\\
\end{pmatrix}\\
W_8=\begin{pmatrix}
-1 & -1 & -1 & -1&-1 & -1 & -1 & -1\\
-1 & 1 & -1 & 1&-1 & 1 & -1 & 1\\
-1 & -1 & 1 & 1&-1 & -1 & 1 & 1\\
-1 & 1 & 1 & -1&-1 & 1 & 1 & -1\\
-1 & -1 & -1 &-1&1 & 1 & 1 & 1\\
-1 & 1 & -1 & 1&1 & -1 & 1 & -1\\
-1 & -1 & 1 & 1&1 & 1 & -1 & -1\\
-1 & 1 & 1 & -1&1 & -1 & -1 & 1\\
\end{pmatrix}=\begin{pmatrix}
c_0&c_1&c_2&c_3&c_4&c_5&c_6&c_7
\end{pmatrix}
\end{math}
\item $c_2$ is orthogonal to all other chips:\\
\begin{math}\begin{scriptsize}
c_0\cdot c_2=\begin{pmatrix}
-1\\-1\\-1\\-1\\-1\\-1\\-1\\-1
\end{pmatrix}\cdot\begin{pmatrix}
-1\\-1\\1\\1\\-1\\-1\\1\\1
\end{pmatrix}=1+1-1-1+1+1-1-1=0\\
c_1\cdot c_2=\begin{pmatrix}
-1\\1\\-1\\1\\-1\\1\\-1\\1
\end{pmatrix}\cdot \begin{pmatrix}
-1\\-1\\1\\1\\-1\\-1\\1\\1
\end{pmatrix}=1-1-1+1+1-1-1+1=0\\
c_3\cdot c_2=\begin{pmatrix}
-1\\1\\1\\-1\\-1\\1\\1\\-1
\end{pmatrix}\cdot \begin{pmatrix}
-1\\-1\\1\\1\\-1\\-1\\1\\1
\end{pmatrix}=1-1+1-1+1-1+1-1=0\\
c_4\cdot c_2=\begin{pmatrix}
-1\\-1\\-1\\-1\\1\\1\\1\\1
\end{pmatrix}\cdot\begin{pmatrix}
-1\\-1\\1\\1\\-1\\-1\\1\\1
\end{pmatrix}=1+1-1-1-1-1+1+1=0\\
c_5\cdot c_2=\begin{pmatrix}
-1\\1\\-1\\1\\1\\-1\\1\\-1
\end{pmatrix}\cdot \begin{pmatrix}
-1\\-1\\1\\1\\-1\\-1\\1\\1
\end{pmatrix}=1-1-1+1-1+1+1-1=0\\
c_6\cdot c_2=\begin{pmatrix}
-1\\-1\\1\\1\\1\\1\\-1\\-1
\end{pmatrix}\cdot\begin{pmatrix}
-1\\-1\\1\\1\\-1\\-1\\1\\1
\end{pmatrix}=1+1+1+1-1-1-1-1=0\\
c_7\cdot c_2=\begin{pmatrix}
-1\\1\\1\\-1\\1\\-1\\-1\\1
\end{pmatrix}\cdot\begin{pmatrix}
-1\\-1\\1\\1\\-1\\-1\\1\\1
\end{pmatrix}=1-1+1-1-1+1-1+1=0\\
\end{scriptsize}\Rightarrow c_2
\end{math} is orthogonal to all other chips.
\item Stations 1 to 4 send \texttt{00,01,10,11}:\\
\begin{itemize}
\item Stations 0 and 5 to 7 send $\begin{pmatrix}
0&0&0&0&0&0&0&0
\end{pmatrix}$ for two ticks
\item Station 1 sends
\begin{enumerate}
\item $(-1)\cdot\begin{pmatrix}
-1&1&-1&1&-1&1&-1&1
\end{pmatrix}=\begin{pmatrix}
1&-1&1&-1&1&-1&1&-1
\end{pmatrix}$
\item $(-1)\cdot\begin{pmatrix}
-1&1&-1&1&-1&1&-1&1
\end{pmatrix}=\begin{pmatrix}
1&-1&1&-1&1&-1&1&-1
\end{pmatrix}$
\end{enumerate}
\item Station 2 sends
\begin{enumerate}
\item $(-1)\cdot \begin{pmatrix}
-1&-1&1&1&-1&-1&1&1
\end{pmatrix}=\begin{pmatrix}
1&1&-1&-1&1&1&-1&-1
\end{pmatrix}$
\item $1\cdot \begin{pmatrix}
-1&-1&1&1&-1&-1&1&1
\end{pmatrix}=\begin{pmatrix}
-1&-1&1&1&-1&-1&1&1
\end{pmatrix}$
\end{enumerate}
\item Station 3 sends
\begin{enumerate}
\item $1\cdot \begin{pmatrix}
-1&1&1&-1&-1&1&1&-1
\end{pmatrix}= \begin{pmatrix}
-1&1&1&-1&-1&1&1&-1
\end{pmatrix}$
\item $(-1)\cdot \begin{pmatrix}
-1&1&1&-1&-1&1&1&-1
\end{pmatrix}= \begin{pmatrix}
1&-1&-1&1&1&-1&-1&1
\end{pmatrix}$
\end{enumerate}
\item Station 4 sends
\begin{enumerate}
\item $1\cdot \begin{pmatrix}
-1&-1&-1&-1&1&1&1&1
\end{pmatrix}=\begin{pmatrix}
-1&-1&-1&-1&1&1&1&1
\end{pmatrix}$
\item $1\cdot \begin{pmatrix}
-1&-1&-1&-1&1&1&1&1
\end{pmatrix}=\begin{pmatrix}
-1&-1&-1&-1&1&1&1&1
\end{pmatrix}$
\end{enumerate}
\end{itemize}
$\Rightarrow$ Data is: \begin{enumerate}
\item \begin{math}
\begin{array}
{l c c c c c c c c}
&1&-1&1&-1&1&-1&1&-1\\
+&1&1&-1&-1&1&1&-1&-1\\
+&-1&1&1&-1&-1&1&1&-1\\
+&-1&-1&-1&-1&1&1&1&1\\\hline
=&0&0&0&-4&2&2&2&-2
\end{array}
\end{math}
\item \begin{math}
\begin{array}
{l c c c c c c c c}
&1&-1&1&-1&1&-1&1&-1\\
+&-1&-1&1&1&-1&-1&1&1\\
+&1&-1&-1&1&1&-1&-1&1\\
+&-1&-1&-1&-1&1&1&1&1\\\hline
=&0&-4&0&0&2&-2&2&2
\end{array}
\end{math}
\end{enumerate}
\end{enumerate}
\Aufgabe{Token Ring}{10+10}
\begin{enumerate}
\item
\item
\end{enumerate}
\Aufgabe{Ethernet}{5+5+5+5+5+5}
\begin{enumerate}
\item
\item
\item
\item
\item
\item
\end{enumerate}
\end{document}