Add files for FIR
[matthijs/master-project/final-presentation.git] / christiaan / dotproduct.lhs
diff --git a/christiaan/dotproduct.lhs b/christiaan/dotproduct.lhs
new file mode 100644 (file)
index 0000000..4a150c9
--- /dev/null
@@ -0,0 +1,56 @@
+%include talk.fmt
+\subsection{Dot Product}
+\begin{frame}
+   \frametitle{Dot Product}
+     \[
+     y = \overrightarrow x  \bullet \overrightarrow h 
+     \]
+\end{frame}
+
+\begin{frame}
+   \frametitle{Dot Product}
+     \[
+     y = \overrightarrow x  \bullet \overrightarrow h 
+     \]
+     \[
+     \overrightarrow x  \bullet \overrightarrow h  = \sum\nolimits_{i = 1}^n {a_1  \cdot b_1  + a_2  \cdot b_2  +  \ldots  + a_n  \cdot b_n } 
+     \]
+\end{frame}
+
+\begin{frame}
+  \frametitle{Dot Product}
+   \begin{itemize}
+    \item Two steps to define: \\
+    \[
+    \overrightarrow x  \bullet \overrightarrow h  = \sum\nolimits_{i = 1}^n {a_1  \cdot b_1  + a_2  \cdot b_2  +  \ldots  + a_n  \cdot b_n } 
+    \]
+    \begin{itemize}
+      \item \emph{Pairwise Multiplication}: \\
+      \begin{verbatim}
+      zipwith (*) xs hs =
+        < x0*h0, x1*h1, x(n-1)*h(n-1)>       
+      \end{verbatim}
+      \item \emph{Summation}: \\
+      \begin{verbatim}
+      foldl (+) 0 zs =
+        (..((0+z0)+z1)+..+z(n-1))
+      \end{verbatim}
+    \end{itemize}
+   \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{Dot Product}
+   \begin{itemize}
+    \item Two steps to define: \\
+    \[
+    \overrightarrow x  \bullet \overrightarrow h  = \sum\nolimits_{i = 1}^n {a_1  \cdot b_1  + a_2  \cdot b_2  +  \ldots  + a_n  \cdot b_n } 
+    \]
+    \begin{itemize}
+      \item \emph{Combine the two}: \\
+      \begin{verbatim}
+      xs ** hs = foldl (+) 0 (zipWith (*) xs hs)
+      \end{verbatim}
+    \end{itemize}
+   \end{itemize}
+\end{frame}
\ No newline at end of file