Calculus and a Calculator

Earlier this year, [Dan Maloney] went inside mechanical calculators. Being the practical sort, [Dan] jumped right into the Pascaline invented by Blaise Pascal. It couldn’t multiply or divide. He then went into the arithmometer, which is arguably the first commercially successful mechanical calculator with four functions. That was around 1821 or so. But [Dan] mentions it used a Leibniz wheel. I thought, “Leibniz? He’s the calculus guy, right? He died in 1716.” So I knew there had to be at least a century of backstory to get to the arithmometer. Having a rainy day ahead, I decided to find out exactly where the Leibniz wheel came from and what it was doing for 100 years prior to 1821.

If you’ve taken calculus you’ve probably heard of Gottfried Wilhelm Leibniz (who would have been 372 years old on July 1st, by the way). He’s the guy that gave us the notation we use in modern calculus and oddly was one of two people who apparently figured out calculus, the other being Issac Newton. Both men, by the way, accused each other of stealing, although it is more likely they both built on the same prior work. When you are struggling to learn calculus, it is sometimes amazing that not only did someone think it up, but two people thought it up at one time. However, Leibniz also built what might be the first four function calculator in 1694. His “stepped reckoner” used a drum and some cranks and the underlying mechanism found inside of it lived on until the 1970s in other mechanical calculating devices. Oddly, Leibniz didn’t use the term stepped reckoner but called the machine Instrumentum Arithmeticum.

Many of us remember when a four function electronic calculator was a marvel and not even very inexpensive. Nowadays, you’d have to look hard to find one that only had four functions and simple calculators are cheap enough to give away like ink pens. But in 1694, you didn’t have electronics and integrated circuits necessary to pull that off.

Practical Problems

There were two problems with the stepped reckoner. There was a design flaw with the carry mechanism that caused problems. In particular, a digit going from 9 to 0 would advance the next wheel by one step, which is good. But if that next wheel was already at the 9 position, it would not propagate the carry further. However, a disk at the edge of the machine would poke up, indicating the operator had to manually rotate that shaft to produce the propagated carry. Clearly a feature, and not a bug!

In addition, the crude fabrication methods available didn’t lend themselves to the precision gearwork necessary, so the machine was not very practical. It’s only known for sure that two prototypes were ever made. There is some evidence that more — perhaps  up to 10 — of these were made around that same time, but we don’t know if any of the machines that didn’t survive had better designs. They were all hand-made, after all, and we may only have earlier prototypes that didn’t get much use. Of the two prototypes that were certainly made, only one still remains — and the exemplar in Hanover, Germany has 16 digits.

The face of the instrument has eight dials you can set from zero to nine which serves as the input. There is a sixteen-digit accumulator you can read through windows to the rear. A crank in the front lets you provide power, and the input dials can slide on rails or a lead screw so they can line up with different parts of the accumulator by using a different crank, on the left.

Leibniz Wheel

At the heart of each digit is a Leibniz wheel. The wheel, which is really a drum, has nine teeth on it. The tooth representing 1 is very long. The tooth representing 9 is the shortest. The other teeth length are proportional to their value. Next to the drum is a gear that can slide and will mesh with some of the teeth. Since 9 is the shortest tooth, if you line the gear up with that tooth, it will advance for every tooth on the drum, so one rotation of the drum will cause the gear to move 9 positions If you line up the gear with the first tooth, then one drum rotation will only move the gear 1 position. The other teeth will “miss” the gear.

This video is a simulation, but should make the preceding clearer:

Obviously, turning the main crank one way will cause the gears to move in one direction for adding, and turning the other way will do subtraction. What about multiplication and division? That’s why the input section can slide along the accumulator.

Higher Math

Just like you do multiplication and division by hand, you had to move the input part along the accumulator adding and subtracting a different digit each time. There is a multiply counter that controls how many times you turn the crank before a stop so you don’t have to count turns by hand

So, to multiply a number by 52, you’d set the first number into the input section and set the multiplier wheel to 2. Then you’d turn the crank until it stopped which essentially multiples the number by 2. Then you move the input section to the left and set it to 5. Since you moved to the left, that’s 5 x 10 or 50. You turn the crank to get to the stop again. Remember, the cranking is adding and the first number doesn’t change (the accumulator does). If the original number is N then you are calculating 2 x N + 50 x N which is 52 x N. This is exactly how you do multiplication on paper — or at least the way most of us learned it in school.

Obviously, you could chain calculations if you manually moved answers from the output window to the dials, for example. If you did the right sequence you could even compute roots.

Legacy

Leibniz had been inspired by the Pascaline and, in turn, he inspired future machines for several centuries. In his notes, he not only identified the wheel, but also a pin-wheel mechanism that was not built, but ended up being reinvented by Giovanni Poleni in 1709. Once manufacturing caught up, it would largely replace the Leibniz wheel in mechanical devices. The pin-wheel is more or less the same as a wheel, but instead of being round, the wheel makes a spiral shape where 9 is further from the center and 1 is closest.

He also described a binary calculator using marbles. From De progressione Dyadica:

This [binary] calculus could be implemented by a machine (without wheels)… provided with holes in such a way that they can be opened and closed. They are to be open at those places that correspond to a 1 and remain closed at those that correspond to a 0. Through the opened gates small cubes or marbles are to fall into tracks, through the others nothing.

It doesn’t appear Leibniz built the machine, but working versions have been made in modern times, although it required filling in a few blanks.

As [Dan] mentioned earlier, in 1820, Thomas de Colmar produced the Arithomometer, the first mass-produced — well, starting in 1851, anyway — calculating machine using the same basic mechanism. It took a few years to work out some details that caused unreliability, but by 1865, the machines worked quite well and inspired copycats.

Mechanical calculators got even better and eventually moved to the use of the pinwheel which is very similar but a bit more compact and easier to construct. However, the Curta Calculator  used a modified Leibniz wheel design from the 1930s into the 1970s and were considered by many to be the best available mechanical calculators of their time.

You can see the real deal to the left. If you don’t have the \$1,200 to \$2,000 dollars these go for, you can always 3D print one. If you aren’t even that motivated, you can always try a simulation in your browser. Of, if you want some choices, there’s actually a few simulators for you to try out.