In the thirty-third year of Xingwei (1381), Bech, a master of Qinghua Academy in the Eastern Song Dynasty, had a bold idea in his mind—to build a large difference engine.

During the Eastern Song Dynasty, the fields of navigation, engineering, and astronomy were developing rapidly. The precise advancement in these fields relied heavily on various mathematical tables such as trigonometric tables and logarithmic tables. The accuracy of every piece of data was directly related to the success or failure of each undertaking.

However, at that time, all mathematical tables were calculated and transcribed by hand. Even if the calculators and transcribers were extremely careful, it was almost impossible to avoid minor numerical errors.

But no one expected that such a seemingly insignificant little mistake could often lead to irreparable consequences: it could cause a ship to lose its way in the vast ocean and eventually sink to the bottom of the sea; it could also cause a bridge design to be flawed, making it vulnerable after completion and causing a safety accident.

Becky himself was deeply troubled by errors in logarithmic tables, and he lamented more than once, "I really wish these tedious calculations could be done with steam!"

It was this extreme pursuit of data accuracy, and his deep understanding of the drawbacks of manual calculation, that gave him an unprecedented idea—to use machines to replace manual labor in completing calculations and printing tables, thereby fundamentally eliminating human error.

So Becky devoted himself to research and designed the prototype of the difference engine.

The core idea of ​​this machine is the "difference method," which is extremely ingenious. It successfully avoids the complicated and tedious multiplication and division operations. By simply repeating the addition operation, the value of the polynomial can be calculated accurately, which greatly reduces the difficulty and error of the calculation.

Its basic principle is not complicated: for an Nth degree polynomial, its Nth degree difference is a constant.

Logarithmic functions and trigonometric functions, which are commonly used in navigation, astronomy and other fields during the Eastern Song Dynasty, can be approximated by polynomial expansion.

Therefore, as long as a few key initial values ​​are input into the machine, it can automatically, quickly and accurately generate a long string of function values ​​through repeated mechanical addition operations, perfectly replacing manual calculation.

To help people understand the working principle of the difference engine more intuitively, we can look at a simple example.

Take the function F(x) = x² + x + 28 as an example:

The first difference ΔF(x) = F(x+1) - F(x) = 2x + 2;

The quadratic difference Δ²F(x) = ΔF(x+1) - ΔF(x) = 2 (this is a constant).

只要知道F(0)、ΔF(0)和这个常数2,就可以像滚雪球一样,通过连续的加法运算,一步步得出F(1)、F(2)、F(3)……的所有数值。

This process is like playing a digital version of "dominoes". Once the first domino is knocked down, the subsequent numbers will be automatically generated according to the pattern, without any human intervention.

We can break down the entire calculation process of the function F(x) = x² + x + 28 into three steps to clearly understand its logic:

Step 1: Understanding "difference".

Simply put, "difference" is the difference between two adjacent calculation results.

The first difference (ΔF) is like the height of ascent from the current step to the next when climbing stairs; the second difference (Δ²F) is about how the "ascent magnitude" itself changes, which is the difference between two adjacent "first differences".

Step 2: Calculate the initial value (which is the "first domino" we need). Based on the function formula, we first calculate the first few values ​​to find the pattern, as shown in the table below:

x | F(x) = x² + x + 28 | First difference (ΔF) | Second difference (Δ²F)

0 | 28 | F(1)-F(0)= 30 - 28 = 2 | -

1 | 30 | F(2)-F(1)= 34 - 30 = 4 | 4 - 2 = 2

2 | 34 | F(3)-F(2)= 40 - 34 = 6 | 6 - 4 = 2

3 | 40 | ...... | ......

From this table, we can extract three key numbers, which are also the core of the difference engine's calculations:

F(0) = 28: This is the starting point of the entire calculation and the basis for all subsequent values;

ΔF(0) = 2: This is the first "first difference" from x=0 to x=1, which is the key to the first step of addition;

The quadratic difference = 2: This is a constant and the core characteristic of a quadratic function. It is this constant that makes continuous addition possible.

For example, let's calculate the value of F(4) using the finite difference method. Traditionally, we would need to calculate 4² + 4 + 28 = 16 + 4 + 28 = 48; however, using the finite difference engine approach, we can accomplish this simply through addition.

Given: F(3) = 40;

Step 1: Calculate ΔF(2). We know that ΔF(1) = 4, and the second difference is 2, therefore ΔF(2) = ΔF(1) + 2 = 4 + 2 = 6;

Step 2: Continue to calculate ΔF(3), ΔF(3) = ΔF(2) + 2 = 6 + 2 = 8;

Step 3: With the difference ΔF(3) = 8 from x=3 to x=4, we can calculate F(4) = F(3) + ΔF(3) = 40 + 8 = 48.

The entire process only used addition operations and did not involve any complex exponentiation operations (such as 4²).

It is important to know that while machines can easily perform simple addition, they struggle with complex exponentiation and multiplication operations. Becky's difference method precisely solves this core problem, making machine computation a reality.

That year, Becky had successfully built a small model of a difference engine.

This model machine can process three 5-digit numbers with a precision of 6 decimal places, and can accurately calculate square tables and some simple polynomials.

This small success greatly boosted Becky's confidence, and he immediately proposed to the court to build a larger-scale difference machine—a large difference machine capable of processing 20-bit numbers and equipped with seven 20-bit registers.

The students at Tsinghua Academy immediately recognized the enormous potential of this technology in the fields of astronomical and nautical watchmaking. However, they also clearly saw the enormous challenges behind it: this large differential engine was expected to require 25000 parts and weigh several tons. Even more demanding was that the error of many key parts could not exceed one-thousandth of an inch. Such precision requirements were almost impossible to achieve with the industrial level at the time.

The Daoist officials of the Eastern Song Dynasty were highly accomplished in the field of Daoism. Even if they had shortcomings in certain specialized technical areas, they could quickly understand the crux of the matter as long as someone raised questions or pointed out the key issues.

Tsinghua Academy's funding mainly came from grants from the Ministry of Works and the Ministry of Revenue. However, after weighing the pros and cons, officials from these two departments disagreed on allocating funds to support Becky's large-scale difference engine project.

Without the support of powerful backers, Tsinghua Academy naturally could not provide Becky with sufficient funding.

Becky was deeply disappointed and couldn't help but curse inwardly: These officials in the court are not worthy of being called Taoist masters. They only have interests and losses in their eyes and have no dedication or pursuit of Taoist studies. They are all treacherous people blinded by greed!

Despite her disappointment, Becky did not give up on her idea.

Having no other option, he turned to other academies to see if anyone was willing to fund his research, and his first choice was the Gewu Academy.

It is widely known that Tsinghua College focuses on physics research, while Gewu College focuses on chemistry research. However, in the field of mathematics, the two are equally outstanding and comparable in strength.

Becky made a special trip to the Gewu Academy and met with the academy's Taoist priest. In front of him, she personally demonstrated the difference engine model she had made. With this small machine, she successfully calculated several commonly used function tables.

Watching the machine quickly and accurately generate the flawless "Mathematical Tables," the Taoist priest of Gewu Academy fell silent—he knew clearly that such a workload would require hundreds of people spending a great deal of time to complete if calculated using an abacus; if, as Becky said, the large difference machine capable of processing 20-digit numbers and equipped with seven 20-bit registers was successfully developed, it would bring immeasurable convenience to many fields such as Taoist studies, navigation, and engineering.

Gewu Academy and Tsinghua Academy are fundamentally different.

Tsinghua Academy's funding came from the imperial court, and every allocation required strict review to assess the feasibility and actual benefits of the project. However, Gewu Academy was different; its funding approval always came from the Royal Chamber of Commerce, and the person responsible for approving the Royal Chamber of Commerce's funds was none other than Zhao Yu himself.

Although Zhao Yu was skilled in both literature and martial arts, possessing a strong physique and a brilliant mind, since ascending the throne, his mind had gradually deviated from Taoism. Now, his mind was mostly filled with the doctrines of various religions, and he knew very little about the latest Taoist research.

However, Zhao Yu has always been "unconcerned about spending his son's money" and is extremely lenient in approving the Royal Chamber of Commerce's funding. As long as the overall level of the Gewu Academy is steadily improving, most research projects will be approved.

This leads to the fact that when evaluating a research project, the Taoist priests of the Gewu Academy do not dwell too much on its benefits or feasibility, but rather consider the impact the project will have once it is successfully developed, and how much it will promote Taoist studies and social development.

Becky's difference engine has the potential to be terrifying, enough to change the development landscape of many fields.

After a moment's thought, the Taoist priest looked at Becky and asked directly, "How much funding do you need to develop this large-scale difference engine?"

Becky, feeling uneasy, answered cautiously, "It will probably cost four thousand five hundred taels of silver."

"So little?" The Taoist priest looked surprised, then readily replied, "It just so happens that the Gewu Academy currently has some spare funds, so this money is yours."

Upon hearing this, Becky was overjoyed and secretly thought to himself: As expected, this is an academy supported by the government. This kind of spirit is something that Tsinghua Academy can't compare to!

Later scholars, when evaluating this large difference engine, mostly believed that it was an early prototype of the computer, and that Bage's design ideas had great epoch-making significance.

The development of this difference engine in the Eastern Song Dynasty also marked the beginning of the Third Industrial Revolution, which quietly emerged on this land.

Tap the screen to use advanced tools Tip: You can use left and right keyboard keys to browse between chapters.

You'll Also Like