# HG changeset patch # User Santosh G. Vattam # Date 1256723275 -19800 # Node ID 68cb4265173a79ebf45b8e9899a5bcbb7b7d53e7 # Parent c435d5846ef59d1d33be5f145affd823a3118a9c# Parent 15306dad3b8116f00ac9977feee711a996ecb403 Merged branches. diff -r 15306dad3b81 -r 68cb4265173a day1/session4.tex --- a/day1/session4.tex Wed Oct 28 15:17:39 2009 +0530 +++ b/day1/session4.tex Wed Oct 28 15:17:55 2009 +0530 @@ -282,8 +282,6 @@ In []: b = matrix([[1], [-2], [0]]) In []: x = linalg.solve(A, b) In []: Ax = dot(A, x) - In []: allclose(Ax, b) - Out[]: True \end{lstlisting} \end{frame} @@ -295,13 +293,37 @@ array([[ 1.], [-2.], [-2.]]) +\end{lstlisting} +\end{frame} +\begin{frame}[fragile] +\frametitle{Let's check!} +\begin{lstlisting} In []: Ax Out[]: matrix([[ 1.00000000e+00], [ -2.00000000e+00], [ 2.22044605e-16]]) \end{lstlisting} +\begin{block}{} +The last term in the matrix is actually \alert{0}!\\ +We can use \kwrd{allclose()} to check. +\end{block} +\begin{lstlisting} +In []: allclose(Ax, b) +Out[]: True +\end{lstlisting} +\end{frame} + +\subsection{Exercises} +\begin{frame}[fragile] +\frametitle{Problem 1} +\begin{align*} + x + y + 2z -w & = 3\\ + 2x + 5y - z - 9w & = -3\\ + 2x + y -z + 3w & = -11 \\ + x - 3y + 2z + 7w & = -5\\ +\end{align*} \end{frame} \section{Summary}