Commit e545abb5 authored by Jim Hefferon's avatar Jim Hefferon

DG reported links in TOC don't work in answers

parent d427ec3c
......@@ -77,13 +77,17 @@
}
% An \item in the answerlist is made by \begin{ans}{One.II.3.4} .. \end{ans}
% They were put there by answer.sty on LaTeX-ing the book.
\ifhrefout
\renewenvironment{ans}[1]{\item[\hyperref{book.pdf}{exercise}{#1}{#1}\hypertarget{ans.#1}{}]}{%
}
\else
\renewenvironment{ans}[1]{\item[#1]}{%
}
\fi
% \ifhrefout
% \renewenvironment{ans}[1]{\item[\hyperref{book.pdf}{exercise}{#1}{#1}\hypertarget{ans.#1}{}]}{%
% }
% \else
% \renewenvironment{ans}[1]{\item[#1]}{%
% }
% \fi
\renewenvironment{ans}[1]{\begin{answerlist}%
\item[\hyperref{book.pdf}{exercise}{#1}{#1}\hypertarget{ans.#1}{}]}{%
\end{answerlist}
}
......@@ -205,38 +209,38 @@
% PAGE LAYOUT
%
% CHAPTER and SUBSECTION commands
\renewcommand{\chapter}{\secdef\chapcmda\chapcmdb}
\newcommand{\chapcmda}[2][]{%
\addcontentsline{toc}{chapter}{#1}%
\chapheader{#1}}
\newcommand{\chapcmdb}[1]{\chapheader{#1}}
\newcommand{\chapheader}[1]{\end{answerlist}
\clearemptydoublepage\thispagestyle{empty} %
\vspace*{4ex}
{\centering{\LARGE\bfseries #1}}%
\vspace{-2ex plus1ex}%
\begin{answerlist}\item[]
}
\renewcommand{\section}{\@startsection%
{section}{1}{0em}{-12ex plus1ex minus2ex}{1em}%
{\raggedright\Large\bfseries}}
\renewcommand{\subsection}{\secdef\anssubseccmda\anssubseccmdb}
\newcommand{\anssubseccmda}[2][?]{%
%\end{answerlist}
\addcontentsline{toc}{subsection}{#1}%
\anssubsecheader{#2}}
\newcommand{\anssubseccmdb}[1]{\anssubsecheader{#1}}
\newcommand{\anssubsecheader}[1]{\end{answerlist}%
\vspace{4ex plus1ex minus.5ex}\pagebreak[3]\vspace*{1ex plus1ex minus.25ex}%
{\flushleft\large\bfseries #1}%
\nopagebreak\vspace{1ex plus .5ex minus.5ex}\nopagebreak\begin{answerlist}\item[]}
% \renewcommand{\chapter}{\secdef\chapcmda\chapcmdb}
% \newcommand{\chapcmda}[2][]{%
% \addcontentsline{toc}{chapter}{#1}%
% \chapheader{#1}}
% \newcommand{\chapcmdb}[1]{\chapheader{#1}}
% \newcommand{\chapheader}[1]{% \end{answerlist}
% \clearemptydoublepage\thispagestyle{empty} %
% \vspace*{4ex}
% {\centering{\LARGE\bfseries #1}}%
% \vspace{-2ex plus1ex}%
% % \begin{answerlist}\item[]
% }
% \renewcommand{\section}{\@startsection%
% {section}{1}{0em}{-12ex plus1ex minus2ex}{1em}%
% {\raggedright\Large\bfseries}}
% \renewcommand{\subsection}{\secdef\anssubseccmda\anssubseccmdb}
% \newcommand{\anssubseccmda}[2][?]{%
% %\end{answerlist}
% \addcontentsline{toc}{subsection}{#1}%
% \anssubsecheader{#2}}
% \newcommand{\anssubseccmdb}[1]{\anssubsecheader{#1}}
% \newcommand{\anssubsecheader}[1]{% \end{answerlist}%
% \vspace{4ex plus1ex minus.5ex}\pagebreak[3]\vspace*{1ex plus1ex minus.25ex}%
% {\flushleft\large\bfseries #1}%
% \nopagebreak\vspace{1ex plus .5ex minus.5ex} % \nopagebreak\begin{answerlist}\item[]}
%end PAGE LAYOUT
......
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
......@@ -97,29 +97,48 @@
\begin{document}
\include{coverans}\include{symlist}
\setcounter{page}{1}\pagenumbering{arabic}
%\chapter*{Answers to Exercises}
\thispagestyle{empty}
\textit{These are answers to the exercises in \emph{Linear Algebra} by
J.~Hef{}feron.
Corrections or comments are very welcome, email to
jim\@joshua.smcvt.edu}
\textit{An answer labeled here as, for instance,
One.II.3.4, matches the question numbered 4
from the first chapter,
second section, and third subsection.
The Topics are numbered separately.}
\vspace{.25in}
% \frontmatter
% \setcounter{page}{1}\pagenumbering{arabic}
% \thispagestyle{empty}
% \begin{answerlist}\item[]%
\chapter*{Preface}
These are answers to the exercises in \textit{Linear Algebra} by
J~Hef{}feron.
An answer labeled here as, for instance,
One.II.3.4, matches the question numbered 4
from the first chapter,
second section, and third subsection.
The Topics are numbered separately.
Save this file in the same directory as the book
so that clicking on the question number in the book takes you to its answer
and clicking on the answer number takes you to the associated question,
provided that you don't change the names of the saved
files.\footnote{Yes, I once got a report of the links
not working that proved to be due to the person
saving the files with changed names.}
Bug reports or comments are very welcome.
For contact information see the book's home page
\url{http://joshua.smcvt.edu/linearalgebra}.
\vspace{.5in}
\begin{raggedright}
Hope this helps, \\
Jim Hef{}feron \\
Saint Michael's College, Colchester VT USA \\
2012-Oct-12
\end{raggedright}
\clearemptydoublepage\tableofcontents
\setcounter{page}{1}
\mainmatter
\thispagestyle{empty}
\begin{answerlist}\item[]%
\clearemptydoublepage\tableofcontents
\input{\ansfile}
% \input bookans % for them all
%\input recans % for the recommended ones only
%\input otherans % for the non-recommended ones only
\end{answerlist}
% \end{answerlist}
\end{document}
......
\documentclass{lab}
\includeonly{cover,
preface,
sageintro,
gauss,
spaces,
matrices,
% maps,
\includeonly{% cover,
% preface,
% sageintro,
% gauss,
% spaces,
% matrices,
maps,
% geometry,
% determinants,
% eigenvalues,
......@@ -33,7 +33,7 @@
\include{gauss}
\include{spaces}
\include{matrices}
% \include{maps}
\include{maps}
% \include{geometry}
% \include{determinants}
% \include{eigenvalues}
......
\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:
# Checks for maps.tex
print "\n\n---- Defining ----"
print " symbolically"
a, b = var('a, b')
T_symbolic(a, b) = [a+b, a-b, b]
print "T_symbolic is\n",T_symbolic
T = linear_transformation(RR^2, RR^3, T_symbolic)
print "instance of linear transformation is\n",T
print "T.matrix(side='right')\n",T.matrix(side='right')
v = vector(RR, [1, 3])
print "v=",v
print "T(v)=\n",T(v)
print "T.kernel()\n",T.kernel()
print "T.image()\n",T.image()
print "define a not-one-to-one map"
S_symbolic(a, b) = [a+2*b, a+2*b]
print "S_symbolic is\n", S_symbolic
S = linear_transformation(RR^2, RR^2, S_symbolic)
print "S=\n",S
print "v=",v
print "S(v)=",S(v)
print "S.kernel()=\n", S.kernel()
print "S.image()=\n", S.image()
print " via matrices"
A = matrix(RR, [[1, 2], [3, 4]])
print "A=\n",A
F = linear_transformation(RR^2, RR^2, A, side='right')
print "F=\n",F
v = vector(RR, [1, -1])
print "v=",v
print "F(v)=\n",F(v)
print "F.kernel()\n",F.kernel()
print "F.image()\n",F.image()
print "is F.image() == RR^2?",F.image() == RR^2
......@@ -284,7 +284,7 @@ record was 1954-May-06.
available in your library, on the Internet,
or in the Answers to the Exercises.}
\begin{Filesave}{bookans} % 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}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment