Ada's Algorithm
Page 15
The rigid exactness of those laws which regulate numerical calculations must frequently have suggested the employment of material instruments, either for executing the whole of such calculations or for abridging them; and thence have arisen several inventions having this object in view.
For instance, the much-admired machine of Pascal is now simply an object of curiosity, which, whilst it displays the powerful intellect of its inventor, is yet of little utility in itself. Its powers extended no further than the execution of the first four operations of arithmetic, and indeed were in reality confined to that of the first two, since multiplication and division were the result of a series of additions and subtractions.
The chief drawback hitherto on most of such machines is, that they require the continual intervention of a human agent to regulate their movements, and thence arises a source of errors; so that, if their use has not become general for large numerical calculations, it is because they have not in fact resolved the double problem which the question presents, that of correctness in the results, united with economy of time.
The text continues to underline the significance of and credits Babbage with ‘the realisation of a gigantic idea.’ His machine was ‘capable of executing not merely arithmetical calculations, but even all those of analysis.’
What is meant here is the field of mathematics that is called analytical (or Leibnizian) calculus, which the Analytical Society that Babbage had been part of had so successfully introduced at Cambridge University. This type of mathematics works with numbers that are infinite (beyond expression in digits) or numbers whose fraction is infinitely small and can never be expressed in sufficient number of digits. A mere calculating machine, such as the original Difference Engine, would only be able to start with incomplete numbers and its calculations would therefore by definition be next to useless to cover this important area of mathematics.
If Babbage could have got it to work on cogwheels, the Analytical Engine would have been amazing. This new machine would in effect be able to work correctly both with exact numbers as well as ‘imaginary’ numbers, that is to say numbers you can only approximate and never express exactly in reality.
Ada did not need to be a genius mathematician to translate Menabrea’s article itself, but she did need to have a good understanding of what Menabrea was talking about, and also – this is not a trivial observation – she obviously needed to love the subject of the Analytical Engine or she would hardly have wanted to do the translation in the first place.
Altogether, Menabrea’s translation is about 8,000 words in length. It may seem short, but given the number of mathematical formulas and highly technical detail it is a dense and rich brew, so much so that the article contains one small error in the translation that neither Ada nor Babbage picked up. The French original reads at one point ‘Cependant, lorsque le cos de …’ It should have read ‘Cependant, lorsque le cas de …’ But the printer had swapped the French word ‘cas’ with the word ‘cos,’ a mathematical symbol. The result is something that leads to mathematical gibberish in the context of the machine, which some have used to argue against Ada’s brilliance, though not in the same breath against Babbage’s – perhaps because it would be hard to defend the claim in the face of his well-documented achievements in so many areas other than the Analytical Engine, his lifetime project.
Babbage’s reference to Ada in Passages was supplemented, and indeed complemented, by a paragraph in a letter he wrote to Ada’s son Byron on June 14, 1857, nearly five years after Ada’s death and seven years before Passages was published. In the letter Babbage observed to him:
In the memoir of Mr Menabrea and still more in the excellent Notes appended by your mother you will find the only comprehensive view of the powers of the Analytical Engine which the mathematicians of the world have yet expressed.
Ada appended her own writing about the Analytical Engine as Notes by the Translator immediately following her translation of Menabrea’s article. There are seven of them, given successive letters from A to G. Altogether the Notes are about 20,000 words long, more than twice as long as the translation.
It is important to point out that much of the content of Ada’s Notes is highly technical material about how the Analytical Engine is designed to operate and carry out its functions.
However, in addition to technical writings, Ada’s Notes include general observations about the Analytical Engine. It is these that show the real nature of Ada’s achievement in an accessible way.
This passage, close to the beginning of Ada’s Notes, shows her passion for explaining to the world in succinct terms what Babbage’s Analytical Engine is, and what it means. As Ada writes:
In studying the action of the Analytical Engine, we find that the peculiar and independent nature of the considerations which in all mathematical analysis belong to operations, as distinguished from the objects operated upon and from the results of the operations performed upon those objects, is very strikingly defined and separated.
It is well to draw attention to this point, not only because its full appreciation is essential to the attainment of any very just and adequate general comprehension of the powers and mode of action of the Analytical Engine, but also because it is one which is perhaps too little kept in view in the study of mathematical science in general.
It is, however, impossible to confound it with other considerations, either when we trace the manner in which that engine attains its results, or when we prepare the data for its attainment of those results.
It were much to be desired, that when mathematical processes pass through the human brain instead of through the medium of inanimate mechanism, it were equally a necessity of things that the reasonings connected with operations should hold the same just place as a clear and well-defined branch of the subject of analysis, a fundamental but yet independent ingredient in the science, which they must do in studying the engine.
The confusion, the difficulties, the contradictions which, in consequence of a want of accurate distinctions in this particular, have up to even a recent period encumbered mathematics in all those branches involving the consideration of negative and impossible quantities, will at once occur to the reader who is at all versed in this science, and would alone suffice to justify dwelling somewhat on the point, in connection with any subject so peculiarly fitted to give forcible illustration of it as the Analytical Engine.
What Ada is emphasising here is the clear distinction between data and processing: a distinction we tend to take for granted today, but which – like so much of her thinking about computers – was in her own day not only revolutionary but truly visionary. In none of Babbage’s writings does he consider that the new engine might be used for anything other than mathematics. He himself, with slight condescension, acknowledges this by calling Ada his ‘interpretess.’
Ada continues:
It may be desirable to explain, that by the word operation, we mean any process which alters the mutual relation of two or more things, be this relation of what kind it may. This is the most general definition, and would include all subjects in the universe.
In abstract mathematics, of course operations alter those particular relations which are involved in the considerations of number and space, and the results of operations are those peculiar results which correspond to the nature of the subjects of operation.
But the science of operations, as derived from mathematics more especially, is a science of itself, and has its own abstract truth and value; just as logic has its own peculiar truth and value, independently of the subjects to which we may apply its reasonings and processes.
Ada is here seeking to do nothing less than invent the science of computing, and separate it from the science of mathematics. What she calls ‘the science of operations’ is indeed in effect computing.
Unlike Babbage, Ada saw the practical uses of the Analytical Engine and foresaw the digitisation of music as CDs or synthesisers and their ability to generate music. As she writ
es:
The operating mechanism can even be thrown into action independently of any object to operate upon (although of course no result could then be developed).
Again, it might act upon other things besides number, were objects found whose mutual fundamental relations could be expressed by those of the abstract science of operations, and which should be also susceptible of adaptations to the action of the operating notation and mechanism of the engine.
Supposing, for instance, that the fundamental relations of pitched sounds in the science of harmony and of musical composition were susceptible of such expression and adaptations, the engine might compose elaborate and scientific pieces of music of any degree of complexity or extent.
This most impressive passage shows how Ada sees mathematics and its relationship to philosophy in general. The Cambridge academic and novelist C.P. Snow in 1959 would lament in a lecture called ‘The Two Cultures’ that our society divides itself into science or the humanities. But in this passage the daughter of Byron – perhaps to the horror of modern poets – writes that mathematics provides the invisible threads that can express everything in the tangible world. Here she leaps well beyond Babbage’s Analytical Engine and how it expressed mathematics in the real world, to a philosophical topic that is hotly debated by leading scientists today and advanced practically by the increasing sophistication of software companies such as Google, which are mining an ever-expanding ocean of data that no one human being could ever generate. As Ada says in her Notes:
Those who view mathematical science, not merely as a vast body of abstract and immutable truths, whose intrinsic beauty, symmetry and logical completeness, when regarded in their connection together as a whole, entitle them to a prominent place in the interest of all profound and logical minds, but as possessing a yet deeper interest for the human race, when it is remembered that this science constitutes the language through which alone we can adequately express the great facts of the natural world, and those unceasing changes of mutual relationship which, visibly or invisibly, consciously or unconsciously to our immediate physical perceptions, are interminably going on in the agencies of the creation we live amidst: those who thus think on mathematical truth as the instrument through which the weak mind of man can most effectually read his Creator’s works, will regard with especial interest all that can tend to facilitate the translation of its principles into explicit practical forms.
This 158-word sentence is very likely one of the longest sentences in the history of science, but it is also one of the most intriguing. Ada succeeds in this one sentence in linking mathematics, science, religion and philosophy.
In the next passage, which in Ada’s published Notes follows immediately on from the above, Ada’s grasp of the vital point that the Analytical Engine and the Jacquard loom are, at heart, doing the same kind of thing is a wonderful and enormous conceptual leap that stakes her claim to be a major figure – and unquestionably the leading female figure – in the prehistory of the computer. It shows that she understood exactly what a computer was.
One particular sentence from her Notes is so important that I have bolded it below. It represents the very heart of Ada’s understanding of the nature of the link between digitised weaving and digitised computing and expresses, with the greatest elegance and beauty, the essential relationship between the Analytical Engine and the Jacquard loom. A strong case could be made that this sentence is the most visionary sentence written during the entire nineteenth century.
The distinctive characteristic of the Analytical Engine, and that which has rendered it possible to endow mechanism with such extensive faculties as bid fair to make this engine the executive right-hand of abstract algebra, is the introduction into it of the principle which Jacquard devised for regulating, by means of punched cards, the most complicated patterns in the fabrication of brocaded stuffs.
It is in this that the distinction between the two engines lies. Nothing of the sort exists in the Difference Engine. We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves. [The bolding is mine, not Ada’s.]
Here, it seems to us, resides much more of originality than the Difference Engine can be fairly entitled to claim. We do not wish to deny to this latter all such claims.
We believe that it is the only proposal or attempt ever made to construct a calculating machine founded on the principle of successive orders of differences, and capable of printing off its own results; and that this engine surpasses its predecessors, both in the extent of the calculations which it can perform, in the facility, certainty and accuracy with which it can effect them, and in the absence of all necessity for the intervention of human intelligence during the performance of its calculations.
Its nature is, however, limited to the strictly arithmetical, and it is far from being the first or only scheme for constructing arithmetical calculating machines with more or less of success.
The bounds of arithmetic were however outstepped the moment the idea of applying the cards had occurred; and the Analytical Engine does not occupy common ground with mere ‘calculating machines.’
It holds a position wholly its own; and the considerations it suggests are most interesting in their nature. In enabling mechanism to combine together general symbols in successions of unlimited variety and extent, a uniting link is established between the operations of matter and the abstract mental processes of the most abstract branch of mathematical science.
A new, a vast, and a powerful language is developed for the future use of analysis, in which to wield its truths so that these may become of more speedy and accurate practical application for the purposes of mankind than the means hitherto in our possession have rendered possible. Thus not only the mental and the material, but the theoretical and the practical in the mathematical world, are brought into more intimate and effective connection with each other.
We are not aware of its being on record that anything partaking in the nature of what is so well designated the Analytical Engine has been hitherto proposed, or even thought of, as a practical possibility, any more than the idea of a thinking or of a reasoning machine.
This next passage is no less inspired, and again shows the depth of Ada’s understanding of what a computer really is.
There are many ways in which it may be desired in special cases to distribute and keep separate the numerical values of different parts of an algebraical formula; and the power of effecting such distributions to any extent is essential to the algebraical character of the Analytical Engine.
Many persons who are not conversant with mathematical studies, imagine that because the business of the engine is to give its results in numerical notation, the nature of its processes must consequently be arithmetical and numerical, rather than algebraical and analytical.
This is an error. The engine can arrange and combine its numerical quantities exactly as if they were letters or any other general symbols; and in fact it might bring out its results in algebraical notation, were provisions made accordingly.
It might develop three sets of results simultaneously, viz. symbolic results (as already alluded to in Notes A and B), numerical results (its chief and primary object); and algebraical results in literal notation.
This latter however has not been deemed a necessary or desirable addition to its powers, partly because the necessary arrangements for effecting it would increase the complexity and extent of the mechanism to a degree that would not be commensurate with the advantages, where the main object of the invention is to translate into numerical language general formulæ of analysis already known to us, or whose laws of formation are known to us.
Ada is the complete mistress of her thought-domain: which could be described as the domain of the intellectual prehistory of the computer. She is thoughtful, perceptive, inspired and brilliant, yet she always adopts a deferential tone in her Notes towards Babbage; she never claims, in effect, to be doing anything more than helping
the reader to understand what the Analytical Engine really is and what it means.
Nor, indeed, does she have any misconception that the Analytical Engine is a kind of miraculous machine. She emphasises that it can only do what it is told to do.
As she writes:
It is desirable to guard against the possibility of exaggerated ideas that might arise as to the powers of the Analytical Engine. In considering any new subject, there is frequently a tendency, first, to overrate what we find to be already interesting or remarkable; and, secondly, by a sort of natural reaction, to undervalue the true state of the case, when we do discover that our notions have surpassed those that were really tenable.
The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform. It can follow analysis; but it has no power of anticipating any analytical relations or truths. Its province is to assist us in making available what we are already acquainted with. This it is calculated to effect primarily and chiefly of course, through its executive faculties; but it is likely to exert an indirect and reciprocal influence on science itself in another manner.
For, in so distributing and combining the truths and the formulæ of analysis, that they may become most easily and rapidly amenable to the mechanical combinations of the engine, the relations and the nature of many subjects in that science are necessarily thrown into new lights, and more profoundly investigated.
This is a decidedly indirect, and a somewhat speculative, consequence of such an invention. It is however pretty evident, on general principles, that in devising for mathematical truths a new form in which to record and throw themselves out for actual use, views are likely to be induced, which should again react on the more theoretical phase of the subject.