Computation of Bernoulli’s Numbers Program

So Who Created the First Computer Bug?

Raju Kocharekar
4 min readOct 30, 2020

--

Ada Lovelace (1815–1852), Countess of Lovelace and the daughter of Poet Lord Byron is generally considered to have written the first computer program. She was a friend of Charles Babbage (1791–1871) and interested in the Analytical Engine being designed by Babbage, an early version of the modern computer. Babbage encouraged her to translate and publish an article on the Analytical Engine from the notes taken in Italian from his lecture given in Turin, Italy. She went further beyond the original information in the lecture notes to expand it with an illustration of a sample computer program. The program she wrote (pictured above) was to compute Bernoulli numbers. One of the key ingredients of the program was the introduction of a program loop construct. This feature therefore is probably the ‘goto’ force behind the reason to call this as the first written computer program.

Unfortunately, Babbage’s Analytical Engine was never developed further beyond the design phase and Ada Lovelace’s program therefore was therefore never tested, that is until recently. In 2018, Sinclair Target, a then graduate student at the University of Chicago converted her program instructions in Note D of her published article to a C language program to run and test on modern computers. He wrote the background story of Ada’s program and his further work in his 2018 article What Did Ada Lovelace’s Program Actually Do? . He was successful in testing and executing the program, but not before finding a bug in her original program. He conjectures the possibility of the bug as a typesetting error in Ada’s published program, something akin to what programmers would now call a syntax error. The bug therefore may not have been written by her but caused by someone else while publishing. According to Sinclair, this bug was also noticed by another computer programmer who converted and wrote a similar program in Python.

In its September 2019 article, the Economist’s 1843 magazine claimed that the bug discovered by Sinclair was the first written computer program bug. But was it really the first computer bug?

In their article “Ada and the First Computer” published in Scientific American in 1999, Betty Toole and Eugene Kim point out an error in Ada’s program at line 21, a different location from that discovered by Sinclair Target. This error also could be typesetting related.

But even a long time before these discoveries, there was another discovery mentioned by Babbage himself. According to Babbage, he had himself taken on the task of writing the computation of Bernoulli numbers program to help Ada out in illustrations for her article. He also wrote that she had found a grave mistake in his program and corrected it.

Since this bug was already found and corrected even before publishing Ada’s article, it can be thought of as the first computer program bug and it was not the one of those found recently.

At this point, shrewd readers have probably noticed a bug in my blog. I started the blog stating that Ada Lovelace is considered as the first computer programmer, but then further down the line said that Babbage himself indicated that he wrote the computation of Bernoulli numbers program. The controversy of who created the first computer program bug is therefore just a corollary to the controversy of who wrote the first computer program.

The first computer bug controversy is certainly not anywhere close in the league of other prominent controversies like if Leibniz or Newton invented Calculus or if Edison or Tesla should be more credited for electricity. But for someone like me, who spent countless hours in his IT profession on debugging computer programs, it is certainly of importance for idle curiosity prompting writing of this blog. It is also the reason why I am not delving further into why Sinclair did not mention the earlier another bug mentioned by Toule and Kim in 1999.

Incidentally, the reason Babbage could not fully develop the Analytical Engine was the lack of necessary funding to build it. Babbage was earlier tasked to build another machine called Difference Engine, that was sponsored and funded by the government. The Difference Engine was designed for mechanically performing simple arithmetic computations originally intended for creating logarithmic tables. It is therefore a precursor of the Analytical Engine, though it was technically similar to a calculator and not a computer.

In spite of spending a substantial sum of money, Babbage failed to successfully deliver the Difference Engine. It is said that one of the reasons for this failure was that the Difference Engine was over-engineered. Now that is another first in the overrun of computer project expenditures so common in the modern world!

--

--