Showing posts with label charles babbage. Show all posts
Showing posts with label charles babbage. Show all posts

Wednesday, July 1, 2015

You Know It When You Hear It

"Caw, Caw, Caw!"
"Shit." I rub my eyes and throw back the covers.

6:00 am. A Seattle Spring morning and the crows wake me up again. My partner, oblivious to the caw-cophony continues sleeping. The crows might even figure into a pleasant dream for him. Not for me. I get out of bed wondering how will I cope today in a world of noise?

What noise?


I'm talking about noise in the pejorative sense: unwanted, disruptive, ugly, loud for loud's sake, and sometimes against the law. Noise the spoiler of my concentration. Noise not produced by me. Noise that irritates.

Garret Keizer, in The Unwanted Sound of Everything We Want, captures the subjective nature of noise this way: "we know it when we hear it."

Crows are my unwanted noise. So are booming car stereos, deafening after-market mufflers, thumping bass through a floor, babbling televisions in airports, drumming of fingers, popping of gum, slamming of doors, and wind chimes. If none of those sounds annoy you, my earplugs are off to you.
I wrestle with my response to unwanted noise because noise precipitates awkward behavior. I'm worried about becoming a noise crank. Several years ago, I began to, at first serendipitously, and then more directed, read about noise. I found solace in the anecdotes of how historical personalities confronted unwanted noise.

Two Signposts


Street music rankled the English mathematician and "father of the computer" Charles Babbage (1797 - 1871). His 1864 autobiography Passages from the Life of a Philosopher contains a chapter, Street Nuisances, which lays out his contempt of street musicians, in particular Italian organ grinders. Babbage made his unwanted noise issue into one of class and education. Intellectual workers - like himself - were harassed by noise while those with "frivolous pursuits or with any other pursuits requiring but little attention from the reasoning or the reflective powers" welcomed noise.

Babbage lashed out at the noisemakers. He yelled at them, urged the police to pursue them, and prosecuted them in court. They returned the favor. Babbage wrote, "[T]he crowd of young children, urged on by their parents, and backed at a judicious distance by a set of vagabonds, forms quite a noisy mob, following me as I pass along, and shouting out rather uncomplimentary epithets. When I turn around and survey my illustrious tail, it stops; if I move toward it, it recedes; the elder branches are then quiet - sometimes they even retire, wishing perhaps to avoid my future recognition. The instance I turn, the shouting and the abuse are resumed, and the mob again follow at a respectful distance."

It is reported that on his deathbed, Babbage endured an organ grinder outside his window.
Babbage's life spanned the Georgian and Victorian periods in London, at the time one of the largest and noisiest cities in the world. It is true that London street musicians, typically immigrants, did play until you paid them to leave. Their noise disturbed Babbage, but was his method for dealing with it something I see myself adopting for my unwanted noises?

A half of century later in 1906 America, tug boat whistles on the Hudson River kept Julia Barnett Rice (1860 - 1929), a New York physician and philanthropist, awake at night. On any given night there could be a thousand or more whistles penetrating her Riverside Drive bedroom of Villa Julia. Sick of sleepless nights, Rice fought back. She took noise measurements, collected statements from people impacted, and waged a campaign for the suppression of unnecessary noise all the way to Washington D.C., and she won.

Rice's New York City took over the mantle of the largest and noisiest city in the world from Babbage's London. The whistles Rice silenced were from tugs carrying material and debris from the expanding city. Rice took a pro-business approach, knowing that much noise was unavoidable, but that excess noise could be framed as inefficient as well as "hurtful to humanity".

Beyond tugboat whistles, Rice shined a line on the issue of noise outside of hospitals and the general noise levels of the city. She educated by not just telling people about noise, but showing them. She recorded and played the noise back to audiences. A 1908 New York Times article, Canned Din by Phonograph, gives a taste of one of her 'concert events', a "record that will give outsiders some idea of New York's din furnished a duet between an elevated train at Fifty-ninth Street and Columbus Avenue and a flat-wheel surface car."

I calculate that Rice made a difference in dealing with her unwanted noise as well as benefiting society. Babbage comes off as cranky. A man targeted because of his response to noise. Is my response to noise more Rice or Babbage?


Chamber of Quiet



Crow 1: "Look who's here."
Crow 2: "The guy who flaps his arms at us."
Crow 1: "What's he doing now? What's he holding up?"
Crow 2: "I hear the sound of an eagle, or is it a falcon? But I don't see one."
Crow 1: "What a strange and noisy creature he is."
Crow 2: "Let's get his attention."
Together: "Caw, caw, caw!"

My partner watches and shakes his head. A bit of a Babbage moment except instead of organ grinders it’s crows. My attempt to scare the crows away with the "Crow Be Gone" soundtrack - a product reputed to repel crows by repeating the sounds of their predators - doesn't work. I put the soundtrack on my phone - portable crow-repellency I thought. I feel silly trying to scare crows away by making them think they are under attack, all because I feel under attack by the noise they make.

11:00 pm. Summer. The noise of a Saturday night party penetrates into our basement bedroom, which is half submerged underground, protected by thick walls and double-paned windows. It's usually relief from outside noise but not tonight.

I pass the time before sleep wondering what it would be like to create a quiet place to sleep without white noise generators or silicone earplugs. I could design my own anechoic ('echo-free') chamber, like the one at Orfield Labs in South Minneapolis. The 12 by 12 chamber is the quietest place on earth according to Guinness World Records. The chamber's walls sprout brown fiberglass wedges, which alternate horizontally and vertically in orientation. The floor is cable-mesh suspended over more of the same brown wedges. The fractal-like surfaces look nightmarish but provide ample surface area to absorb noise.

The chamber was built for product testing and registers negative decibels, -9.4 dBA. Zero decibels is the point at which you begin to hear. A quiet bedroom or library is about 30 decibels. At negative decibels your body becomes the sound.

The longest that anyone has remained in the chamber is reported to be 45 minutes. The challenge is one of orientation; we use sound to orient ourselves and that room robs soaks it all up.
An idea begins to take form in my mind: perhaps you can never escape noise.

Cranky Behavior


Noise impacts me beyond an occasional crow gathering or a joyrider with a new fat-boy muffler. When I plan a trip and look for hotel rooms, fear-of-noise is my travel agent. I construct mental blueprints of hotels, calculate distances to elevators, stairwells, and ice machines. Can I get a top floor so no one is above me? Good. Do TVs in adjacent rooms share a common wall with a bed? Bad. Do the pictures of the room look like they are insulating from sound? Good.

My partner puts up with my ruminations which turn to machinations once we arrive at a hotel and I get the true lay of the land. The diagram on the back of your hotel room door is there to help you find a fire exit. I study it for possible room swapping opportunities and get angry when it's a hand drawn approximation of the true layout. If you were staying in the hotel, you might hear me babbling as I wander the halls: "Room 204 must be a quiet room. Look at it, isolated at the end of the hallway. And, there's no room above it."

My in-laws are happy we come to visit. They said nothing when during our first visits I incapacitated their wind chimes with white tube socks. When visiting us, they accept my Napoleonic declarations: no door slamming or dryer usage after 10 pm.

At work, I sit cheek to jowl with my colleagues, and noises grate on my nerves. I can't be a noise tyrant as at home, so I escape. I book conference rooms for meetings with myself.

Record Breaking Noise


"Go Hawks!" A touchdown for the Seattle Seahawks.

We are at a Super Bowl 49 party, in a basement rec room. A big screen TV dominates one end of the room. Twenty-five friends gather to cheer on Seattle. The windows are steamed up. Seattle green and blue are everywhere: in clothes, face paint, wigs, pom-poms, party streamers and donuts. Some friends sit on a large couch sprawled in front of the TV, others are too nervous to sit. Three friends are in the "prayer corner" clutching each other.

I measure the noise in the room at an average of 100-110 decibels. My decibel meter offers that it's the same as listening to power tools. For the duration of the game, we are in a wood shop.

A prayer-corner friend controls the volume of the TV. She cranks it up when an important play is coming up or we need to focus or the prayers aren't working. We hit 125 decibels – jackhammer – we moved from wood shop to construction crew. The volume of the sound keeps everyone in a heightened sense. My ears ring for hours after the game has finished.

I imagine channeling Julia Barnet Rice and educating my friends (during a commercial break naturally). "Did you know that quite possibly some of the fine hairs of your inner ears - making hearing possible - have just died, never to grow back?" Or "Sounds above 85 decibels for extended periods of time can permanently damage your ears." But I don't and instead reach for a blue and green donut.

Noise Wake Up Call


7:00 am. Winter. The world is still asleep; I'm half asleep. I sit at my desk in socks, underwear, and an oversized sweatshirt staring at the gray outside. The radiator hisses and the house creaks as water flows through pipes. I imagine our house - with it creaks and groans - as a ship afloat on a sea of noise.

The sound of a distant plane edges into my consciousness for a few seconds and then fades. This morning, there are no crows. No fire engines or ambulances. No blaring stereos. No wind chimes. Just comforting sounds and the absence of unwanted sounds.

Yet, it's a temporary respite. The world will wake up and the sound level will increase. Sounds will become my unwanted noise. The best case scenario is that I won't notice it because I'll be busy and the total sound level will rise to drown out what bothers me. The worst case scenario is that I'll get irritated, then cope, and maybe even create my own noise.

I think of how Julia Barnett Rice and Charles Babbage responded to noise, proactively and reactively, respectively. I'm somewhere in the middle. My mind wanders to Seneca (c. 4 BC – AD 65), a Roman Stoic. He lived above a spa and describes the noises that irritated him in the essay On Noise including the hair-plucker's voice, "continually giving it vent and never holding his tongue except when he is plucking the armpits and making his victim yell instead." He gives this advice on dealing with noise: suck it up and calm the turmoil inside. I think of the Stoic's response to the old saw "shit happens," which is, "This shit is good for me." Maybe some noise is.

7:05 am. I yawn and stretch. Suddenly, "Varoom!" Out of nowhere a motorcycle roars up the street. It sets of a car alarm. My first test of the day.













































Sunday, March 2, 2014

The Babbage Difference Engine #2 – A Basic Explanation

Contents

Overview

On a recent visit to the Computer History Museum in Mountain View California, I was impressed with a live demonstration of the Difference Engine #2. But, I didn’t have a clue as to what the engine was actually doing and set about to find out. This post represents what I found. Disclaimer: I’m not claiming that this is 100% accurate, but it’s close. For an in depth study of the Babbage Difference Engine #2, see Babbage Difference Engine #2 - How to Initialize the Machine - Including Initial Values.

In a Nutshell

In a nutshell, the Difference Engine #2 solves a seventh order polynomial: $$ f(x)=a_7x^7 + a_6x^6 + ... + a_1x + a_0 $$ The operator configures the engine (with values related to the coefficients of the polynomial) and after a few moments of cranking, out comes \( f(x) \). How does a Victorian-era calculating machine composed of 8,000 levers and gears do this? And, more importantly, why was it designed to do this? What inspired Charles Babbage to design the engine? (When he wasn’t fighting irksome street performers.)

Quick History

Babbage designed Difference Engine #2 between 1847 and 1849, but never built it. The engine in the Computer History Museum is one of two built from Babbage’s original design; building from Babbage’s plans started in the early 1990s. For more information about why and how the engine was built, see the Computer History Museum’s description, A Modern Sequel. There is a brief overview of Babbage’s Difference Engine #2 given in IEEE Annals of the History of Computing (2005) in the article The Construction of Charles Babbage's Difference Engine No. 2 by Doron Swade.

Why a Polynomial?

Why solve a polynomial? Polynomials are interesting in their own right, but in this case the polynomial is used as an approximation for another function, like a logarithm. During Babbage’s lifetime, tables of logarithms were very important in scientific calculations, particularly in the burgeoning fields of astronomy and navigation. Here are a couple efforts involving the production of logarithm tables:

In the rest of this discussion, we’ll deal with the natural logarithm \( ln(x) \).

back to the top

Using a Polynomial to Approximate a Logarithm

A logarithm can be can be approximated by a Taylor series: $$ ln(x) = (x-1) - (1/2)(x-1)^2 + (1/3)(x-1)^3 - (1/4)(x-1)^4 + ... $$

We can plot values of the fourth order Taylor series (Figure 1) and see that it is really only good over a limited range, say between 0.5 and 1.5.

Figure 1: Plot for the Fourth Order Taylor Series with \( ln(x) \) 


How does this help for calculating the logarithm of large numbers? We can calculate the logarithm of a larger number by breaking it into the product of a mantissa and an exponent. For example, an arbitrary number can be written as \( ln(x) = ln(m) + p ln(2) \). So for 5,342:

$$x=5342=0.6521*2^{13}$$ $$ln⁡(5342)=ln⁡(0.6521)+13*ln⁡(2)$$

The mantissa (0.6521) is in the range that our Taylor series approximation is good (at least for this demonstration) and we would only have to perform a simple multiplication and addition to get the final value of the natural logarithm of 5,432. We would need the value of \(ln⁡(2)\) for the calculation. This is all described to point out that we could look at a small range of values of the approximating series to the logarithm and be sure we could calculate values outside the range.

Sticking with four terms in the Taylor series, we can perform the expansion of the terms, rearrange and end up with:

$$ln⁡(x)=-x^4/4+(4x^3)/3-3x^2+4x-25/12$$

(You can expand using Wolfram Alpha’s expand function: expand (x-1) - ((x-1)^2)/2 + ((x-1)^3)/3 - ((x-1)^4)/4.)

back to the top

Using the Method of Differences for Polynomials

One way to calculate and tabulate polynomials is using the method of differences, which has the advantage that you can use simple addition and subtraction in a tabular form to calculate arbitrary values of a given polynomial. This method was well known in Babbage’s lifetime and performed by humans to produce results that appeared in logarithm and other tables of the time. Charles Babbage designed the Difference Engines (#1 and #2) to do this automatically and remove human error.

Tabulating here means for a given values of \(x\), find corresponding values of \( f(x) \) (or here, \( ln(x) \) ). As you will see below, this literally means, as you probably guessed, creating a table of values.

In a previous post, Museum of Computer History, Mountain View California, we talked about how the difference engine uses the concept of method of differences to turn the problem of finding values of a polynomial into a problem of constructing simple tables based only on addition and subtraction. The method of differences works by taking the difference of values of polynomial (\(f(x)\)), and then taking the difference of the differences, and so on, until you reach a point where there are no more differences. In effect, you are taking the derivative of the polynomial until you reach a constant value.

back to the top

Method of Differences for a Second Order Polynomial

Let’s start simple with the following second-order polynomial:

$$f(x) = 2x^2 - 3x + 2$$

For a step size of \( \Delta x=0.1 \) and and the three starting values in red, we can (forward) compute the values in green, and then we can (reverse) compute the values in blue. So, from three starting values, we can  eventually find any value of \( f(x) \). It may not seem like a big “win” because we could just plug any value (e.g., 101.3) of x in the quadratic equation and be done with it, right? But, when calculators (or other easy way to calculate values) were not available, this way of calculating a values was important.

In Table 1, \(d(x)\) is the difference of values of the \(f(x)\) and \(d'(x)\) is the difference of the differences.

Table 1: Example of Finite Differences of Second Order Polynomial

In Table 2, we show the flow of the calculations as:
Calculation 1 = 1.72 – 2 = -0.28
Calculation 2 = 1.48 - 1.72 = -0.24
Calculation 3 = -0.24 – (-0.28) = 0.04
Calculation 4=> value – (-0.24) = 0.04 => value = -0.20
Calculation 5 => value – 1.48 = -0.20 => value = 1.28

Table 2: Table 1 Repeated with Series of Calculations

You would then keep calculating “blue” values by starting from the right most column and working your way left and down (on a diagonal) to produce a new value of \(f(x)\).

For this polynomial, it’s easy to calculate the exact formula for \(d(x)\) and \(d'(x)\):

$$d(x)=f(x+\Delta x)-f(x)=2{\Delta}x^2 + 4x{\Delta}x-3{\Delta}x$$ $$d'(x)=d(x+{\Delta}x)-d(x)= 4{\Delta}x^2$$

Note that \(d(x)/{\Delta}x\) is the approximation of the derivative. Although not the point of this exercise, it shows that the method of differences is closely related to derivatives.

Other points to note:

  • It only takes three values to start the tabulation process. In general, it will take one more than the highest power of the polynomial.
  • Values of \({\Delta}x\) can be big or small, but once you choose one, you must keep it the same for the rest of the tabulation calculations.
  • The last column of a table of method of differences (if you do it correctly) results in a constant value. Think of taking the derivative of a function until no more powers are left.

back to the top

Method of Differences for a Third Order Polynomial

Let’s now take a third-order polynomial.

$$ f(x) = x^3 - x^2 - x $$

And, let’s pick a \({\Delta}x=2\) value that “skips” over an area of the graph where the function dips and then rises again. You might think that we have to pick a \({\Delta}x\) small enough to capture all features of the polynomial. But, it doesn’t matter for method of differences.

Figure 2: Third Order Polynomial \(f(x) = x^3 - x^2 – x\)

Here’s the difference table for \({\Delta}x=2\), starting at \(x=0\).

Table 3: Finite Difference Example for the Third Order Polynomial \(f(x) = x^3 - x^2 – x\).

Another thing to think about is we don’t need to store all the red values and green values. After we calculate the “triangle” of green values, we only need the one red value and the green values on the diagonal. This is not so important here because we keep all the values in the table, for demonstration purposes. But for the difference engine, or if you are writing a computer program, you would only want to keep the minimum number of values (table cells) required to get your next value of \(f(x)\). The circles in the following diagram show the table cells required to calculate \(f(8)\). Every time, we use a value in a circle to calculate the value to the left, we can move the circle down to the same table cell in the next row.

Table 4: Table 3 with Value Highlighted for Calculation of \( f(8) \).

back to the top

Method of Differences for a Fourth Order Polynomial

Let’s now go back to the fourth order Taylor series approximation for \(ln⁡(x)\):

$$ln⁡(x)=-(x^4)/4+(4x^3)/3-3x^2+4x -25/12$$

Here’s the difference table with \({\Delta}x=0.05\), starting at \(x=0\). Note that right most column is (as expected) constant but it takes four difference operations to get there. Also note that \(ln(0)\) is calculated correctly, but the \(ln(1.5) = 0.401042\) and the true value is \(0.405465\), showing rounding errors are starting to play a role. We won’t talk about rounding errors or precision much here, but it is a serious concern.

Table 5: Fourth Order Taylor Series, Finite Differences

back to the top

Scaling the Method of Differences

Up to this point we’ve considered simple polynomials with relatively simple coefficients. The difference engine solves polynomials with integer coefficients, therefore, to truly deal with real value (like decimals) some kind of scaling will be necessary. The difference engine can be programmed with integer coefficients represented with up to 31 digits.

Let’s say we multiply each coefficient of the fourth order Taylor series for ln(x) by 100,000 so we are dealing with this polynomial:

$$ln⁡(x)=-25000x^4+133333x^3-300000x^2+400000x -208333$$

Calculating the first few entries of the method of differences table, we see that all values in a row compare to Table 5 are just multiplied by 100000. So, we can see that we can use scaling to deal with decimal values.

Table 6: Scaling the Coefficients in the Method of Differences

back to the top

Mapping the Method of Differences to the Difference Engine #2

Let’s now move on to a seventh order polynomial:

$$ f(x)=a_7x^7 + a_6x^6 + a_5x^5 + a_4x^4 + a_3x^3 + a_2x^2 + a_1x + a_0 $$

From what we’ve seen above for the second, third, and fourth order polynomial examples, if we were to create a method of differences table, we would have a table of 8 columns. One column (col 8) would be the result value. If we keep the order of the columns as we did above and add labels to each column (e.g., “col 1”) we have something like what is shown in Table 7.

Table 7: Seventh Order Polynomial – Method of Differences Table with
Calculation Sequence and Mapping to Difference Engine

Following what we did above for the simpler polynomials, once we have the values for the red cells, we can use addition and subtraction to populate the green cells. Once we have the green cells, we would put the values in the cells marked as X1X7 as the configuration values in the difference engine.

Where do you put the values X1X7? You put them in the seven columns of the engine as shown in Image 1. Column 8 is the result column. Note that the values of X1X7 are based on the original coefficients but they are not equal to the coefficients.

Image 1: Gigapixel Image of the Babbage Difference Engine #2,
Annotated with Column Numbers for Method of Differences

back to the top

The Engine in Action: Information from a Recent Visit

With every calculation cycle (a certain number of turns on the crank on the right of Figure 3), col 8 gets a new value. This is the result.  While I didn’t confirm it directly, Col 1 stays the same (because it’s a constant), and col 2 through col 7 change to new values for the next calculation cycle.

On the day in January I visited the difference engine for a second time, I was able to get a little more information about how it works and that is captured in Images 2, 3, 4, and 5. 

Image 2 shows the polynomial used at the time to calculate the logarithm base 10 (not a natural log as above). The polynomial is not a Taylor series as we used above; it’s an interpolating polynomial that better fits the logarithm. For example, Image 3 shows an example calculation log10(1.3960) = 0.144885. If you enter the value of x = 1.3960 in the polynomial in Image 2, the result is 0.144885.

Image 4 and 5 show a curious thing that I was not expecting. It shows that the the result column (col 8) shows both the calculation and the value of x that was being calculated. Doing so helps the operators keep track of where they are, among other benefits. Note that only the fractional part of the x (the part to the right of the decimal point) is shown. The “1” in 1.3960 is left off.

Image 3 and 5 show col 8 and show the value of x (yellow) and the result (red). You read the results column from top to bottom. In the next section, we’ll go back to a simpler example to understand how the method of differences could be set up to keep track of x as well.

Left: Image 2 -The Interpolating Polynomial to Calculate the Logarithm; Right: Image 3 – Results Sheet

Left: Image 4 – The Current Value of X (Input into the Polynomial); Right: Image 5 – The Value of x and the Result in Column 8

Setting up a Counter in the Method of Differences Results Column

Let’s take \(f_1(x) = x\) and \( f_2(x) = (2*x^2 - 3x + 2)/1000\). \(f_1(x)\) is our "counter". \(f_2(x)\) is the same function we worked with above divided by 1,000 to scale it so that it returns values in a different range than \(f_1(x)\). Finally, let \( f_3(x) = f_1(x) + f_2(x)\). Table 8 shows the method of differences tables for each of these functions. It shows that the results column is essentially additive and the trick of scaling.

Table 8: Method of Differences Example Demonstrating
How to Add a Counter in the Results Column

Dealing with Negative Numbers

In all the example up to this point, we have used positive and negative numbers in the method of difference tables. However, the difference engine can only deal with positive integer values (of up to 31 digits). Seems like a limitation, but we can use the Method of complements to represent negative integers as positive ones in calculations. Specifically, we’ll use the method of complements with a radix of 10, which is called 10’s complement.

10’s complement can be explained as follows. Pick a power of ten (10, 100, 1000, etc.) that covers the range of positive and negative integers you want to work with and then use half of the range to represent positive integers and half to represent negative integers. For example, let’s say we have a math problem where we want to work with integers from -5,000 to 5,000. In this case, pick 10,000 and let 1 to 4,999 be represented by 1 to 4,999 and -4,999 to -1 be represented by 5,001 to 9,999. In effect, we are assigning half our range of positive integers to represent positive integers and half to represent negative integers. Continuing with this example, if you wanted to subtract 1,213 from 3,000 (or you could say add negative 1,213 to positive 3,000), you first find the 10’s complement of 1,213 which is 8,787 and then add (instead of subtract) 8,787 to 3,000 to get 11,787. By convention, you throw away the leading 1 to end up with 1,787. The method of complements is just a way to use addition to perform subtraction.

Okay, now let’s look at the following second order polynomial to show how to use 10’s complement in the method of differences:

$$f(x) = 100x^2 - 600x + 200$$

Let’s use a step size of \({\Delta}x=0.5\), and the same color scheme as above (red are initial values we provide and green are calculated values), so that the method of differences table looks like this.

Table 9: Method of Differences for \(f(x) = 100x^2 - 600x + 200\)

Consistent with our column numbering from above, let’s name the columns from right to left and pretend we are dealing with just a three column difference engine (i.e., a difference engine that could only calculate up to second order polynomials). For a second order polynomial, we know that we need to start the engine off with three numbers, in this case {-400, -225, 50} from columns 3 to 1. The value in col 1 will never change, it’s the constant. But the values in col 2 and col 3 will change. If we label c1 to c4 as the calculations to be performed (in that order) we can start calculating as follows:

c1 = 50 + (-225) = - 175
c2 = c1 + (-400) = - 575
c3 = 50 + c1 = - 125
c4 = c3 + c2 = - 700

So far, we’ve only repeated what we already know about the method of differences, and we are still using negative numbers. But, and here’s the trick, if we use the 10’s complement on our starting three numbers (assuming 10,000 as our total range of numbers), they three numbers can be represented as {9600, 9775, 50} – all positive. Now, we can run through the calculations for c1 to c4 again using these 10’s complement numbers and the rules for 10’s complement addition:

c1 = 50 + 9775 = 9825 (which is really -175)
c2 = c1 + 9600 = 19425 -> throw away leading 1 to get 9425 (which is really -575)
c3 = 50 + c1 = 9875 (which is really -125)
c4 = c3 + c2 = 9875 + 9425 = 19300 -> throw away leading 1 to get 9300 (which is -700)

So we can work with positive integers and only perform additions as we can continue calculating rows in the method of differences table. In this example, we would quickly realize that 10,000 as our range would not be enough to cover the integers we want to work with.

Tuesday, January 28, 2014

Noise and Nuisance; Bronzino to Babbage

Left to Right: Arthur Schopenhauer, Charles Babbage, Luca Martini
Arthur Schopenhauer Charles Babbage Luca Martini

Recently, I've been thinking a lot about Charles Babbage. First, in the context of reading the book The Philosophical Breakfast Club: Four Remarkable Friends Who Transformed Science and Changed the World by Laura J. Synder. The four men are Charles Babbage, John Herschel, William Whewell, and Richard Jones. Synder discusses their lives and contributions during the time when science changed from hobby to profession. I encountered Babbage again at the Computer History Museum where I saw the Babbage Difference Engine #2 in action. What kind of person conceived this big mechanical calculator?

Obviously, Babbage was a visionary genus who was able to see the need for automated calculations and designed machines that could do them. Among other qualities often used describe Babbage are irascible, cranky, prone to bitterness (mostly later in his life), and apt to not forgive or forget perceived insults. It is this darker side that caught my attention in the last chapter of Synder’s book. In particular, Synder mentions a chapter from Babbage's Passages from the Life of a Philosopher [1864], which was based on a pamphlet he published called Street Nuisances. As Synder describes it:

Babbage’s difficulties in concentrating led him to believe that his work was being sabotaged by street musicians, especially “organ grinders,” men who went from house to house making music and hoping for some coins in return. These men— many of them immigrants from Italy— would travel through neighborhoods holding large barrel organs.

Babbage lashed out, yelling at the offenders from his window, prosecuting the organ grinders in the courts, and finally publishing a pamphlet on “Street Nuisances,” which he reprinted in his Passages from the Life of a Philosopher. Retaliatory mobs began to follow him about, sometimes one hundred people at a time, shouting and banging on tin drums and blowing horns; dead cats were left on his doorstep, windows were broken, threats on his life were made. 82 Children from the local schools would shout out his name “coupled with offensive adjuncts” whenever they passed the windows of his house.

[Snyder, Laura J. (2011-02-22). The Philosophical Breakfast Club: Four Remarkable Friends Who Transformed Science and Changed the World (pp. 356-357). Crown Publishing Group. Kindle Edition.]

Ironically, organ grinders turn a crank to produce a result (noise for Babbage) and the difference engine works by turning a crank to produce a result (a calculation, music to Babbage’s ears likely).

Left to Right: Babbage Difference Engine #2, Organ Grinder, Babbage’s List of Street Nuisances
Babbage Difference Engine #2 Organ Grinder Babbage’s List of Street Nuisances

In the chapter Street Nuisances, in Passages, Babbage comes across as inflexible and crotchety, filled with rancor. His solution to only use public roads for traveling and not for business or amusement doesn’t seem practical even if it might reduce his dreaded street nuisances. And, his disdain for anybody who enjoys music is a perhaps a bit too general: “Those whose thoughts are chiefly occupied with frivolous pursuits or with any other pursuits requiring but little attention from the reasoning or the reflective powers, readily attend to occasional street music.”

These nits aside, I could not help but feel empathy for Babbage and his war against street nuisances. You can sense the frustration and anger in his tone when he writes about noise. He calls the chapter Street Nuisances, but, he could just as well have called it On Noise; he probably would not have included a chapter about street pantomimes.

Cue Schopenhauer

The Babbage chapter reminds me of the essay from Arthur Schopenhauer, On noise, discussed in a previous post, Schopenhauer, On Noise. At the time we wrote that entry, we were living in Florence, and a certain lady and her brood slammed a certain green door with seemingly gleeful abandon that drove me crazy. (We lived above the door. Couldn’t they just quietly close it?) Schopenhauer said in the essay:

There are people, it is true—nay, a great many people—who smile at such things, because they are not sensitive to noise; but they are just the very people who are also not sensitive to argument, or thought, or poetry, or art, in a word, to any kind of intellectual influence. The reason of it is that the tissue of their brains is of a very rough and coarse quality. On the other hand, noise is a torture to intellectual people.

Why are some people more sensitive to noise and others not? I'm writing this as I sit in an apartment (a rented room on a business trip) where the noise from the floor above is merciless. Does anybody else hear it? Am I going crazy?

 

L’angolo italiano

Babbage singles out Italian organ grinders in Street Nuisances. They are the start of a list of musical performers he finds annoying. Schopenhauer mentions a poem by the Italian painter and poet Bronzino (see child sprezzatura) which describes how noisy a small Italian town can be. The poem Schopenhauer refers to is: Il terzo libro delle opere burlesche aggiunto a quelle di m.Francesco Berni, page 288. The title is De’ Romori, A Messer Luca Martini and it starts:

Poichè, l’infermità vostra, e la mia
   N’impedisce il vederli, e’l ragionare,
   La penna invece d’occhi, e lingua sia
Ogni mattina il nostro singulare
   Maestro mi dà nuove, o Luca mio,
   Come la fate, e la siete per fare.

Luca Martini was a Renaissance engineer and friend of Bronzino. My Renaissance Italian translation capabilities are a bit rusty, but the verse doesn’t seem to have quite the same anger that Schopenhauer or Babbage project, but noise or “romor/romori” (in modern Italian it’s rumore) is mentioned many times. The noise of children (romor de’ fanciulli), bells (de le campane, e da i romor discosto), pots and pans that wreck the sleep (sento di piatti, tegami, e scodelle che m'ha per tutta notte il sonno gausto) and even normally “graceful” cats making noise at night (Anche le gatte o che leggiadra usanza trovò natura, arrabbiando la notte, Fanno tanto rumori). What’s not clear is whether the noises bothered Bronzino, Martini, both, or neither and if this was just a mediation on a noisy town. And, Bronzino didn’t mention the green door (la porta verde). Now that would have been cool (fantastico)!


Addendum 2025

A reader asked a question that prompted some further research, from which we learned:

  • It's likely that Schopenhauer incorrectly attributed the De' Romori: a Messer Luca Martini chapter to Bronzino whereas it was written by Francesco Berni (1497/98 - 1535).
  • De' Romori appears in a larger work of opera burlesche by Berni. It seems that work was reprinted and added to in subsequent years so that it's confusing to tell what you are looking at at times.
  • We can say the De' Romori chapter is addressed to Luca Martini and chronicles the noise of the city. What we don't know is if Berni was serious or satirical; likely the latter. And, why would he write to Martini other than they were friends? 
  • The De' Romori chapter is only a few pages long and is written in an Italian that I have a hard time translating given my so-so Italian skills. 
  • The chapter talks about the various sources of noise and disturbances around the speaker's living quarters, including a kitchen, a shop, and other activities that cause noise. It paints a vivid picture of the cacophony of daily life.
  • The introductory piece above doesn't really have an noise related bits; you have to get into the chapter a little ways. 



Saturday, October 12, 2013

Museum of Computer History, Mountain View California


Left: Floor Plan of the Computer History Museum; Right: Difference Engine #2
Floor Plan of the Computer History MuseumDifference Engine #2
The Computer History Museum started life in 1979 as the Digital Computer Museum inside of Digital Equipment Corporation’s office in Massachusetts. Today, it is an independent non-profit, located in Mountain View, California. The museum has a large and interesting collection worthy of a few hours of time if you are in the area and you are even mildly interested in computers. Compared to the nearby Intel Museum, I would recommend the Computer History Museum as your first stop, if not only to see the fascinating Babbage Difference Engine #2 in action. Call or write to ask when live demonstrations of the Different Engine #2 occur.

Left: Napier’s Bones, England, ca. 1700; Right: Hollerith Tabulating Machine
Napier’s Bones, England, ca. 1700Hollerith Tabulating Machine

Some characters that caught my attention as I made my way through the main exhibition Revolution: The First 2000 Years of Computing.

  • John Napier (1550 – 1617) invented (along with Henry Briggs) of logarithms. He also invented Napier’s Bones, rods for calculating products and quotients of numbers. The rods or “bones” are based on the concept of lattice multiplication, a way to break down multiplication into smaller steps. I can imagine nerds and geeks of the time having Napier’s Bones in their metaphorical shirt pockets…I would.
  • Herman Hollerith (1860 – 1929) invented the Hollerith tabulating machine, first used in the 1890 U.S. census. His tabulator, based on punched cards, produced results twice as fast as other methods used in that census. The holes in a punch card encoded information about one person. Each card was fed into a tabulator that advanced clock-like dials based on where the holes were on the card. Hollerith’s company Tabulating Machine Company, merged with four other companies in 1911 to become one company that eventually was named International Business Machine Corporation (IBM) in 1924. Here is the museum’s description of the census effort: Making Sense of the Census: Hollerith’s Punched Card Solution.
  • Seymour Cray (1925 – 1996), the “father of supercomputing” is featured prominently in the exhibition. Yes, the Cray-1 the museum has on display and the other one you can touch and walk into are really cool. (The Cray-1 was referred to some as the “world’s most expensive loveseat” due to its innovative design. The loveseat hid the power supply.) However, it was the video of Cray’s life and the detail about his “supposed” favorite pastime, digging tunnels under his house that really caught my attention. The video uses images from a 1932 Modern Mechanix and Inventions magazine article titled Tunnel Digging as a Hobby which was about one Dr. H. G. Dyar referred to as “the mole man of Washington” in a Washington Post article. I’m not sure how tunnels and computer history are related, but it stuck out in my mind. Here’s the video. The tunnel part is at 2:58.
  • Charles Babbage (1791 – 1871), the inventor of the incredible Difference Engine #2, a Victorian-era, hand-cranked, computing machine. All 8,000 parts of the engine work together to calculate values of a 7th order polynomial. Here’s a video on the museum’s site that shows the engine in action.

    Babbage designed the machine in the late 1840s, but never built it. The fully functioning machine in the Computer History Museum is the second of two built based on Babbage’s original plans. The first was completed in 1991 and the second in 2008.

    By all accounts (e.g., see The Philosophical Breakfast Club: Four Remarkable Friends Who Transformed Science and Changed the World by Laura J. Synder), Babbage was an prickly genius. He spanned the transformation of science (in the 19th century) when it moved from the hands of the gentlemen scientist / natural philosopher to the professional scientist we know it today.

I’ll mention two themes that recently I’ve been thinking and reading about in the history of computing. The first theme is the idea of simplifying a problem to a form that can be more easily solved. The second theme is how the role of humans has changed in time in the history of computing.

Napier’s Bones exhibit the simplification theme in that they reduce complex multiplication to simpler steps that can be easily understood. The Difference Engine #2 demonstrates the simplification theme a little more abstractly. The engine uses the concept of finite differences to turn the problem of finding values of a polynomial into a one of constructing simple tables based only on addition and subtraction. The prosthaphaeresis algorithm is another, classic example of simplification where multiplication and division are approximated using formulas from trigonometry and look-up tables.

Left: The Philosophical Breakfast Club. Cover shows portraits of Charles Babbage, John Herschel, William Whewell, and Richard Jones.
Right: When Computers Were Human. Cover shows an operator of a Pantograph Card Punch for creating cards that could be read in the Hollerith Tabulating Machine
The Philosophical Breakfast Club. Cover shows portraits of Charles Babbage, John Herschel, William Whewell, and Richard Jones.When Computers Were Human. Cover shows an operator of a Pantograph Card Punch for creating cards that could be read in the Hollerith Tabulating Machine

The second theme of the changing role of humans in the history of computing is covered in the interesting book When Computers Were Human by David Alan Grier. The book “attempts to invert the history of scientific computing by narrating the stories of those who actually did the calculations.” True to the title, many of the stories are of people who were really “human computers”. For example, in the case of the Hollerith tabulating machine, humans collected the information, punched the cards, and then fed the cards to the tabulator. Humans were an integral if not manual part of the computing process.

For the Difference Engine #2, Babbage was inspired to “calculate with steam” as a way to reduce the number of errors in the mathematical tables so critically used in different fields of science. In Babbage’s time, those tables were constructed by “human computers”. The humans crunch numbers that were collected and rolled up into what might be a table of logarithms.

A humorous example of human computers, mentioned in When Computers Were Human and also detailed in the article "Work for the Hairdressers: The Production of de Prony's Logarithmic and Trigonometric Tables" by I. Grattan-Guiness, is how a large set of logarithmic and trigonometric tables were produced at the end of the 18th century under the direction of the French mathematician and engineer, Gaspard Riche de Prony (1755 – 1839). The production of the tables was based on three groups or sections working together. The first group chose the mathematical formulas. The second group set up the calculations based on the formulas and sent them to the third group which performed the bulk of the calculations (simple addition and subtraction):

These calculations were done by the third section [group], a large team of between 60 and 80 assistants. Many of these workers were unemployed hairdressers: one of the most hated symbols of the ancien regime was the hairstyles of the aristocracy, and the obligatory reduction of coiffure “as the geometers say, to its most simplest expression” left the hairdressing trade in a severe state of recession. Thus these artists were converted into elementary arithmeticians, executing only additions and subtractions.”

Another example of human computers that caught my attention is described by Grier in Chapter Two, The Children of Adam Smith. In 1765, the Royal Astronomer Nevil Maskelyne (1732 – 1811) was tasked with producing an almanac. The striking fact about the undertaking (at least to me) is that Maskelyne organized a cottage industry of human computers that received and sent their work through the mail. Grier describes it as follows:

For the Nautical Almanac computers, Maskelyne provided paper, ink, and instructions that were called “computing plans.” Maskelyne wrote these plans on one side of a heavy sheet of folded stationery. The instructions, scrawled in a slightly disheveled hand, summarized each step of the calculation. Occasionally, he would illustrate the computations with a hasty sketch of an astronomical triangle. On the other side of the paper he drew a blank table, ready for the computer to complete. [Grier, David Alan (2013-11-01). When Computers Were Human (p. 30). Princeton University Press. Kindle Edition.]

Maybe all this is a bit of nostalgia on my part. Today’s computing scene is too complex to grasp – at least at time – and it’s easier to take comfort in the past. Maybe I could be one of those human computers working on a logarithm table? Accordingly, it didn’t escape my notice that the bulk of my time at the Computer History Museum was spent with the pre-19th century devices.

Left: Images of a small portion of Difference Image #1 from Passages from the Life of a Philosopher (1864) by Charles Babbage.
Right: Difference Engine #2 in the Computer History Museum, Mountain View, California
Images of a small portion of Difference Image #1 from Passages from the Life of a Philosopher (1864) by Charles Babbage.Difference Engine #2 in the Computer History Museum, Mountain View, California

Left: IBM Watson versus Travelmarx (losing) on a Jeopardy! Stage Set at the Computer History Museum, Mountain View, California.
Right: EAI 580 Patch Panel - Electronic Associates, Inc. US, ca. 1968.
IBM Watson versus Travelmarx (losing) on a Jeopardy! Stage Set at the Computer History Museum, Mountain View, California.EAI 580 Patch Panel - Electronic Associates, Inc. US, ca. 1968.