\def\timesbeta{\mskip2mu\beta}
\def\tower{\mathop\uparrow}
+% Bit strings
+\def\0{{\bf 0}}
+\def\1{{\bf 1}}
+\def\(#1){\left<#1\right>}
+
% A reversed version of \ddots with extra space at the top to get good alignment of exponents.
\def\rddots{\mathinner{\mkern1mu\raise\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu
\raise4\p@\hbox{.}\mkern2mu\raise7\p@\hbox{.}\raise11\p@\hbox{}\mkern1mu}}
\def\lemman{\lemma\label}
\def\defnn{\defn\label}
\def\algn{\alg\label}
+\def\notan{\nota\label}
\def\proof{\noindent {\sl Proof.}\enspace}
\def\proofsketch{\noindent {\sl Proof sketch.}\enspace}
\n{$\log^* n$}{the iterated logarithm: $\log^*n := \min\{i: \log^{(i)}n < 1\}$; the inverse of~$2\tower n$}
\n{$\beta(m,n)$}{$\beta(m,n) := \min\{i: \log^{(i)}n < m/n \}$ \[itjarthm]}
\n{$W$}{word size of the RAM \[wordsize]}
+\n{$\(x)$}{number~$x\in{\bb N}$ written in binary \[bintota]}
+\n{$\(x)_b$}{$\(x)$ zero-padded to exactly $b$ bits \[bitnota]}
+\n{$\sigma^k$}{the string~$\sigma$ repeated $k$~times \[bitnota]}
}
%--------------------------------------------------------------------------------
Another approach to division is using the improved elementary school algorithm as described
by Knuth in~\cite{knuth:seminalg}. It uses $\O(k^2)$ steps, but the steps involve
calculation of the most significant bit set in a~word. We will show below that it
-can be done in constant time without using division.
+can be done in constant time, but we have to be careful to avoid division instructions.
\qed
-\nota
+\notan{Vectors}
We will use boldface letters for vectors. The components of a~vector~${\bf x}$
-will be denoted as $x_1,\ldots,x_n$.
+will be denoted as $x_0,\ldots,x_{d-1}$.
+
+\notan{Bit strings}\id{bitnota}%
+We will work with binary representations of natural numbers as strings over the
+alphabet $\{\0,\1\}$: we will use $\(x)$ for the number~$x$ written in binary,
+$\(x)_b$ for the same padded to exactly $b$ bits by adding zeroes at the beginning.
+Strings will be denoted by Greek letters and the usual conventions will be utilized
+for string operations: $\alpha\beta$ for concatenation and $\alpha^k$ for the
+string~$\alpha$ repeated $k$~times. When the meaning is clear from the context,
+we will use $x$ and $\(x)$ interchangeably to avoid outbreak of symbols.
\defn
-The \df{canonical representation} of a~vector $(x_1,\ldots,x_n)$ of~$b$-bit numbers
-is an~integer XXXXXXXXXXXXXXX
+The \df{bitwise encoding} of a~vector ${\bf x}=(x_0,\ldots,x_{d-1})$ of~$b$-bit numbers
+is an~integer $\0\(x_{d-1})_b\0\(x_{d-2})_b\0\ldots\0\(x_0)_b$.
+
+\para
+If we wish for the whole vector to fit in a~single word, we need $(b+1)d\le W$.
+By using multiple-precision arithmetics, we can encode all vectors satisfying $bd=\O(W)$.
+We will now describe how to translate simple vector manipulations to RAM operations on their
+codes.
\endpart