summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJovina2011-07-28 12:51:51 +0530
committerJovina2011-07-28 12:51:51 +0530
commit38a1bc772fe33e5008652be9cdcaa10ee8eeaf04 (patch)
tree52f53173a5be5de29a191887ad7b68093856ba6b
parenta4cf231a880aa13b7c28f5dc910b430e0e150440 (diff)
downloadst-scripts-38a1bc772fe33e5008652be9cdcaa10ee8eeaf04.tar.gz
st-scripts-38a1bc772fe33e5008652be9cdcaa10ee8eeaf04.tar.bz2
st-scripts-38a1bc772fe33e5008652be9cdcaa10ee8eeaf04.zip
Major changes to script & slides of "Matrices".
-rw-r--r--matrices/script.rst258
-rw-r--r--matrices/slides.org93
-rw-r--r--matrices/slides.tex180
3 files changed, 372 insertions, 159 deletions
diff --git a/matrices/script.rst b/matrices/script.rst
index a337605..559a50a 100644
--- a/matrices/script.rst
+++ b/matrices/script.rst
@@ -36,13 +36,21 @@
Matrices
========
+.. L1
+
{{{ Show the first slide containing title, name of the production
team along with the logo of MHRD }}}
+.. R1
+
Hello friends and welcome to the tutorial on 'Matrices'.
+.. L2
+
{{{ switch to slide with objectives }}}
+.. R2
+
At the end of this tutorial, you will be able to,
1. Create matrices using data.
@@ -55,97 +63,166 @@ At the end of this tutorial, you will be able to,
- norm of a matrix
- singular value decomposition of a matrix.
+.. L3
+
{{{ Switch to the pre-requisite slide }}}
+.. R3
+
Before beginning this tutorial,we would suggest you to complete the
tutorial on "Getting started with lists", "Getting started with arrays",
"Accessing parts of arrays".
+.. R4
+
+Let us start our ipython interpreter with pylab loaded
+
+.. L4
+::
+
+ ipython -pylab
+
+.. R5
+
All matrix operations are done using arrays. Thus all the operations
on arrays are valid on matrices also. A matrix may be created as,
+
+.. L5
::
- ipython -pylab
m1 = array([1,2,3,4])
+.. R6
+
Using the method ``shape``, we can find out the shape or size of the
matrix,
+
+.. L6
::
m1.shape
+.. R7
+
Since it is a one row four column matrix it returned a tuple, one by
four.
-A list can be converted to a matrix as follows,
+A list can also be converted to a matrix as follows,
+
+.. L7
::
l1 = [[1,2,3,4],[5,6,7,8]]
m2 = array(l1)
+.. R8
+
Pause the video here, try out the following exercise and resume the video.
-{{{ switch to slide, exercise 1}}}
+.. L8
+
+.. L9
+
+{{{ switch to slide, exercise 1 }}}
+
+.. R9
Create a two dimensional matrix m3 of order 2 by 4 with
elements 5, 6, 7, 8, 9, 10, 11, 12.
+.. R10
+
+Switch to terminal for solution
m3 can be created as,
+
+.. R11
+
+{{{ Switch to terminal }}}
::
m3 = array([[5,6,7,8],[9,10,11,12]])
-{{{ switch to next slide, matrix operations }}}
+.. R12
+Let us now move to matrix matrix operations
We can do matrix addition and subtraction easily.
+m3+m2 does element by element addition, that is matrix addition.
+Note that both the matrices are of the same order.
+
+.. L12
::
m3 + m2
-m3+m2 does element by element addition, that is matrix addition.
+.. R13
-Similarly,
+Similarly,m3-m2 does matrix subtraction, that is element by element
+subtraction.
+
+.. L13
::
m3 - m2
-Similarly,m3-m2 does matrix subtraction, that is element by element
-subtraction.
+.. R14
+
Now let us try,matrix multiplication
+
+.. L14
::
m3 * m2
+.. R15
+
Note that in arrays ``m3 * m2`` does element wise multiplication and not
matrix multiplication,
-And matrix multiplication in matrices are done using the function ``dot()``
+Matrix multiplication in matrices are done using the function ``dot()``
+
+.. L15
::
dot(m3, m2)
-but due to size mismatch the multiplication could not be done and it
+.. R16
+
+Due to size mismatch the multiplication could not be done and it
returned an error,
Now let us see an example for matrix multiplication. For doing matrix
multiplication we need to have two matrices of the order n by m and m
by r and the resulting matrix will be of the order n by r. Thus let us
first create two matrices which are compatible for multiplication.
+
+.. L16
::
m1.shape
+.. R17
+
matrix m1 is of the shape one by four, let us create another one, of
the order four by two,
+
+.. L17
::
m4 = array([[1,2],[3,4],[5,6],[7,8]])
dot(m1, m4)
-thus the function ``dot()`` can be used for matrix multiplication.
+.. R18
+
+Thus the ``dot()`` function is used for matrix multiplication.
+
+.. L18
+
+.. L19
{{{ switch to next slide, recall from arrays }}}
+.. R19
+
As we already learnt in arrays, the function ``identity()`` which
creates an identity matrix of the order n by n, the function ``zeros()``
which creates a matrix of the order m by n with all zeros, the function
@@ -155,35 +232,71 @@ order m by n with all ones, the function ``ones_like()`` which creates a
matrix with ones with the shape of the matrix passed; all these
functions can also be used with matrices.
-To find out the transpose of a matrix we can do,
+.. R20
+
+Let us now see, how to find out the transpose of a matrix we can do,
+
+.. L20
+
+{{{ Switch to the terminal }}}
::
print m4
m4.T
-Matrix name dot capital T will give the transpose of a matrix
+.. R21
+
+As you saw, Matrix name dot capital T will give the transpose of a matrix
-{{{ switch to next slide, Frobenius norm of inverse of matrix }}}
+Pause the video here, try out the following exercise and resume the video.
+
+.. L21
+
+.. L22
+
+{{{ switch to next slide, exercise 2:Frobenius norm & inverse }}}
-Now let us try to find out the Frobenius norm of inverse of a 4 by 4
+.. R22
+
+Find out the Frobenius norm of inverse of a 4 by 4
matrix, the matrix being,
+ m5 = arange(1,17).reshape(4,4)
+
+The Frobenius norm of a matrix is defined as,
+the square root of the sum of the absolute squares of its elements
+
+.. R23
+
+Switch to terminal for the solution
+Let us create the matrix m5 by using the data provided in the question
+
+.. L23
+
+{{{continue from paused state}}}
+{{{ Switch to the terminal }}}
::
m5 = arange(1,17).reshape(4,4)
print m5
+.. R24
+
The inverse of a matrix A, A raise to minus one, is also called the
reciprocal matrix, such that A multiplied by A inverse will give 1. The
Frobenius norm of a matrix is defined as square root of sum of squares
of elements in the matrix. The inverse of a matrix can be found using the
function ``inv(A)``.
-And here is the solution, first let us find the inverse of matrix m5.
+.. L24
::
im5 = inv(m5)
+.. R25
+
And the Frobenius norm of the matrix ``im5`` can be found out as,
+
+.. L25
::
sum = 0
@@ -191,15 +304,32 @@ And the Frobenius norm of the matrix ``im5`` can be found out as,
sum += each * each
print sqrt(sum)
-{{{ switch to next slide, infinity norm }}}
+.. R26
+
+Thus we have successfully obtained the frobenius norm of the matrix m5
+
+Pause the video here, try out the following exercise and resume the video.
+
+.. L26
+
+.. L27
+
+{{{ switch to next slide,exercise 3: infinity norm }}}
+
+.. R27
-Now let us move on to find out the infinity norm of the matrix im5.
+Find out the infinity norm of the matrix im5.
The infinity norm of a matrix is defined as the maximum value of sum of
-the absolute of elements in each row. Pause here and try to solve the
-problem yourself.
+the absolute of elements in each row.
+.. R28
-The solution for the problem is,
+Switch to terminal for the solution
+
+.. L28
+
+{{{continue from paused state}}}
+{{{ Switch to the terminal }}}
::
sum_rows = []
@@ -207,23 +337,45 @@ The solution for the problem is,
sum_rows.append(abs(i).sum())
print max(sum_rows)
-{{{ switch to slide the ``norm()`` method }}}
+.. R29
Well! to find the Frobenius norm and Infinity norm we have an even easier
method, and let us see that now.
+.. L29
+
+{{{ switch to slide the ``norm()`` method }}}
+
+.. R30
+
The norm of a matrix can be found out using the method
-``norm()``. Inorder to find out the Frobenius norm of the matrix im5,
+``norm()``.
+
+.. L30
+
+.. R31
+
+Inorder to find out the Frobenius norm of the matrix im5,
we do,
+
+.. L31
+
+{{{ Switch to the terminal }}}
::
norm(im5)
+.. R32
+
And to find out the Infinity norm of the matrix im5, we do,
+
+.. L32
::
norm(im5,ord=inf)
+.. R33
+
This is easier when compared to the code we wrote. Read the documentation
of ``norm`` to read up more about ord and the possible type of norms
the norm function produces.
@@ -232,42 +384,75 @@ Now let us find out the determinant of a the matrix m5.
The determinant of a square matrix can be obtained by using the function
``det()`` and the determinant of m5 can be found out as,
+
+.. L33
::
det(m5)
+.. R34
+
Hence we get the determinant.
+Let us now move on to eigen vectors and eigen values
+
+.. L34
+
+.. L35
{{{ switch to next slide, eigen vectors and eigen values }}}
+.. R35
+
The eigen values and eigen vector of a square matrix can be computed
using the function ``eig()`` and ``eigvals()``.
+.. R36
+
Let us find out the eigen values and eigen vectors of the matrix
m5. We find them as,
+
+.. L36
+
+{{{ Switch to the terminal }}}
::
eig(m5)
+.. R37
+
Note that it returned a tuple of two matrices. The first element in
the tuple are the eigen values and the second element in the tuple are
the eigen vectors. Thus the eigen values are given by,
+
+.. L37
::
eig(m5)[0]
+.. R38
+
and the eigen vectors are given by,
+
+.. L38
::
eig(m5)[1]
+.. R39
+
The eigen values can also be computed using the function ``eigvals()`` as,
+
+.. L39
::
eigvals(m5)
+.. L40
+
{{{ switch to next slide, singular value decomposition }}}
+.. R40
+
Now let us learn how to do the singular value decomposition or S V D
of a matrix.
@@ -283,16 +468,30 @@ diagonal, and V* is an (n by n) unitary matrix over K,which denotes the
conjugate transpose of V. Such a factorization is called the
singular-value decomposition of M.
+.. R41
+
The SVD of matrix m5 can be found as
+
+.. L41
+
+{{{ Switch to the terminal }}}
::
svd(m5)
+.. R42
+
Notice that it returned a tuple of 3 elements. The first one U the
next one Sigma and the third one V star.
-
+
+.. L42
+
+.. L43
+
{{{ switch to summary slide }}}
+.. R43
+
This brings us to the end of the end of this tutorial.In this tutorial,
we have learnt to,
@@ -307,8 +506,12 @@ we have learnt to,
#. Calculate singular value decomposition(SVD) of a matrix using the
function ``svd()``.
+.. L44
+
{{{Show self assessment questions slide}}}
+.. R44
+
Here are some self assessment questions for you to solve
1. A and B are two array objects. Element wise multiplication in
@@ -329,8 +532,12 @@ Here are some self assessment questions for you to solve
- True
- False
+.. L45
+
{{{solution of self assessment questions on slide}}}
+.. R45
+
And the answers,
1. Element wise multiplication between two matrices, A and B is done as,
@@ -343,9 +550,12 @@ And the answers,
3. ``norm(A,ord='fro')`` and ``norm(A)`` are same, since the order='fro'
stands for frobenius norm. Hence true.
+.. L46
{{{ switch to Thank you slide }}}
+.. R46
+
Hope you have enjoyed this tutorial and found it useful.
Thank you!
diff --git a/matrices/slides.org b/matrices/slides.org
index 4be93d2..b99bf7b 100644
--- a/matrices/slides.org
+++ b/matrices/slides.org
@@ -13,6 +13,7 @@
#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
#+LaTeX_HEADER: \usepackage{listings}
+#+LaTeX_HEADER: \usepackage{amsmath}
#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
@@ -63,37 +64,23 @@
- Getting started with Lists.
- Getting started with Arrays.
- Accessing parts of Arrays.
-* Creating a matrix
- - Creating a matrix using direct data
- : In []: m1 = array([1, 2, 3, 4])
- - Creating a matrix using lists
- : In []: l1 = [[1,2,3,4],[5,6,7,8]]
- : In []: m2 = array(l1)
* Exercise 1
- Create a (2, 4) matrix ~m3~
- : m3 = [[5, 6, 7, 8],
- : [9, 10, 11, 12
-* Matrix operations
- - Element-wise addition (both matrix should be of order ~mXn~)
- : In []: m3 + m2
- - Element-wise subtraction (both matrix should be of order ~mXn~)
- : In []: m3 - m2
-
+ - Create a two dimensional matrix ~m3~ of order (2, 4) with
+ elements 5, 6, 7, 8, 9, 10, 11, 12.
* Recall from ~array~
- - The functions
- - ~identity(n)~ -
- creates an identity matrix of order ~nXn~
- - ~zeros((m,n))~ -
- creates a matrix of order ~mXn~ with 0's
- - ~zeros_like(A)~ -
- creates a matrix with 0's similar to the shape of matrix ~A~
+ The following functions can also be used with matrices
+ - ~identity(n)~
+ - creates an identity matrix of order ~nXn~
+ - ~zeros((m,n))~
+ - creates a matrix of order ~mXn~ with 0's
+ - ~zeros\_like(A)~
+ - creates a matrix with 0's similar to the shape of matrix ~A~
- ~ones((m,n))~
- creates a matrix of order ~mXn~ with 1's
- - ~ones_like(A)~
- creates a matrix with 1's similar to the shape of matrix ~A~
- Can also be used with matrices
+ - creates a matrix of order ~mXn~ with 1's
+ - ~ones\_like(A)~
+ - creates a matrix with 1's similar to the shape of matrix ~A~
* Exercise 2 : Frobenius norm \& inverse
- Find out the Frobenius norm of inverse of a ~4 X 4~ matrix.
+ - Find out the Frobenius norm of inverse of a ~4 X 4~ matrix.
:
The matrix is
: m5 = arange(1,17).reshape(4,4)
@@ -108,7 +95,7 @@
$||A||_F = [\sum_{i,j} abs(a_{i,j})^2]^{1/2}$
#+end_latex
* Exercise 3 : Infinity norm
- Find the infinity norm of the matrix ~im5~
+ - Find the infinity norm of the matrix ~im5~
:
- Infinity norm is defined as,
#+begin_latex
@@ -120,17 +107,11 @@
- Infinity norm
: In []: norm(im5, ord=inf)
* eigen values \& eigen vectors
- Find out the eigen values and eigen vectors of the matrix ~m5~.
- :
- - eigen values and vectors can be found out using
- : In []: eig(m5)
- returns a tuple of /eigen values/ and /eigen vectors/
- - /eigen values/ in tuple
- - ~In []: eig(m5)[0]~
- - /eigen vectors/ in tuple
- - ~In []: eig(m5)[1]~
- - Computing /eigen values/ using ~eigvals()~
- : In []: eigvals(m5)
+ eigen values and eigen vectors
+ - eig()
+
+ Only eigen values
+ - eigvals()
* Singular Value Decomposition (~svd~)
#+begin_latex
$M = U \Sigma V^*$
@@ -153,15 +134,39 @@
- Create matrices using arrays.
- Add and multiply the elements of matrix.
- - Find out the inverse of a matrix,using the function ``inv()``.
- - Use the function ``det()`` to find the determinant of a matrix.
+ - Find out the inverse of a matrix,using the function ``inv()''.
+ - Use the function ``det()'' to find the determinant of a matrix.
- Calculate the norm of a matrix using the for loop and also using
- the function ``norm()``.
+ the function ``norm()''.
- Find out the eigen vectors and eigen values of a matrix, using
- functions ``eig()`` and ``eigvals()``.
+ functions ``eig()'' and ``eigvals()''.
- Calculate singular value decomposition(SVD) of a matrix using the
- function ``svd()``.
+ function ``svd()''.
+* Evaluation
+1. A and B are two array objects. Element wise multiplication in
+ matrices are done by,
+
+ - A * B
+ - multiply(A, B)
+ - dot(A, B)
+ - element\_multiply(A,B)
+
+2. ``eig(A)[ 1 ]'' and ``eigvals(A)'' are the same.
+
+ - True
+ - False
+
+3. ``norm(A,ord='fro')'' is the same as ``norm(A)'' ?
+
+ - True
+ - False
+* Solutions
+1. A * B
+
+2. False
+
+3. True
*
#+begin_latex
\begin{block}{}
diff --git a/matrices/slides.tex b/matrices/slides.tex
index 47ab0ad..592a380 100644
--- a/matrices/slides.tex
+++ b/matrices/slides.tex
@@ -1,4 +1,4 @@
-% Created 2011-06-06 Mon 13:56
+% Created 2011-07-28 Thu 12:41
\documentclass[presentation]{beamer}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
@@ -18,6 +18,7 @@
\usepackage[english]{babel} \usepackage{ae,aecompl}
\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
\usepackage{listings}
+\usepackage{amsmath}
\lstset{language=Python, basicstyle=\ttfamily\bfseries,
commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
showstringspaces=false, keywordstyle=\color{blue}\bfseries}
@@ -90,82 +91,52 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries}
\item Accessing parts of Arrays.
\end{itemize}
\end{frame}
-\begin{frame}[fragile]
-\frametitle{Creating a matrix}
+\begin{frame}
+\frametitle{Exercise 1}
\label{sec-4}
\begin{itemize}
-\item Creating a matrix using direct data
-\end{itemize}
-\begin{verbatim}
- In []: m1 = array([1, 2, 3, 4])
-\end{verbatim}
-
-
-\begin{itemize}
-\item Creating a matrix using lists
+\item Create a two dimensional matrix \verb~m3~ of order (2, 4) with
+ elements \\ 5, 6, 7, 8, 9, 10, 11, 12.
\end{itemize}
-\begin{verbatim}
- In []: l1 = [[1,2,3,4],[5,6,7,8]]
- In []: m2 = array(l1)
-\end{verbatim}
\end{frame}
-\begin{frame}[fragile]
-\frametitle{Exercise 1}
+\begin{frame}
+\frametitle{Recall from \verb~array~}
\label{sec-5}
- Create a (2, 4) matrix \verb~m3~
-\begin{verbatim}
- m3 = [[5, 6, 7, 8],
- [9, 10, 11, 12
-\end{verbatim}
-\end{frame}
-\begin{frame}[fragile]
-\frametitle{Matrix operations}
-\label{sec-6}
-
+ The following functions can also be used with matrices
\begin{itemize}
-\item Element-wise addition (both matrix should be of order \verb~mXn~)
-\begin{verbatim}
- In []: m3 + m2
-\end{verbatim}
-
-\item Element-wise subtraction (both matrix should be of order \verb~mXn~)
-\begin{verbatim}
- In []: m3 - m2
-\end{verbatim}
-
+\item \verb~identity(n)~
+\begin{itemize}
+\item creates an identity matrix of order \verb~nXn~
\end{itemize}
-\end{frame}
-\begin{frame}
-\frametitle{Recall from \verb~array~}
-\label{sec-7}
-
-
+\item \verb~zeros((m,n))~
\begin{itemize}
-\item The functions
+\item creates a matrix of order \verb~mXn~ with 0's
+\end{itemize}
+\item \verb~zeros\_like(A)~
\begin{itemize}
-\item \verb~identity(n)~ -
- creates an identity matrix of order \verb~nXn~
-\item \verb~zeros((m,n))~ -
- creates a matrix of order \verb~mXn~ with 0's
-\item \verb~zeros_like(A)~ -
- creates a matrix with 0's similar to the shape of matrix \verb~A~
+\item creates a matrix with 0's similar to the shape of matrix \verb~A~
+\end{itemize}
\item \verb~ones((m,n))~
- creates a matrix of order \verb~mXn~ with 1's
-\item \verb~ones_like(A)~
- creates a matrix with 1's similar to the shape of matrix \verb~A~
+\begin{itemize}
+\item creates a matrix of order \verb~mXn~ with 1's
+\end{itemize}
+\item \verb~ones\_like(A)~
+\begin{itemize}
+\item creates a matrix with 1's similar to the shape of matrix \verb~A~
\end{itemize}
\end{itemize}
- Can also be used with matrices
\end{frame}
\begin{frame}[fragile]
\frametitle{Exercise 2 : Frobenius norm \& inverse}
-\label{sec-8}
+\label{sec-6}
- Find out the Frobenius norm of inverse of a \verb~4 X 4~ matrix.
+\begin{itemize}
+\item Find out the Frobenius norm of inverse of a \verb~4 X 4~ matrix.
+\end{itemize}
\begin{verbatim}
\end{verbatim}
@@ -189,9 +160,11 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries}
\end{frame}
\begin{frame}[fragile]
\frametitle{Exercise 3 : Infinity norm}
-\label{sec-9}
+\label{sec-7}
- Find the infinity norm of the matrix \verb~im5~
+\begin{itemize}
+\item Find the infinity norm of the matrix \verb~im5~
+\end{itemize}
\begin{verbatim}
\end{verbatim}
@@ -204,7 +177,7 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries}
\end{frame}
\begin{frame}[fragile]
\frametitle{\verb~norm()~ method}
-\label{sec-10}
+\label{sec-8}
\begin{itemize}
@@ -220,41 +193,25 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries}
\end{itemize}
\end{frame}
-\begin{frame}[fragile]
+\begin{frame}
\frametitle{eigen values \& eigen vectors}
-\label{sec-11}
-
- Find out the eigen values and eigen vectors of the matrix \verb~m5~.
-\begin{verbatim}
-
-\end{verbatim}
+\label{sec-9}
+ eigen values and eigen vectors
\begin{itemize}
-\item eigen values and vectors can be found out using
-\begin{verbatim}
- In []: eig(m5)
-\end{verbatim}
-
- returns a tuple of \emph{eigen values} and \emph{eigen vectors}
-\item \emph{eigen values} in tuple
-\begin{itemize}
-\item \verb~In []: eig(m5)[0]~
+\item eig()
\end{itemize}
-\item \emph{eigen vectors} in tuple
-\begin{itemize}
-\item \verb~In []: eig(m5)[1]~
-\end{itemize}
-\item Computing \emph{eigen values} using \verb~eigvals()~
-\begin{verbatim}
- In []: eigvals(m5)
-\end{verbatim}
+
+ Only eigen values
+\begin{itemize}
+\item eigvals()
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Singular Value Decomposition (\verb~svd~)}
-\label{sec-12}
+\label{sec-10}
$M = U \Sigma V^*$
@@ -272,7 +229,7 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries}
\end{frame}
\begin{frame}
\frametitle{Summary}
-\label{sec-13}
+\label{sec-11}
In this tutorial, we have learnt to,
@@ -280,18 +237,59 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries}
\begin{itemize}
\item Create matrices using arrays.
\item Add and multiply the elements of matrix.
-\item Find out the inverse of a matrix,using the function ``inv()``.
-\item Use the function ``det()`` to find the determinant of a matrix.
+\item Find out the inverse of a matrix,using the function ``inv()''.
+\item Use the function ``det()'' to find the determinant of a matrix.
\item Calculate the norm of a matrix using the for loop and also using
- the function ``norm()``.
+ the function ``norm()''.
\item Find out the eigen vectors and eigen values of a matrix, using
- functions ``eig()`` and ``eigvals()``.
+ functions ``eig()'' and ``eigvals()''.
\item Calculate singular value decomposition(SVD) of a matrix using the
- function ``svd()``.
+ function ``svd()''.
\end{itemize}
\end{frame}
\begin{frame}
+\frametitle{Evaluation}
+\label{sec-12}
+
+
+\begin{enumerate}
+\item A and B are two array objects. Element wise multiplication in
+ matrices are done by,
+\begin{itemize}
+\item A * B
+\item multiply(A, B)
+\item dot(A, B)
+\item element\_multiply(A,B)
+\end{itemize}
+\vspace{5pt}
+\item ``eig(A)[ 1 ]'' and ``eigvals(A)'' are the same.
+\begin{itemize}
+\item True
+\item False
+\end{itemize}
+\vspace{5pt}
+\item ``norm(A,ord='fro')'' is the same as ``norm(A)'' ?
+\begin{itemize}
+\item True
+\item False
+\end{itemize}
+\end{enumerate}
+\end{frame}
+\begin{frame}
+\frametitle{Solutions}
+\label{sec-13}
+
+
+\begin{enumerate}
+\item A * B
+\vspace{12pt}
+\item False
+\vspace{12pt}
+\item True
+\end{enumerate}
+\end{frame}
+\begin{frame}
\begin{block}{}
\begin{center}