% ----------------------------------------------------------------------

\chapter[Hexadecimal notation, et al.]{Hexadecimal and other notational matters}
\label{hex}
\index{convention}

% diagn: the introduction to this appendix has been replanned and
% rewritten; it wants *at least* two reviews on sufficiently separated
% dates. (The old introduction bore an inadvertent air of impudence
% which, hopefully, the new introduction lessens.)
%
% diagn: The whole appendix moreover has been revised and could bear
% one reading.

Convention is a practical necessity in mathematical notation.  Consider
\[
  \reflectbox{\rotatebox[origin=c]{90}{$5$}}\:
  ;|\,;\!
  \:\rotatebox[origin=c]{90}{$5$}\vartriangleright
  \cdots\square
\]
which (say) means ``two plus two equals four,'' as long as one grasps
that~``$;$'' means two,~``$\square$'' means four,
``$
  \,\reflectbox{\rotatebox[origin=c]{90}{$5$}}\:
  |
  \:\rotatebox[origin=c]{90}{$5$}\vartriangleright
$''
indicates addition, and so on.  No one can actually read such
hieroglyphics, though, whereas
\[
  2+2=4
\]
is immediately readable without further explication, however arbitrary
conventional symbols like~``$2$,'' ``$4$,'' ``$+$,'' and so on might
seem.  And how arbitrary are the conventional symbols, really?
Well, individually, the conventional symbols are arbitrary enough, yet
the received body of conventional mathematical notation is not \emph{merely}
arbitrary.  The notation is worn to fit like an old boot, rather,
centuries of mathematical practice being the foot which has
broken the boot in.  Today, if one wishes to write
mathematical ideas to others---and indeed, very likely, if one wishes
to write mathematical ideas even to oneself---then one will probably
follow convention.

\index{$\pi$}
Sometimes however the conventional notation can embody the wrong idea.
Sometimes the notation inadvertently suggests a thought, or lends a
perspective, the writer writing it never meant.  Sometimes the notation
is merely awkward, as in Girolamo Cardan's~1539 letter to Tartaglia:
\begin{quote}
  [T]he cube of one-third of the coefficient of the unknown is
  greater in value than the square of one-half of the
  number.~\cite{mathbios}
\end{quote}
Cardan means,
\[
  \left(\frac{a}{3}\right)^3 > \left(\frac{x}{2}\right)^2.
\]
Fortunately, convention has since~1539 condensed such notation, as you
see; so Cardan's trouble has little troubled this book.

\section{The symbol~$2\pi$}
\label{hex:240.05}
\index{$2\pi$!as a symbol}

\index{$\pi$}
What has troubled this book, slightly, is the familiar
\[
  \pi \approx 3.1416.
\]
The notation is familiar because it is conventional, and it is
conventional because, well, that is just how people write mathematics.
Nevertheless, for this book's purpose, the expression as
written---though conventional and indisputably
{a}{c}\-{c}{u}\-{r}{a}{t}{e}---inadvertently introduces two
questionable ideas the book's writer never intended to entertain:
\begin{itemize}
  \item
    it inadvertently introduces the idea that~$\pi$ as such were a
    quantity of special interest (it isn't);
  \item
    it inadvertently introduces the idea that the tenth, hundredth,
    thousandth and ten thousandth parts of~$\pi$ deserved the reader's
    notice (they don't).
\end{itemize}
Whether such ideas might merit attention in another book is not a question
the appendix you are reading will consider.  The question rather is
whether the ideas have come \emph{here,} unbidden, as uninvited guests.

The book prefers the notation
\[
  2\pi \approx \mr{0x6.487F}.
\]
Though less conventional,
%\footnote{Less conventional \emph{for now,} that is.  The writer makes no predictions.}
this notation dismisses the guests.

%The importance of conventional mathematical notation is hard to
%overstate.  Such notation serves two distinct purposes: it conveys
%mathematical ideas from writer to reader; and it concisely summarizes
%complex ideas on paper to the writer himself.  Without the notation, one
%would find it difficult even to think clearly about the mathematics; to
%discuss it with others, nearly impossible.
%
%The right notation is not always conveniently found at hand, of course.
%The discoverer of a new mathematical idea may require new notation to
%represent it.  Even the user of an old mathematical idea may find that
%its old notation no longer suits.
%
%Regarding the last problem:  old notation is conventional, and
%convention is---and ought to be---a steep hill to climb.
%Indeed, mathematics already enjoys excellent conventional notation, worn
%like an old boot to fit the collected experience of the centuries.
%Nevertheless, slavish devotion to convention does not serve
%the mathematical literature well; for how else shall notation be made
%to better fit the coming experience future mathematicians may gain, if
%writers will not incrementally improve the notation today?
%Consider the notation of the algebraist Girolamo Cardan in his 1539
%letter to Tartaglia:
%\begin{quote}
%  [T]he cube of one-third of the coefficient of the unknown is
%  greater in value than the square of one-half of the
%  number.~\cite{mathbios}
%\end{quote}
%If Cardan lived today, surely he would express the same thought in the
%form
%\[
%  \left(\frac{a}{3}\right)^3 > \left(\frac{x}{2}\right)^2.
%\]
%Good notation matters.
%
%Although this book has neither brief nor wish to overhaul applied
%mathematical notation generally, the book does seek to aid the
%honorable cause of notational evolution in a few specifics.  For
%example, the book
%sometimes treats~$2\pi$ implicitly as a single symbol, so that (for
%instance) the quarter revolution or right angle is expressed as $2\pi/4$
%rather than as the less evocative $\pi/2$.

Taken as a single symbol~$2\pi$ seems preferable to~$\pi$ (for~$\pi$
after all represents only half a circle), but~$2\pi$ taken as a single symbol
remains, maybe, visually still a bit awkward.  One wants instead to
introduce some new symbol%
\footnote{%
  % diagn: review this footnote.
  See among others \cite{Palais:2001}\cite{Bartholomew}\cite{Lindenberg}.%
  %
  %The writer is aware that there exists online a mildly
  %notorious, spirited but not especially original essay that aspires to
  %leadership in the cause of~$2\pi$ as a sort of crusade, or at least
  %to leadership in the cause of~$2\pi$ as a scheme, as it were, to set
  %fire to the sofa in the faculty lounge.  The essay's straw-man
  %antagonists are mathematics professors who, as
  %seen from the essay's perspective, refuse to rouse themselves from
  %apathy to laud the shining virtues of~$2\pi$.  The present writer
  %likes~$2\pi$, too, but the essay is a bit much.
  %
  %The essay need not be named here and would hardly be mentioned
  %except that it affects to gather proponents of~$2\pi$ (like,
  %for example, this writer) under its crusading banner.  The appendix
  %you are reading has part neither in the essay nor in the crusade.  As to
  %the sofa, if fire is to be set to it, that can be done
  %without this writer's help.
  %
  %The essay is probably an obstacle to its own cause.
  %
  %Observe that this footnote is the book's only footnote to explicitly
  %disassociate the book from a particular source.  If disassociation is
  %felt to be necessary, then has the essay's author considered whether
  %the essay itself might be an obstacle to the achievement of the
  %essay's stated goal?
  %
  %Meanwhile, as a general rule, if the persons authoring influential
  %mathematical works are disproportionately members of university
  %mathematics faculties, you don't get them to adopt your preferred
  %notation by insulting them from afar.
  %
  %For a fun, unpretentious alternative, less well known than the essay
  %but older than and superior to it, covering similar ground,
  %try~\cite{Lindenberg}, instead.%
  %
  %The writer
  %is aware there there further exists online a ``Tau manifesto'' but
  %has nothing to do with it.  The manifesto, perhaps (at this writing)
  %more notorious than original, is neither endorsed nor credited nor
  %cited as a source.
  %of which you may have heard,
  %though I feel insufficiently risqu\'e to
  %cite a ``manifesto'' as a mathematical source in my own work.
  %
  %One would have preferred to pass over the manifesto in
  %silence, if for no other reason than that adverse criticism is
  %too easily mistaken for envy; but, unfortunately, at this writing,
  %the manifesto has amassed slightly too much notoriety to ignore.
  %% The next line, commented out, is probably unnecessary.
  %%I would not have my own work, such as it is, conflated with it.
  %To name the document a manifesto lends an unfortunate whiff of
  %``Let's set fire to the sofa in the faculty lounge,'' a whiff the
  %manifesto's prose does little to dispel.  The manifesto's
  %author---plainly an intelligent, energetic, engaging fellow---laments
  %the professional apathy with which his proposal has been received yet
  %he laments this without considering how his own style might have made
  %it harder for otherwise potentially sympathetic authorities to
  %embrace the rather obvious cause he favors---a worthy cause on its
  %own merits but an unoriginal one.  The manifesto has attracted
  %sophomores who are producing sophomoric online videos in promotion of
  %the manifesto, videos brimming with (strangely conformist) sophomoric
  %impudence toward received authority generally (oddly, the impudence
  %having been encouraged \emph{by} a certain strain of authority, which
  %is weird, whence my phrase, ``strangely conformist,'' but let that
  %pass).  It's not good.  The video-producing sophomores are perhaps
  %young enough to be excused but the manifesto's author, who otherwise
  %makes several valid points, is old enough to know better.
  %
  %Today's mathematical authorities were kids once, too.  Authorities
  %will indulge a certain degree of immodest youthful exuberance from
  %the sufficiently young but they should not be asked to emulate such
  %exuberance.  To play the part of adults is their duty.
  %
  %The cause might progress in spite of the manifesto.  The cause seems
  %unlikely to progress \emph{because} of the manifesto.  Anyway, it's
  %not a cause, is it?  Well, literally, perhaps it \emph{is} a cause; but in
  %the context of this footnote I would rather say that the~$2\pi$ is merely a
  %notation.  If you asked my advice (and you needn't), then I would
  %advise you to try the notation sometime in your own theoretical work
  %and, if you wish, even to try out Palais' symbol~$\palais$; but you
  %won't need a manifesto to do that\@.  ---THB---%
}
$\xi=2\pi$, $\tau=2\pi$ or $\palais=2\pi$ (the last being slightly
preferred by this writer).  However, inasmuch as the book has already
stretched to reach the more substantive \S~\ref{hex:240.1}, next, caution
here prevails and the style~$2\pi$ is retained.

% ----------------------------------------------------------------------

\section{Hexadecimal numerals}
\label{hex:240.1}
\index{hexadecimal}
\index{$\mbox{0x}$}

Treating~$2\pi$ sometimes as a single symbol is a small step, unlikely
to trouble readers much.  A bolder step is to adopt from the
computer-science and computer-engineering
literature the important notational improvement of the
hexadecimal numeral.  No incremental step is possible here; either we
leap the ditch or we remain on the wrong side.  In this book, we choose
to leap.

Traditional decimal notation seems unobjectionable for measured quantities
like 63.7~miles, $\$1.32$ million or $9.81\:\mr{m}/\mr{s}^2$, but its
iterative tenfold structure meets little or no aesthetic support in
mathematical theory.  Consider for instance the decimal numeral 127,
whose number suggests a significant idea to the computer scientist or
computer engineer but
whose decimal notation does nothing to convey the notion of the largest
signed integer storable in a byte.  Better is the base-sixteen
hexadecimal notation 0x7F, which clearly expresses the idea of $2^7-1$.
To the reader who is not a computer scientist or computer engineer,
the aesthetical advantage
may not seem immediately clear from the one example, but consider the
decimal numeral 2,147,483,647, which represents the largest signed integer
storable in a standard thirty-two bit word.  In hexadecimal notation,
this is $\mr{0x7FFF\,FFFF}$, or in other words $2^{\mr{0x1F}}-1$.  The
question is: which notation more clearly captures the idea?

By contrast, decimal notation like 499,999 does not really convey any
interesting \emph{mathematical} idea at all, except with regard to a
special focus on tens---a focus which is of immense practical use but
which otherwise tells one very little about numbers, as numbers.
Indeed, one might go so far as to say that the notation 499,999 were
misleading, insofar as it attaches mathematically false interest to the
idea it represents.  (The hexadecimal representation $\mr{0x7A11F} =
\text{499,999}$ by contrast suggests to the eye at once the arguably,
relatively insignificant character of the number in question.  So,
which is the more interesting quantity, all things considered?  A
2,147,483,647 or a 499,999?)

Now, one does not wish to sell the hexadecimal numeral too hard.
Decimal numerals are fine:  the author uses them as often, and likes
them as well, as almost anyone does.  Familiar idiosyncrasy has
value, after all.  Nevertheless, the author had a
choice when writing this book, and for \emph{this} book the hexadecimal
numeral seemed the proper, conceptually elegant choice---proper and
conceptually elegant enough indeed to risk deviating this far from
convention---so that is the numeral he chose.

To readers unfamiliar with the hexadecimal notation, to explain very
briefly: hexadecimal represents numbers not in tens but rather in
sixteens.  The rightmost place in a hexadecimal numeral represents ones;
the next place leftward, sixteens; the next place leftward, sixteens
squared; the next, sixteens cubed, and so on.  For instance, the
hexadecimal numeral 0x1357 means ``seven, plus five times sixteen, plus
thrice sixteen times sixteen, plus once sixteen times sixteen times
sixteen'' (all of which totals to 4951 in decimal).  In hexadecimal, the
sixteen symbols 0123456789ABCDEF respectively represent the numbers zero
through fifteen, with sixteen being written 0x10.

All this raises the sensible question: why sixteen?%
\footnote{
  An alternative~\cite[book~6, no.~83]{Laplace-Ouvres}
  advocated by some nineteenth-century
  writers was twelve.  (Laplace, cited, was not indeed one of the
  advocates, or at any rate was not a strong advocate; however, his
  context appears to have lain in the promotion of base twelve by
  contemporaries.)  In base twelve, one quarter, one third and one half
  are respectively written 0.3, 0.4 and 0.6.  Also, the hour angles
  (\S~\ref{trig:260}) come in neat increments of $(0.06)(2\pi)$ in base
  twelve, so there are some real advantages to that base.  Hexadecimal,
  however, besides having momentum from the computer-science and
  computer-engineering literature,
  is preferred for its straightforward proxy of binary.
}
The answer is that sixteen is~$2^4$, so hexadecimal (base sixteen) is
found to offer a convenient shorthand for binary (base two, the
fundamental, smallest possible base).  Each of the sixteen hexadecimal
digits represents a unique sequence of exactly four bits (binary
digits).  Binary is inherently theoretically interesting, but direct
binary notation is unwieldy (the hexadecimal numeral 0x1357 is binary
$\mr{0001\,0011\,0101\,0111}$), so hexadecimal is written in proxy.

Admittedly, the hexadecimal~``0x'' notation is bulky and overloads the
letters~A through~F (letters which otherwise conventionally often
represent matrices or indeterminate coefficients).  However, the greater
trouble with the hexadecimal notation is not in the notation itself but
rather in the unfamiliarity with it.  The reason it is unfamiliar is
that it is not often encountered outside the computer-science and
computer-engineering
literature, but it is not encountered because it is not used, and it is
not used because it is not familiar, and so on in a cycle.  It seems
to this writer, on aesthetic grounds, that this particular cycle is
worth breaking, so the book you are reading employs the hexadecimal system
for integers larger than~9.  If you have never yet used the hexadecimal
system, it is worth your while to learn it.  For the sake of conceptual
elegance, at the risk of transgressing entrenched convention, this book
employs hexadecimal throughout.

The book occasionally omits the cumbersome hexadecimal prefix~``0x,''
as for example when it arrays hexadecimal numerals in matrices (as in
\S~\ref{gjrank:341.01} where~A is ten but, unfortunately potentially
confusingly,~$A$, set in italics, is a matrix; and as in
Fig.~\ref{drvtv:pasc}).
% diagn: check that the references of the above paragraph are not later lost!

\index{measure, unit of}
\index{unit!of measure}
\index{physical unit}
\index{unit!physical}
The book seldom mentions numbers with physical units of measure
attached but, when it does, it expresses those in decimal rather than
hexadecimal no\-ta\-tion---for example, $v_\mr{sound}=331\:\mr{m/s}$
rather than $v_\mr{sound}=\mr{0x14B}\:\mr{m/s}$.

%Combining the hexadecimal and~$2\pi$ ideas, we note here
%for interest's sake that
%\[
%  2\pi \approx \mr{0x6.487F}.
%\]
%(The author does not know whether or where, deep in the hexadecimal
%digits of~$2\pi$, a sequence like $55555555$ appears but, if and where
%it did, it would strike him as potentially rather more interesting than
%some sequence $55555555$ deep in the \emph{decimal} digits.)

% ----------------------------------------------------------------------

\section{Avoiding notational clutter}
\label{hex:270.2}
\index{clutter, notational}

Good applied mathematical notation is not cluttered.  Good notation does
not necessarily include every possible limit, qualification, superscript
and subscript.  For example, the sum
\[
  S = \sum_{i=1}^{M}\sum_{j=1}^{N} a_{ij}^2
\]
might be written less thoroughly but more readably as
\[
  S = \sum_{i,j} a_{ij}^2
\]
if the meaning of the latter were clear from the context.

When to omit subscripts and such is naturally a matter of style and
subjective judgment, but in practice such judgment is often not hard to
render.  The balance is between showing few enough symbols that the
interesting parts of an equation are not obscured visually in a tangle
and a haze of redundant little letters, strokes and squiggles, on the
one hand; and on the other hand showing enough detail that the reader
who opens the book directly to the page has a fair chance to understand
what is printed there without studying the whole book carefully up to
that point.  Where appropriate, this book often condenses notation and
omits redundant symbols.

