\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{pdfpages}
\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}

\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]{A\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 Assignment #1}

{(Hand-in date #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 Punkte)\\}




\begin{document}
    %\header{BlattNr}{Tutor}{Abgabedatum}{Vorlesungsname}{Namen}{Semester}{Anzahl Aufgaben}
    \header{7}{}{2015-06-16}{Mobile Robots}{
        \textit{Jan-Peter Hohloch}\\ \textit{Maximus Mutschler}
    }{SS 15}{3}
    \vspace{1cm}

    \Aufgabe{Occupancy Gridmap}{9}
    \begin{enumerate}[(a)]
        \item $\frac{p(m_i|z_{1,\dots,t})}{1-p(m_i|z_{1,\dots,t})}=\frac{p(m_i|z_t)}{1-p(m_i|z_t)}\frac{p(m_i|z_{1,\dots,t-1})}{1-p(m_i|z_{1,\dots,t-1})}\frac{1-p(m_i)}{p(m_i)}$\\
        $\Leftrightarrow\frac{A}{1-A}=\underbrace{\frac{B}{1-B}\frac{C}{1-C}\frac{1-D}{D}}_F$\\
        $\Leftrightarrow A=(1-A)F$\\
        $\Leftrightarrow A=\left(1+\frac{1}{F}\right)^{-1}=\left(1+\frac{1-B}{B}\frac{1-C}{C}\frac{D}{1-D}\right)^{-1}=\left(1+\frac{1-p(m_i|z_t)}{p(m_i|z_t)}\frac{1-p(m_i|z_{1,\dots,t-1})}{p(m_i|z_{1,\dots,t-1})}\frac{p(m_i)}{1-p(m_i)}\right)^{-1}$
        \item 4 Add/Sub, 6 Div/Mult
        \item 1 Add/Sub, 3 Div/Mult
        \item TODO %TODO, ...
    \end{enumerate}
    \Aufgabe{Quadtree}{6}
    \begin{enumerate}[(a)]
        \item TODO %TODO
        \item TODO %TODO wtf?
        \item $256^2=\left(2^8\right)^2=4^8$\\
        $\Rightarrow$ maxdepth: 9\\
        $\Rightarrow$ maxnodes: $\sum\limits_{i=0}^9\frac{4^9-1}{4-1}=87381$
    \end{enumerate}
    \Aufgabe{Topological Maps}{5}
        \begin{enumerate}[(a)]
            \item \includegraphics[width=\textwidth]{voroni.jpg}
            \item[(c)] \begin{tikzpicture}[auto,node distance=2.0cm]
                \node[state] (A) {};
                \node[state] (B) [right of=A] {};
                \node[state] (C) [right of=B] {};
                \node[state] (D) [right of=C] {};
                \node[state] (E) [above of=D] {};
                \node[state] (F) [right of=E] {};
                \node (help) [below of=F] {};
                \node[state] (G) [below of=help] {};
                \node[state] (H) [left of=G] {};
                \node[state] (I) [below of=G] {};
                \node[state] (J) [left of=I] {};
                \node[state] (K) [below of=C] {};
                \node[state] (L) [below of=K] {};
                \node[state] (M) [left of=K] {};
                \node[state] (N) [below of=M] {};
                \node[state] (O) [left of=N] {};

                \path
                    (A)edge(B)(B)edge(C)(C)edge(D)(D)edge(E)(E)edge(F)(F)edge(G)(G)edge(I)(I)edge(J)(J)edge(H)(H)edge(D)
                    (C)edge(K)
                    (K)edge(L)
                    (K)edge(M)
                    (M)edge(N)
                    (N)edge(O);
            \end{tikzpicture}
        \end{enumerate}
\end{document}

