<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[addpoints,10pt]{exam}
\usepackage{url}
\usepackage{color}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{amsmath}

\pagestyle{headandfoot}
\runningheadrule
\firstpageheadrule

\firstpageheader{Scientific Computing}{Matrix multiplication}{Oct 28, 2014}
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
\firstpagefooter{}{}{}
\runningfooter{}{}{}
\pointsinmargin
\bracketedpoints

%\printanswers
\shadedsolutions

\usepackage[mediumspace,mediumqspace,Gray]{SIunits}      % \ohm, \micro

%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{listings}
\lstset{
 basicstyle=\ttfamily,
 numbers=left,
 showstringspaces=false,
 language=Matlab,
 breaklines=true,
 breakautoindent=true,
 columns=flexible,
 frame=single,
 captionpos=t,
 xleftmargin=2em,
 xrightmargin=1em,
 aboveskip=10pt,
 %title=\lstname,
 title={\protect\filename@parse{\lstname}\protect\filename@base.\protect\filename@ext}
 }


\begin{document}

\sffamily
%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%%

\begin{questions}
  \question \textbf{Matrix multiplication} 
  Calculate the results of the following matrix multiplications and
  confirm the result using matlab.
    \[ \begin{pmatrix} 2 \\ -4 \\ -1 \end{pmatrix} \cdot
    \begin{pmatrix} 3 &amp; -4 &amp; -4 \end{pmatrix} = \]

    \[ \begin{pmatrix} 3 &amp; -3 &amp; -1 \end{pmatrix} \cdot
    \begin{pmatrix} 2 \\ 3 \\ 0 \end{pmatrix} = \]

    \[ \begin{pmatrix} 4 &amp; -1 &amp; 2 \\ -1 &amp; 3 &amp; 1 \\ 4 &amp; -2 &amp; 1 \\ 4 &amp; -3 &amp; -2 \end{pmatrix} \cdot
    \begin{pmatrix} -2 &amp; -2 &amp; 0 &amp; -3 \\ 3 &amp; -2 &amp; 1 &amp; 0 \\ 1 &amp; -2 &amp; -4 &amp; 0 \end{pmatrix} = \]

    \[ \begin{pmatrix} 3 &amp; 1 \\ 1 &amp; 4 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; -3 &amp; 4 &amp; 1 \\ -2 &amp; -1 &amp; -2 &amp; -3 \\ -3 &amp; 1 &amp; -2 &amp; -3 \end{pmatrix} = \]

    \[ \begin{pmatrix} 1 &amp; 1 &amp; -4 \end{pmatrix} \cdot
    \begin{pmatrix} -1 \\ 2 \end{pmatrix} = \]

    \[ \begin{pmatrix} 3 &amp; 1 &amp; -2 \\ 2 &amp; 1 &amp; 3 \\ 1 &amp; 1 &amp; 2 \end{pmatrix} \cdot
    \begin{pmatrix} 2 &amp; 2 \\ -3 &amp; 3 \\ -4 &amp; 1 \end{pmatrix} = \]

    \[ \begin{pmatrix} 3 \\ 2 \end{pmatrix} \cdot
    \begin{pmatrix} -3 &amp; 2 &amp; -4 &amp; 1 \end{pmatrix} = \]

    \[ \begin{pmatrix} -1 \\ -4 \\ -1 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; -4 &amp; 1 \end{pmatrix} = \]

    \[ \begin{pmatrix} 4 &amp; -2 &amp; -2 &amp; -4 \end{pmatrix} \cdot
    \begin{pmatrix} 2 \\ 2 \\ 1 \\ -1 \end{pmatrix} = \]

    \[ \begin{pmatrix} -2 &amp; -3 &amp; -4 \\ 1 &amp; 3 &amp; 2 \\ -4 &amp; -2 &amp; 1 \end{pmatrix} \cdot
    \begin{pmatrix} 1 &amp; 2 &amp; -2 &amp; 4 \\ 3 &amp; -1 &amp; 1 &amp; -1 \\ -3 &amp; 2 &amp; -1 &amp; 2 \end{pmatrix} = \]

   \[ \begin{pmatrix} 2 &amp; -4 &amp; 4 &amp; 4 \\ -3 &amp; 3 &amp; 2 &amp; 1 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; 3 &amp; 4 &amp; -2 \\ -4 &amp; -2 &amp; -1 &amp; 0 \\ 1 &amp; 2 &amp; -4 &amp; -4 \\ 3 &amp; 2 &amp; -2 &amp; -4 \end{pmatrix} = \]

    \[ \begin{pmatrix} 3 &amp; 1 &amp; -2 &amp; -2 \end{pmatrix} \cdot
    \begin{pmatrix} -4 \\ 3 \\ -2 \\ 4 \end{pmatrix} = \]

    \[ \begin{pmatrix} -1 &amp; 3 &amp; 4 \end{pmatrix} \cdot
    \begin{pmatrix} -1 \\ 4 \\ -3 \end{pmatrix} = \]

    \[ \begin{pmatrix} 1 &amp; -4 &amp; 3 &amp; 3 \end{pmatrix} \cdot
    \begin{pmatrix} 1 \\ 0 \\ -4 \\ -1 \end{pmatrix} = \]

    \[ \begin{pmatrix} -4 &amp; -4 &amp; -3 \\ -2 &amp; -2 &amp; 4 \\ -3 &amp; 4 &amp; -3 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; 3 &amp; -4 &amp; 4 \\ -1 &amp; -2 &amp; -3 &amp; 1 \\ 1 &amp; -2 &amp; 2 &amp; 0 \end{pmatrix} = \]

    \[ \begin{pmatrix} -3 &amp; 0 &amp; 4 &amp; 1 \\ 0 &amp; 1 &amp; 1 &amp; 4 \end{pmatrix} \cdot
    \begin{pmatrix} -4 &amp; 3 &amp; 1 &amp; 4 \\ 1 &amp; -4 &amp; 1 &amp; -3 \\ -4 &amp; 0 &amp; -4 &amp; -4 \\ 1 &amp; -2 &amp; 4 &amp; 4 \end{pmatrix} = \]

    \[ \begin{pmatrix} 4 \\ 3 \\ 4 \\ -2 \end{pmatrix} \cdot
    \begin{pmatrix} 2 &amp; 4 &amp; 3 &amp; 3 \end{pmatrix} = \]

    \[ \begin{pmatrix} 1 &amp; 2 &amp; 0 &amp; 3 \end{pmatrix} \cdot
    \begin{pmatrix} -3 \\ 1 \\ 1 \end{pmatrix} = \]

    \[ \begin{pmatrix} -4 &amp; 0 &amp; -1 &amp; 3 \\ 0 &amp; -4 &amp; 3 &amp; -3 \end{pmatrix} \cdot
    \begin{pmatrix} -1 &amp; -4 &amp; -1 \\ 3 &amp; 2 &amp; 0 \\ -2 &amp; 3 &amp; -2 \\ 1 &amp; 2 &amp; -2 \end{pmatrix} = \]

    \[ \begin{pmatrix} 2 &amp; 0 &amp; 3 \\ 1 &amp; -4 &amp; -1 \\ 3 &amp; 0 &amp; -2 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; 2 &amp; -1 &amp; -2 \\ -1 &amp; -1 &amp; -3 &amp; 4 \\ 2 &amp; 4 &amp; -4 &amp; 1 \end{pmatrix} = \]
    \[ \begin{pmatrix} -1 &amp; 4 \end{pmatrix} \cdot
    \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \]

    \[ \begin{pmatrix} -4 &amp; 3 \\ -4 &amp; 0 \\ -2 &amp; -2 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; 1 &amp; -4 &amp; 2 \\ 2 &amp; 3 &amp; -2 &amp; -1 \end{pmatrix} = \]

    \[ \begin{pmatrix} -2 &amp; -1 \end{pmatrix} \cdot
    \begin{pmatrix} 1 \\ -2 \end{pmatrix} = \]

    \[ \begin{pmatrix} -2 &amp; 2 &amp; -2 &amp; -3 \\ 2 &amp; -4 &amp; -2 &amp; 2 \\ 0 &amp; 2 &amp; -2 &amp; -2 \\ 1 &amp; -2 &amp; -2 &amp; -2 \end{pmatrix} \cdot
    \begin{pmatrix} 1 &amp; -2 &amp; 2 \\ -4 &amp; -2 &amp; -2 \\ 3 &amp; 1 &amp; 4 \\ -4 &amp; 1 &amp; -2 \end{pmatrix} = \]

    \[ \begin{pmatrix} -1 &amp; -3 &amp; 0 &amp; -1 \\ 4 &amp; -2 &amp; 1 &amp; 2 \end{pmatrix} \cdot
    \begin{pmatrix} -3 &amp; -4 \\ -4 &amp; 0 \end{pmatrix} = \]

    \[ \begin{pmatrix} -1 &amp; 1 &amp; -2 \\ -2 &amp; 2 &amp; -4 \\ 1 &amp; -2 &amp; -2 \end{pmatrix} \cdot
    \begin{pmatrix} -1 &amp; 2 &amp; -4 \\ 1 &amp; 3 &amp; 0 \\ 1 &amp; 4 &amp; -4 \end{pmatrix} = \]

    \[ \begin{pmatrix} -3 &amp; 3 \\ -3 &amp; 2 \end{pmatrix} \cdot
    \begin{pmatrix} 2 &amp; -3 \\ -2 &amp; -4 \end{pmatrix} = \]

    \[ \begin{pmatrix} 1 &amp; 1 &amp; -3 \end{pmatrix} \cdot
    \begin{pmatrix} -1 \\ -2 \\ 3 \end{pmatrix} = \]

    \[ \begin{pmatrix} -4 &amp; 2 &amp; 1 \\ 4 &amp; 0 &amp; -2 \\ 2 &amp; 3 &amp; -3 \\ -2 &amp; -2 &amp; -2 \end{pmatrix} \cdot
    \begin{pmatrix} -1 &amp; 2 &amp; 0 &amp; -2 \\ 2 &amp; -2 &amp; 0 &amp; -1 \\ -4 &amp; 3 &amp; -3 &amp; 4 \end{pmatrix} = \]

    \[ \begin{pmatrix} -2 &amp; -4 &amp; 2 &amp; 4 \\ 3 &amp; -3 &amp; 2 &amp; 1 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; 4 &amp; -1 &amp; -4 \\ 2 &amp; 3 &amp; -4 &amp; -1 \\ 3 &amp; 2 &amp; -2 &amp; 4 \end{pmatrix} = \]

   \[ \begin{pmatrix} -3 &amp; -2 &amp; -1 &amp; -3 \end{pmatrix} \cdot
    \begin{pmatrix} 2 \\ -2 \\ 3 \\ -2 \end{pmatrix} = \]

    \[ \begin{pmatrix} 4 &amp; 4 &amp; 2 &amp; 3 \end{pmatrix} \cdot
    \begin{pmatrix} 3 \\ 3 \\ -2 \\ 1 \end{pmatrix} = \]

    \[ \begin{pmatrix} 3 &amp; 2 &amp; -2 \end{pmatrix} \cdot
    \begin{pmatrix} 2 \\ 4 \\ 3 \end{pmatrix} = \]

    \[ \begin{pmatrix} 2 &amp; -1 &amp; 0 &amp; -2 \\ 0 &amp; -4 &amp; -3 &amp; -1 \end{pmatrix} \cdot
    \begin{pmatrix} 4 &amp; -3 &amp; 2 &amp; 4 \\ -3 &amp; -4 &amp; 1 &amp; 1 \\ 1 &amp; 3 &amp; -2 &amp; 3 \\ -1 &amp; -2 &amp; 3 &amp; 0 \end{pmatrix} = \]

    \[ \begin{pmatrix} -3 &amp; -3 &amp; 3 &amp; 2 \\ 2 &amp; 2 &amp; -3 &amp; 1 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; 1 \\ 4 &amp; 2 \\ -3 &amp; -1 \\ -3 &amp; 4 \end{pmatrix} = \]

    \[ \begin{pmatrix} -4 &amp; -3 \end{pmatrix} \cdot
    \begin{pmatrix} -2 \\ 3 \\ 4 \end{pmatrix} = \]

    \[ \begin{pmatrix} 4 &amp; 4 \end{pmatrix} \cdot
    \begin{pmatrix} 1 \\ 4 \\ -1 \end{pmatrix} = \]

    \[ \begin{pmatrix} 1 &amp; -2 &amp; 3 \end{pmatrix} \cdot
    \begin{pmatrix} 3 \\ 1 \\ 2 \end{pmatrix} = \]

    \[ \begin{pmatrix} -3 &amp; 2 \end{pmatrix} \cdot
    \begin{pmatrix} -1 \\ 1 \end{pmatrix} = \]

    \[ \begin{pmatrix} -2 &amp; -4 &amp; -4 &amp; 0 \\ 0 &amp; 3 &amp; 4 &amp; -4 \\ 4 &amp; 2 &amp; -2 &amp; -4 \\ 0 &amp; 0 &amp; 4 &amp; -1 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; -1 \\ -1 &amp; 1 \\ -4 &amp; -3 \\ 2 &amp; 1 \end{pmatrix} = \]

    \[ \begin{pmatrix} -3 \\ 3 \\ -3 \\ -4 \end{pmatrix} \cdot
    \begin{pmatrix} 2 &amp; 4 &amp; -2 &amp; 1 \end{pmatrix} = \]

    \[ \begin{pmatrix} 2 \\ 0 \end{pmatrix} \cdot
    \begin{pmatrix} -1 &amp; -3 &amp; -2 &amp; 2 \end{pmatrix} = \]

    \[ \begin{pmatrix} 0 &amp; -4 &amp; -4 &amp; 4 \end{pmatrix} \cdot
    \begin{pmatrix} 1 \\ 4 \\ 0 \\ 4 \end{pmatrix} = \]

    \[ \begin{pmatrix} -3 &amp; -1 \\ -3 &amp; -1 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; -3 &amp; 3 &amp; -2 \\ -4 &amp; 1 &amp; -1 &amp; 4 \end{pmatrix} = \]

    \[ \begin{pmatrix} 4 &amp; 0 \\ -1 &amp; 4 \\ 1 &amp; -3 \end{pmatrix} \cdot
    \begin{pmatrix} -4 &amp; -4 \\ -4 &amp; 2 \end{pmatrix} = \]

    \[ \begin{pmatrix} -1 \\ 3 \\ 2 \\ 4 \end{pmatrix} \cdot
    \begin{pmatrix} 0 &amp; -1 &amp; 0 &amp; 0 \end{pmatrix} = \]

    \[ \begin{pmatrix} 3 \\ -2 \\ 2 \\ 3 \end{pmatrix} \cdot
    \begin{pmatrix} -2 &amp; -3 &amp; -4 &amp; 2 \end{pmatrix} = \]

    \[ \begin{pmatrix} 2 &amp; -2 &amp; -4 &amp; 4 \\ 0 &amp; 1 &amp; -3 &amp; -2 \\ -1 &amp; 3 &amp; 0 &amp; -2 \end{pmatrix} \cdot
    \begin{pmatrix} -4 &amp; 1 \\ -4 &amp; 3 \end{pmatrix} = \]

    \[ \begin{pmatrix} -4 &amp; -1 &amp; 3 \end{pmatrix} \cdot
    \begin{pmatrix} -4 \\ -3 \\ 3 \end{pmatrix} = \]

  \question \textbf{Automatic generation of exercises}
  Write some matlab code that generates exercises like this one automatically! :-) 
  
\end{questions}


\end{document}
</pre></body></html>