Genaille’s Rods

Converted to Mathematica 8, August 2011

Cite as: H. Thimbleby, “Genaille’s Rods,” Mathematica Journal, 3(2)60–62, 1993, http://library.wolfram.com/infocenter/Articles/3146

Harold Thimbleby

Stirling University, STIRLING, Scotland, FK9 4LA
Email: hwt@uk.ac.stirling.compsci
FAX: +44 786 64551

Abstract

Henri Genaille’s Rods are a nineteenth-century device for doing multiplication, similar to, but easier to use than the more familiar Napier’s Bones. Genaille’s Rods are visually attractive and can be used for educational purposes.

This article shows how Mathematica can be used to draw the tedious diagrams required, which can then be cut out with scissors and pasted to wooden rods to make an accurate replica set.

Introduction

Genaille’s Rods (Jones, 1964; Gardner, 1986) are a calculating device similar to Napier’s Bones (Napier, 1990), except that they are much easier to use, and better suited to educational use in helping understand the mechanics of multiplication. However, Genaille’s Rods are tedious to construct and difficult to make to look neat, so what more appropriate use of Mathematica, a product of the computerised 1980s, than to draw this easy-to-use calculating device invented in the 1890s? Mathematica’s drawings can be transferred to square section wooden rods to make a convenient multiplication device. This is a very attractive application of Mathematica because it is simple to program and results in a useful gadget, which, apart from its intrinsic interest, has the dubious advantages over Mathematica that it can be used away from your computer and floats in the bath.

Like Napier’s Bones (described by John Napier in 1617), Henri Genaille’s Rods assume an index rod that is used to provide the multiplier (chosen from 1 to 9) and several rods or bones of square cross-section.  The rods are shown together in the main picture (Figure 2); how to use the rods will be explained shortly. The index rod is shown to the left in the picture. The other rods have columns of numbers and triangles on each of their four faces, each face corresponding one digit for the multiplicand, which is shown at the top of the rod. Thus in the picture, we have shown one side of eleven rods, and we are effectively set up to multiply the number 0123456789 by any number 1 to 9, by reading across a row picked out by one of the digits from the index rod on the left. As each rod has four faces, which can be used for different digits, one does not need to have ten rods to be able to do products using all ten digits.

We’ll describe how to use Genaille’s Rods for multiplication after first explaining how to draw a complete table of the index rod and all rods 0 to 9.

How to draw Genaille’s Rods

We first write down some simple functions to help us draw the rods. Rect draws a rectangle; Tri draws a gray triangle, and Title makes the title for the top of a rod — it simply draws a rectangle and uses the standard function Text to put the title in the middle of the rectangle. For the calculations, we conveniently assume that the rods are 1 unit wide; they can be scaled to the best proportions, stretched horizontally or vertically using Mathematica’s user interface, when they are finally drawn.

Rect[{xmin_, ymin_}, {xmax_, ymax_}] :=
  Line[{{xmin, ymin}, {xmin, ymax}, 
        {xmax, ymax}, {xmax, ymin}, {xmin, ymin}}]
    	 
Tri[a_, b_, c_] := 
{ GrayLevel[0.2], Polygon[{a, b, c, a}], GrayLevel[0]}
 
Title[x_, lab_] :=
{ Rect[{x, 0}, {x+1, 1}], 
  Text[lab, {x+0.5, 0.5}]}

All the rods are divided by a vertical line. To be flexible, we define Ratio to be the proportion of the rod to the left of this line. The smaller Ratio, the narrower the triangles will be drawn.

Ratio = 0.6;

The definitions of IndexRod and Rod are merely a matter of working out what’s wanted, and using Table to construct the entries for all the cases. It is somewhat more convenient to draw the rods starting from the top and working downwards with increasing multipliers, and since we’re using a conventional coordinate system (with increasing y values going upwards) it is simplest to work out the coordinates and then make them negative; this also means that the titles on the rods can be positioned above the x axis without their size affecting any other coordinates.

The parameter of IndexRod (and the first parameter of Rod) fix the left position of the rod and are used so that the rods can be correctly spaced when they are drawn together.

IndexRod[x_] :=  
{ Title[x, "*"], 
  Table[
  { y = -h*(h-1)/2-h;
   	Rect[{x, y}, {x+1, y+h}],
   	Line[{{x+Ratio, y}, {x+Ratio, y+h}}],
   	Text[h, {x+Ratio/2, y+h/2}],
   	Table[Text[i, {x+(Ratio+1)/2, y+h-i-0.5}], 
   	      {i, 0, h-1}]},
  {h, 1, 9}]}

For each cell in a rod, Rod actually draws lots of triangles, as is clearer from Figure 1 (which is for multiplying by 9 using the rod for 4). The top triangle indicates an addition of 3 at its left apex, and its base is at 6; the fifth triangle with base 0 has apex to carry 4, and corresponds to the product 9×4+4, the +4 having being previously carried from some partial product to the right of this rod:

Trishade[s_, a_, b_, c_] := { GrayLevel[s], Polygon[{a, b, c, a}], GrayLevel[0]};

DemoRod[x_, n_, h_] := 
{ y = -h(h-1)/2-h;
Rect[{x, y}, {x+1, y+h}],
Line[{{x+Ratio,y}, {x+Ratio, y+h}}],
Table[{ Trishade[If[EvenQ[i], 0.3, 0.8], 
             {x, y+h-Floor[(i+n h)/10]-0.5}, 
             {x+Ratio, y+h-i-1}, 
             {x+Ratio, y+h-i}],
Line[{{x, y+h-Floor[(i+n h)/10]-0.5}, {x+Ratio, y+h-i-1}, {x+Ratio, y+h-i}, {x, y+h-Floor[(i+n h)/10]-0.5}}],
Text[If[Floor[(i+n h)/10] == i,StringJoin["carry ", ToString[i]], " "],{x-0.1, y+h-i-0.5}, {1, 0}],
Text[StringJoin[ToString[n h], "+", ToString[i], " = ", ToString[Mod[i+n h, 10]], ", carry ",ToString[Floor[(i+n h)/10]]],{x+1.1, y+h-i-0.5}, {-1, 0}], 
Text[Mod[i+n h, 10], {x+(Ratio+1)/2, y+h-i-0.5}]}, {i, 0, h-1}]};
  
Graphics[DemoRod[0, 4, 9],BaseStyle->{FontFamily->"Times"}]

Figure 1. Building up the triangles for 9x4 (using rod 4)

Though each triangle is drawn separately, all the triangles with the same apex merge together to make the appearance of a single triangle when drawn in the same shade of gray.

Rod[x_, n_] := 
{ Title[x, n], 
  Table[
  { y = -h(h-1)/2-h;
    Rect[{x, y}, {x+1, y+h}],
    Line[{{x+Ratio, y}, {x+Ratio, y+h}}],
    Table[
   	{ Tri[{x, y+h-Floor[(i+n h)/10]-0.5}, 
   	      {x+Ratio, y+h-i-1}, 
   	      {x+Ratio, y+h-i}],
   	  Text[Mod[i+n h, 10], 
   	       {x+(Ratio+1)/2, y+h-i-0.5}]},
   	{i, 0, h-1}]},
  {h, 1, 9}]}

It is clear from the definition of Rod how the triangles and numbers are generated: using Mod[10] for the number, and  Floor[10] for positioning the left apex of the triangles. Mod gets the units digit of a product, and Floor gets the tens digit (it rounds down: Floor[35/10] = 3).

To draw the index rod, followed by ten rods for the digits 0 through 9, the rods are positioned 0.2 units apart, and are assumed to be 1 unit wide (hence the 1.2(n+1) parameter of Rod). See Figure 2 for the result.

Graphics[{IndexRod[0], Table[Rod[1.2(n+1), n], {n,0,9}]},BaseStyle->{FontFamily->"Times"}]

Figure 2. Genaille’s Rods, index rod (on left) and rods 0 to 9

Worked example

If we consider multiplying 7×45, the method of using the rods will become clear. The rods are read right-to-left, along the appropriate row, in this case the seventh. The smaller picture (Figure 3) shows the relevant parts of the 4 and 5 rods, alongside the 7 row of the index rod. The rightmost digit of the product will be found starting with the topmost digit shown on the appropriate row: so the rightmost digit of the answer in this case will be 5. We follow the “funnel” of the triangle leftwards from there, which takes us to the 1 on the 4 rod, and we follow the funnel leftwards from that digit to 3 on the index rod. Thus the product we want is 315, though found in the reverse order.

NIndexRod[x_, h_] := 
{ Title[x, "*"], 
  y = -h-0.1;
Rect[{x, y}, {x+1, y+h}],
Line[{{x+Ratio,y}, {x+Ratio, y+h}}],
Text[h, {x+Ratio/2, y+h/2}],
 Table[Text[i, {x+(Ratio+1)/2, y+h-i-0.5}], {i,0,h-1}]};

NRod[x_, n_, h_] := 
{ Title[x, n], 
  y = -h-0.1;
 Rect[{x, y}, {x+1, y+h}],
 Line[{{x+Ratio,y}, {x+Ratio, y+h}}],
 Table[
 { Tri[{x, y+h-Floor[(i+n h)/10]-0.5}, 
       {x+Ratio, y+h-i-1}, 
       {x+Ratio, y+h-i}],
   Text[Mod[i+n h, 10], {x+(Ratio+1)/2, y+h-i-0.5}]},
 {i, 0, h-1}]};

Show[Graphics[
{NIndexRod[0, 7], NRod[1.1, 4, 7], NRod[2.2, 5, 7]}],BaseStyle->{FontFamily->"Times"}]

Figure 3. Index and two rods, for 7x45 = 315

The rods are constructed in a quite straight forward manner. The digits shown on a rod are the units digit of the product (as 7×5 = 35, the top digit of  row 7 of the 4 rod is the unit of 35, namely 5), and the triangle carries the tens digit, 3, to the next column. Thus the triangle goes down 3 rows on the next column, so automatically adding the carry into the product 7×4. This is easier to understand by noticing that the digits beneath the 5 are 6, 7, 8, 9 (corresponding to 35=7×5; 36=7×5+1; 37=7×5+2; 38=7×5+3; 39=7×5+4). If 4 or more is carried to this rod, the answer would have been 40 or 41. Thus the digits in the column continue 0, 1, and the triangles funnelling from them add one more to the rod to the left, corresponding to carrying 4 rather than the 3. The same pattern can be seen in all the other rods.

Conclusions

Rather than use triangles, Napier’s original bones simply gave the carry as a digit which then had to be added Ңy handӠto the numbers on the next rod. Genaille’s Rods do the carry addition automatically, even when it carries over several digits (as, for example, in 9×199), and hence is far more reliable (certainly on the assumption that you need rods to help you do sums in the first place!)

Although Mathematica can do any product that can be done with Genaille’s Rods simply by writing it down and pressing a button, and without any danger of running out of rods, one doesn’t learn very much about numbers by doing this! Genaille’s Rods, however, are a useful and very tangible educational device, so it’s especially pleasing that the modern calculating device can revitalise the inventions of previous centuries.

References

M. Gardner, Knotted Doughnuts and Other Mathematical Entertainments, pp85-93, W. H. Freeman and Co., New York, 1986.

B. R. Jones, Genaille’s Rods: An Ingenious Improvement on Napier’s, The Mathematical Gazette, volume 48, pp17-22, 1964.

J. Napier, Rabdology (Napier's Rabdology, translated by W. F. Richardson), Cambridge University Press, 1990.

Biography of author

Professor Harold Thimbleby is Professor of Information Technology at the University of Stirling. His main area of research is Human Computer Interaction, and he has used Mathematica for user interface simulation studies. He is married with four children.

List of accompanying material

One Macintosh disc, with Mathematica (1.2) Notebook.