17

Decimal positional notation, the system for writing numbers we all use every single day, makes addition very easy by transforming it from a computation to a repeated operation on individual digits (long hand addition). A more formal description would be that if two numbers $a$ and $b$ are presented in decimal notation, long hand addition is a constant-memory, logarithmic time algorithm to obtain the decimal notation of the number $a+b$.

Multiplication (that is, long multiplication) is not so easy in decimal notation, requiring doubly logarithmic memory and logarithmic time while relying heavily on long hand addition as a "subroutine".

It is of course straightforward to invent a numeral system where the roles of the two operations are reversed: Just use the decimal notation of $\log(a)$ to denote the number $a$. Multiplication then becomes as simple as long hand addition in standard notation, because $\log(ab)=\log(a)+\log(b)$ (this is the principle behind the slide rule). Unfortunately, the price one has to pay for this convenience is that addition is suddenly very difficult.

Is there a numeral system that provides a balance between these two extremes, that is, a system for writing numbers in such a way that both addition and multiplication can be done by hand with less effort than decimal long multiplication, but perhaps greater effort than decimal long addition? (Note the focus on still being a system that is of practical use for manual computations; I doubt anyone would be able to execute the Schönhage–Strassen algorithm by hand, even it it has better asymptotic complexity than long multiplication.)

  • 2
    If you can easily convert between numbers and their logs, keep both the number and its log as a pair. – marty cohen Dec 21 '17 at 22:51
  • if it wasn't for the FFT involved I could. I understand all but those steps. –  Jul 25 '19 at 18:24
  • Before using a spreadsheet, I calculated everything by hand with primoradic. Then I designed addition and multiplication that I put in my spreadsheet. it works very well. Long and difficult to give answer here – Stéphane Jaouen May 12 '21 at 16:51
  • Conversions of numbers written in even very long decimal numbers to primoradic are straightforward. I can use the powers of 10. – Stéphane Jaouen May 12 '21 at 17:02
  • 1
    Short answer: if there was one, it would already be in use. –  May 12 '21 at 19:51
  • @StéphaneJaouen: you can convince me if you show me some complexity analysis. Need to beat $O(n)$ for addition and $O(n^2)$ for multiplication. –  May 12 '21 at 20:00
  • @YvesDaoust : pour les puissances de deux jusqu'à $2^{27721}$ environ, sur mon tableur archi mal "programmé", ça a pris 2/3 secondes pour vérifier la périodicité théorique de 27720 ;on peut optimiser très largement en utilisant les périodicités fournies grâce à la réponse de Gerry Myerson à ma question. – Stéphane Jaouen May 13 '21 at 08:19
  • The Schönhage–Strassen algorithm is completely unthinkable by hand, as it gets faster than other methods for numbers with dozen thousand digits. –  May 13 '21 at 08:37

2 Answers2

0

This is a late answer, but providing this for completion sake. This answer is restricted to integers.

I am assuming being able to do the calculations by hand implies

  1. being able to compute products of three small integers
  2. being willing to pre-compute some calculations (to enable amortization of the cost of those pre-computations across multiple calculations)
  3. being willing to work with just integers

A Residue Number System consisting of coprime numbers $m_1, m_2, m_3, \cdots, m_k$ where $k$ may be chosen depending on the largest number that we need to handle would make addition, subtraction and multiplication easy.

Arithmetic operations:

Residue representation. We represent an integer $x$ by the set of residues $x_i \equiv x \bmod m_i$.

Addition. Addition $a + b$ may be done by adding the residues $a_i + b_i \bmod m_i$ and converting the residue sums back.

Subtraction. Subtraction $a-b$ may be done by subtracting the residues $a_i - b_i \bmod m_i$ and converting the residue difference back.

Multiplication. Multiplication $ab$ may be done by multiplying the residues $a_i b_i \bmod m_i$ and converting the product residues back.

Conversion back to integer. The conversion of the residues back to an integer modulo $M = \prod_{j=1}^k m_j$ is done using Chinese Remainder Theorem. Given residues $x_i \bmod m_i$, we can compute the unique $x \bmod M$ as

$$ x = \prod_{i=1}^k x_i y_i \frac M {m_i}, \tag 1 $$

where $$y_i \frac {M} {m_i} \equiv 1 \pmod{m_i}. \tag 2$$

Each term of the Chinese Remainder Theorem requires three multiplications and a total of $k$ additions. The term $(M/m_i)^{-1} \bmod m_i$ in Eqn. (2) may be pre-calculated once for a given modulus $M$, even for large $M$ and reused for multiple calculations (something similar to a logarithm tables book used in the 20th century).

Limitations:

Division is hard in a Residue Number System. It can be simulated using repeated subtraction, however and is probably not suitable for calculation by hand. Since the OP did not care about division, I hope this answer suffices.

Other ideas:

Although this is aimed at arbitrarily large integers, it may be extended to arbitrarily large fixed precision numbers (i.e., fixed precision reals) as well by choosing a fixed precision and the total number of digits. Rest of the operations remain the same. We can read the result based on the chosen fixed precision (that determines where the decimal point goes).

vvg
  • 3,526
-2

If you haven't heard of the duodecimal system (or its variations) you might give it a look over. Some (obvious) examples which operate wrt the duodecimal system...

  • Standard timekeeping.
    • 60 s in a min.
    • 60 min in an h.
    • 24 h in a day.
  • The imperial system.
    • A thou = $\frac{1}{12000}$'.
    • An inch = $\frac{1}{12}$'.
    • A yard = $3$'.
    • etc.

1 of the reasons why the duodecimal system is desirable, & why people think that it simplifies hand calculations, has to do w/ $12$ having so many factors $\left(1\;2\;3\;4\;6\;12\right)$. It really shines wrt to division/ratios/proportions, e.g., for a carpenter to perform calculations based on the partitioning of a log into 3 equal pieces, he must consider their lengths to be...

  • $0.\overline{3}$ $\left[\mathrm{m}\right]$, if the log length was $1$ $\left[\mathrm{m}\right]$.
  • $4$ $\left[\mathrm{ft}\right]$, if the log length was $12$ $\left[\mathrm{ft}\right]$.
Landon
  • 698
  • The sexagesimal system is a pure monster. Performing additions requires to know by heart a table of $1800$ entries, not counting the necessity to create $60$ different digits. –  Apr 01 '19 at 21:46
  • @Yves Daoust lmao ya but if the table were stored in ram & referenced when performing arithmetic computations, do you think there would be any increase in speed like the OP is looking for? – Landon Apr 01 '19 at 21:58
  • 2
    people don't have RAM. –  Apr 02 '19 at 06:54
  • @YvesDaoust ik... I was talking wrt the computer aided case. I think that is what OP is more interested in. – Landon Apr 02 '19 at 21:31
  • Would the downvoter please leave some feedback? – Landon Apr 02 '19 at 21:35
  • 1
    Did you read the question ? " in such a way that both addition and multiplication can be done by hand" –  Apr 02 '19 at 21:56
  • @Yves Daoust ... mb, I reread the q (more thoroughly this time); I still think the a is relevant, given a couple small edits. – Landon Apr 02 '19 at 22:02
  • I didn't say the answer irrelevant. I was just commenting about base 60. –  Apr 02 '19 at 22:05
  • @YvesDaoust & I didn't say that you did, I was just announcing my intentions to edit (: – Landon Apr 02 '19 at 22:10