parent d427ec3c
No preview for this file type
 ... ... @@ -19685,7 +19685,7 @@ \end{ans} \subsection{Topic: Line of Best Fit} % write the records to the answer file. \item[]\textit{Data on the progression of the world's records \textit{Data on the progression of the world's records (taken from the \textit{Runner's World} web site) is below.} \begin{figure}
 ... ... @@ -10,11 +10,11 @@ % \date{\today} \thispagestyle{empty} \coverauthor \vspace*{2.8in} \vspace*{2.45in} \begin{center} {\bsifamily\Huge Answers to exercises} \end{center} \vspace*{2.8in} \vspace*{2.45in} \covergraphic %\maketitle % \vfill ... ...
No preview for this file type
 \chapter{Maps} %======================================== \section{Defining} We will see two different ways to define a linear transformation. \subsection{Symbolically} Start with a map that takes two inputs and returns three outputs. We have not yet defined a domain and codomain so this is a prototype for a function. \begin{lstlisting} sage: a, b = var('a, b') T_symbolic(a, b) = [a+b, a-b, b] sage: T_symbolic (a, b) |--> (a + b, a - b, b) \end{lstlisting} Make an instance of a function by applying $T_{\textit{symbolic}}$ on a particular domain and codomain. \begin{lstlisting} sage: T = linear_transformation(RR^2, RR^3, T_symbolic) sage: T Vector space morphism represented by the matrix: [ 1.00000000000000 1.00000000000000 0.000000000000000] [ 1.00000000000000 -1.00000000000000 1.00000000000000] Domain: Vector space of dimension 2 over Real Field with 53 bits of precision Codomain: Vector space of dimension 3 over Real Field with 53 bits of precision \end{lstlisting} Evaluating this function on a member of the domain gives a member of the codomain. \begin{lstlisting} sage: v = vector(RR, [1, 3]) sage: T(v) (4.00000000000000, -2.00000000000000, 3.00000000000000) \end{lstlisting} Above, \Sage{} lists a matrix representing the map but for a notation different than the book's. To represent the application of a linear transformation to a vector $T(\vec{v})$ we must choose one of two ways. The book writes matrix-vector product with the vector on the right of the matrix, but \Sage{} defaults to the case where the vector is on the left and this matrix fits that default. You can ask for the matrix that you expect. \begin{lstlisting} sage: T.matrix(side='right') [ 1.00000000000000 1.00000000000000] [ 1.00000000000000 -1.00000000000000] [0.000000000000000 1.00000000000000] \end{lstlisting} \Sage{} can compute the interesting things about the transformation. Here it finds the null space and range space, using the equivalent terms \textit{kernel} and \textit{image}. \begin{lstlisting} sage: T.kernel() Vector space of degree 2 and dimension 0 over Real Field with 53 bits of precision Basis matrix: [] sage: T.image() Vector space of degree 3 and dimension 2 over Real Field with 53 bits of precision Basis matrix: [ 1.00000000000000 0.000000000000000 0.500000000000000] [ 0.000000000000000 1.00000000000000 -0.500000000000000] \end{lstlisting} The null space's basis is empty so it is the trivial subspace of the domain, with dimension~$0$. Thus $T$ is one-to-one. Because the dimension of the null space and the dimension of the range space add to the dimension of the domain, the range space has the same dimension as the domain, $2$. This fits the two-vector basis shown. A map that is not one-to-one gives a contrast. \begin{lstlisting} sage: S_symbolic(a, b) = [a+2*b, a+2*b] sage: S_symbolic (a, b) |--> (a + 2*b, a + 2*b) sage: S = linear_transformation(RR^2, RR^2, S_symbolic) sage: S Vector space morphism represented by the matrix: [1.00000000000000 1.00000000000000] [2.00000000000000 2.00000000000000] Domain: Vector space of dimension 2 over Real Field with 53 bits of precision Codomain: Vector space of dimension 2 over Real Field with 53 bits of precision sage: S(v) (7.00000000000000, 7.00000000000000) \end{lstlisting} This map is not one-to-one since having $a=2$ and $b=0$ will give the same result as having $a=0$ and $b=1$. \begin{lstlisting} sage: S.kernel() Vector space of degree 2 and dimension 1 over Real Field with 53 bits of precision Basis matrix: [ 1.00000000000000 -0.500000000000000] sage: S.image() Vector space of degree 2 and dimension 1 over Real Field with 53 bits of precision Basis matrix: [1.00000000000000 1.00000000000000] \end{lstlisting} The null space has a nonzero dimension, $1$, which confirms that the map is not one-to-one. Since the dimension of the domain is the sum of the dimensions of the null space and the range space, the dimension of the range space must be~$1$, which is confirmed by \Sage{}. \subsection{Via matrices} If we fix a space for the domain and a space for the codomain, and bases for each, then we can define a transformation by giving the matrix that represents its action. We start by considering real spaces with the standard bases. \begin{lstlisting} sage: A = matrix(RR, [[1, 2], [3, 4]]) sage: A [1.00000000000000 2.00000000000000] [3.00000000000000 4.00000000000000] sage: F = linear_transformation(RR^2, RR^2, A, side='right') sage: F Vector space morphism represented by the matrix: [1.00000000000000 3.00000000000000] [2.00000000000000 4.00000000000000] Domain: Vector space of dimension 2 over Real Field with 53 bits of precision Codomain: Vector space of dimension 2 over Real Field with 53 bits of precision \end{lstlisting} (Again note that the matrix \Sage{} shows by default is the one for \inlinecode{side='left'}.) This was created with the same \inlinecode{linear_transformation} operation and it also is a function. \begin{lstlisting} sage: v = vector(RR, [1, -1]) sage: F(v) (-1.00000000000000, -1.00000000000000) \end{lstlisting} We can ask the same questions about this function. \begin{lstlisting} sage: F.kernel() Vector space of degree 2 and dimension 0 over Real Field with 53 bits of precision Basis matrix: [] sage: F.image() Vector space of degree 2 and dimension 2 over Real Field with 53 bits of precision Basis matrix: [ 1.00000000000000 0.000000000000000] [0.000000000000000 1.00000000000000] \end{lstlisting} The null space of $F$ is the trivial subspace of $\Re^2$ and so this function is one-to-one. The range space is all of $\Re^2$. \begin{lstlisting} sage: F.image() == RR^2 True \end{lstlisting} %======================================== \section{Operations} If we fix a domain and codomain then the set of linear transformations has some natural operations. \Sage{} can define those operations. \subsection{Addition} First, create a function to add to the prior one. \begin{lstlisting} sage: B = matrix(RR, [[1, -1], [2, -2]]) sage: G = linear_transformation(RR^2, RR^2, B, side='right') sage: G Vector space morphism represented by the matrix: [ 1.00000000000000 2.00000000000000] [-1.00000000000000 -2.00000000000000] Domain: Vector space of dimension 2 over Real Field with 53 bits of precision Codomain: Vector space of dimension 2 over Real Field with 53 bits of precision \end{lstlisting} Now we define the sum of the two by $F+G\,(\vec{v})$ is the map taking $\vec{v}$ to the sum of the two vectors $F(\vec{v})$ and $G(\vec{v})$. \begin{lstlisting} sage: H = F+G sage: F(v)+G(v) (1.00000000000000, 3.00000000000000) sage: H(v) (1.00000000000000, 3.00000000000000) \end{lstlisting} The sum of two matrices is defined as the operation on the representations that yields the representation of the function sum. \begin{lstlisting} sage: F.matrix(side='right') [1.00000000000000 2.00000000000000] [3.00000000000000 4.00000000000000] sage: G.matrix(side='right') [ 1.00000000000000 -1.00000000000000] [ 2.00000000000000 -2.00000000000000] sage: H.matrix(side='right') [2.00000000000000 1.00000000000000] [5.00000000000000 2.00000000000000] \end{lstlisting} The scalar multiple of a function and the scalar multiple of a matrix are defined analgously, except that we must write the scalar on the right. \begin{lstlisting} sage: F(v) (-1.00000000000000, -1.00000000000000) sage: H = F*3 sage: H(v) (-3.00000000000000, -3.00000000000000) \end{lstlisting} \subsection{Composition} \subsection{Inverse} %======================================== % \section{One-to-one and Onto} %======================================== \section{Alternate bases} \endinput TODO: