by svat · 4y ago · 0 comments
• Babbage's first insight was that many books of tables (log tables, sine tables, actuarial tables) could be generated mechanically, using finite differences: basically, any "nice" function can be well-approximated by (say) a sixth-degree polynomial, and that was the basis of his Difference Engine. He did understand this; see the paragraph just before his frequently quoted one:
> One gentleman addressed me thus: “Pray, Mr. Babbage, can you explain to me in two words what is the principle of this machine?” Had the querist possessed a moderate acquaintance with mathematics I might in four words have conveyed to him the required information by answering, “The method of differences.” The question might indeed have been answered with six characters thus—
Δ⁷uₓ = 0
but such information would have been unintelligible to such inquirers.(This paragraph is followed by the famous:
> On two occasions I have been asked,—“Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?” In one case a member of the Upper, and in the other a member of the Lower, House put this question. I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
— but he does attempt to briefly answer how error-correction could be built into the machine.)
• In short, as he explains, his Difference Engine can be seen as a glorified version of a simple machine that turns a triple of integers (x, y, z) into the triple (x + y, y + z, z). If you start this machine with the triple (0, 1, 2), then it successively turns it into (1, 3, 2), then (4, 5, 2), then (9, 7, 2), then (16, 9, 2), etc — so in n steps you get n^2 as the first number. (In general, starting with (a, b, c) gives the quadratic function a + nb + (n(n-1)/2)c after n steps.) Do this to six places and many digits of precision and you have the Difference Engine, which could compute arbitrary sixth-degree polynomials and could indeed automate a lot of the tables that were being built by hand.
• As Tom Forsyth points out in the replies on the Twitter thread (https://twitter.com/tom_forsyth/status/1359572977377890304), for this purpose, he really needed all those digits of precision. (BTW his blog post "Babbage was a true genius" looks great: http://tomforsyth1000.github.io/blog.wiki.html#%5B%5BBabbage... )
> What the Difference Engine did was polynomials by forward differencing, which is just a bunch of adds. You actually do need massive precision there, and/or the numbers have a high dynamic range. So until floating-point, yeah you need a lot of digits.
• The big mistake Babbage seems to have done (IMO), after coming up with this idea for the Difference Engine, is to have grand visions of it (it can do all the tables!), think it will be super useful, and present it to the government. Instead of taking private funding, he thought his great invention should be the property of the country and partly funded by government. Of course, like any engineer, he underestimated how long it would take, and meanwhile, while the government entanglement led to it being dragged on for twenty years at various points deciding whether to pour more money in, he came up with loops and branches and arbitrary computation—the Analytical Engine—asked them "hey I have something better than the project you've been funding, what do you think?", and put them in an impossible spot, and was too socially naive to realize that he had become non grata.
• John Nagle (Animats) has commented a few times about how, contrary to the "high culture" story of the evolution of computers (Turing, von Neumann etc), the gradual evolution of "calculators" was itself leading up to computers (e.g. https://news.ycombinator.com/item?id=10636154). Something similar appears to have happened with Babbage, where he started with a simple calculating device and, thinking about it more deeply, single-handedly came up with a Turing-complete design and was writing programs for it.
• I started reading Babbage's memoirs "Passages From the Life of a Philosopher" (http://onlinebooks.library.upenn.edu/webbin/book/lookupid?ke...) after seeing an intriguing Knuth reference to it (see Russ Cox's blog post https://research.swtch.com/tictactoe "Play Tic-Tac-Toe with Knuth"). I'm only a third of the way through it, but unlike the popular image (his plans were never completed, the project was a failure etc), he seems to have been the real deal, really did understand what computation was possible, in many respects he was thinking like a programmer. Too bad machine-making of his time was not up to the task, or we might have had a different history. (According to Wikipedia, William Gibson and Bruce Sterling had the same thought, and came up with their 1990 novel "The Difference Engine", establishing the genre of steampunk.)
It's nice to know, as someone that works with computers, that this layman attitude is eternal and not something unique to our current times.
Consider: The "regula falsi" approach to solving equations in one unknown actually involves a guessed, "false" input. https://en.m.wikipedia.org/wiki/Regula_falsi#The_regula_fals...
Robert Recorde wrote:
Gesse at this woorke as happe doth leade.
By chaunce to truthe you may procede.
And firste woorke by the question,
Although no truthe therein be don.
Suche falsehode is so good a grounde,
That truth by it will soone be founde.
From many bate to many mo,
From to fewe take to fewe also.
With to much ioyne to fewe againe,
To to fewe adde to manye plaine.
In crossewaies multiplye contrary kinde,
All truthe by falsehode for to fynde.
Now, somebody on HN ("wzdd") has previously tried to defend Babbage, on more than one occasion (e.g. https://news.ycombinator.com/item?id=29605135), saying that he wasn't mystified by the misunderstanding, but instead was making some kind of joke at his own expense (not a snide comment at the expense of the questioner.) I'm far from convinced.It seems to me that we shouldn't be celebrating this mean-spirited passage from Babbage's writing.
I presume the question could also be directed at whether the machine would require a specially trained operator and thus more funding or whether anyone skilled in the Arts and the Trades could work the machine efficiently without oversight or much necessary direction. Given the machine was a whole new step and direction of the economy, I can understand their hesitation.
A computer without a program, while brilliant, is useless.
And everything you said doesn't discount using a lower precision ALU, and chaining the results with carry propagation. We do that today; every Diffie-Hellman your computer performs involves numbers far larger than it's ALU width. And bit serial machines have a long history.
The Difference Engine does not do any multiplications.
As for the stupendous precision. I implemented a difference engine today in Excel to see what's going on. It's a very fun exercise, one can do it in 15 min. But be warned, you'll waste hours playing with the thing.
Here's how the Difference Engine works. You want to calculate a function f at the points 0,dx, 2dx, 3dx, etc. You do it inductively, using the formula
f(x + dx) = f(x) + f'(x)dx
But who is going to give you f'(x)? Well, you calculate that inductively too. Or more precisely (this is crucial) you calculate the whole f'(x)
dx inductively:f'(x + dx) dx = f'(x) dx + f''(x) dx^2
And then for f'' dx^2, you say
f''(x + dx) dx^2 = f''(x) dx^2 + f'''(x) dx^3
At some point you decide to stop, so you assume that a certain derivative is constant. That's the order of the scheme. Wikipedia states that the second Difference Engine envisioned by Babbage had an order of 7 and 31 digits of precision, but I suspect it's a mistake. I think it's more likely the order of 8. The 8'th derivative of log(x) evaluated at 1 is -7!=-5040. If you use a dx=0.0001 then you need to store the number 504010^-32 = 504 10^31.
So, I suspect Babbage was trying to produce log tables with increments of 0.0001 with a precision of six digits. If you look at the error of this scheme, you'll see that it grows exponentially, and after just 1000 steps the error is of the order of 10^-6. So you need to reset your starting point, and start again. You produce 1000 more logs, then you reset again. After a while, the scheme becomes better behaved (fundamentally because you move further away from the function's singularity, which is zero). By the time you are around 4, you can run 10000 steps while keeping the error below 10^-6.
Now, it looks like a successor of Babbage, Scheutz, actually built a difference engine. I think the guy deserves as much admiration, if not more, than Babbage himself. He used 15 digits and only 4th order differences. But if you look at engines with different orders, you'll find out that higher orders stop giving a significant bang for the buck after the 4th order.
Does 15 digits/4th order make sense? Well, only if you are quite smart, but I think Scheutz was plenty: the fourth order derivative of log at 1 is 3!=6, so you need to be able to store the number 60.0001^4=610^-16. But how do you do that if you only have 15 digits? Well very simple: you observe that for the first about 1000 steps, all the numbers in the table start with 0.0, so you don't store only the digits after that, and for that you only need 15 digits.
Highlighting this for extra exposure. For even more info, plus an emulator, see [1] (also linked from the blog post).
Of course the tricky answer is, where possible that is exactly what we should strive for.
People hate it when their SQL Server responds to a 60 line procedure with "Syntax error" even though I'm sure that's technically correct - while they like it when the Rust compiler spits out an explanation of why what they wrote can't work, pointing at the specific places it's wrong and suggesting what might help.
If you ask Google for "tow the line" it suggests "Did you mean toe the line?" because sure enough that's the expression you probably wanted (unless what you wanted was specifically people explaining why it isn't "tow the line" but don't worry it does link those explanations)
Seems like detecting errors like Rust wouldn't occur to someone in a world where basically no "smart objects" of any kind exist. Up until recently, most objects were passive tools under direct human control with no more intelligence than a punch card loom at the most.
Lots of people still don't really think much outside of the "Manmade things as passive tools" mindset or see a need for anything more.
That's a great point, and I've been thinking about the similar issue with compilers and type systems. Nowadays people seem to frame type systems as originating from math and logic, but really the first type systems were for instruction selection -- generating different code for a+b when they're ints or floats. It was more of an engineering thing.
So many rules in C support that, and most of them survive in C++ (arrays decay to pointers, etc.)
In Search of Types is a great read: https://www.cs.tufts.edu/~nr/cs257/archive/stephen-kell/in-s...
The last 40 years have seen an impressive confluence of theory and practice in programming language design, with the interesting side-effect of taking the sense of “types” originating in symbolic logic and implanting it into engineering traditions.
I kinda want to read about type systems from a historically accurate perspective. I think it's well known that Ritchie and Thompson didn't agree with many of the type safety improvements in ANSI C (even though ANSI C seems ridiculously weak from a modern perspective).
Somewhat related to this is that there seems to be a ton of exposition on Hindley Milner type systems, but very little on explicit object oriented type systems (Java, C#, C++, Kotlin, Swift, etc.)
This was the most memorable quote from his autobiography for me!
GIGO - Garbage In Garbage Out - was the first think taught to me in school in Computer Class.
I always used to think why they taught us that - it's common sense! Turns out people have been asking this question since the conception of programmable computers!
*edit: To me, this seems to be the greatest obstacle towards artificial intelligence. We search AI within computational concepts, where GIGO holds, whereas society already knows what intelligence is. It could be more fruitful to start from there compared to training NNs until they speak.
Konrad Zuse was a civil engineer who was annoyed by doing manual numerical calculations and so started to build his computers (22-bit floating point machines). He too saw how many engineer-man-centuries these machines could save and approached the Nazi government which of course blundered that and thought computers were irrelevant.
Zuse built "computers" and process control for military R&D and production. He wasn't a major concern or priority at a high level, but given resources "thought irrelevant" projects wouldn't have gotten.
Well, it seems they were enthusiastic users of IBM machines, maintenance service, spare parts, training etc.