May 24, 2009

Leibniz, Bagua, Binary, and the Turing Machine

I have been wanting to do some more interesting discussion on the productive works of Sinophilic Western philosophers of the Modern Era, a bit of something to extend my citations and brief discussions of Schopenhauer's contact with Chinese religion, and more specifically Neo-Confucianism. However, this more recent read, for the "hardcore Analytic" "pedantic logician" I am, proved much more fruitful than my find of an empathetic ear to the culturally negligent instructional policy in contemporary philosophy of religion.

I stumbled onto an article titled "八卦不可思議的數字規律" (or "The Bagua's Inconceivable Number Pattern"), which gave firm interest in the Bagua's treatment and discoveries as a mathematical models. The article itself barely takes the space of a page (if you ignore the huge bagua in the article), but divides into three sections, the first of which was most appetizing to my intellectual palette.

The first section of the article talks about the history of Leibniz's find of the binary number system within the bagua and its offshoot diagrams. The article reveals that Leibniz's owes his discovery to an early Christian missionary who sent Leibniz (or as I'm going to call him henceforth, Laibunici [萊布尼茲]) a copy of (what I presume) was a Zhouyi (here put in an ugly grid to ruin its aesthetic appeal). In it, Leibniz apparently saw that basis for the binary number coding system, which we know now as the favored base of a working computer.

It's rudimentary Yijing study for most who would read here, but the idea is apparently that by translating the solid lines to 1 and the broken lines to 0, one gets all of the first eight numbers of the binary number system.

The number series to seven in binary: 00,01,10,11,100,101,110,111

The number series to seven in bagua numbering: 000,001,010,011,100,101,110,111

Of course, from these, the infinity of numbers would follow, and the sixty-four grams of the Zhouyi yielded the first sixty-four numbers from 0-63.

「現在如有一聖人欲選擇一優秀民族,加以獎勵,那麼,他的金蘋果的賜與,一定會落到中國人的身上。」
"Now, if there were a sage who wished to choose an outstanding ethnicity as an additional reward, his golden apple would be given to him given that he were able to have the body of a Chinese man befall him." -- GWF von Leibniz (trans. Joshua Harwood)
While definitely interesting that the Chinese (perhaps unintentionally) formed a diagram which carried mathematical sophistication along with it, the extent to which the Chinese didn't appear to use it toward its better known modern functions is even more interesting. As is commonly known, binary numbering is the preferred base system of the computer, working from strings of ones and zeroes to generate everything that we see on a computer.

The surprise for me is not seeing a clear reason why the Chinese did not invent the computer. Social and economic issues aside, China did not arrive first at most of the major conceptual steps that led to von Neumann's computing machine, and below I've provided a small, chronological list of things that the Chinese did not manage to complete that were pivotal to such invention:

  • The Turing Machine calculation experiment, off of which von Neumann's model is heavily based, did not occur directly to any major Chinese academic at the time because...
  • Turing could not have taken interest in mathematical logic because...
  • Mathematical logic, from Frege, to Hilbert, to Peano, to Russell, to Gödel, was not a remotely Chinese development.
What's shocking, though, is that the Chinese, despite their shortages in the formalisms that brought us there, seem to have a good many essential understandings needed to derive a conception similar to a Turing machine thought experiment.

Perhaps there is nothing more strikingly resembling of a Turing machine to me than an abacus (算盤). We may draw some analogies from Turing's original essay, "On Computable Numers, with an Application to the Entscheidungsproblem" to see what precisely abacuses and Turing machines share in common (also, a site to get a clearer summary and some practice with the machine, itself).
"The 'computable' numbers may be described briefly as the real numbers whose
expressions as a decimal are calculable by finite means. Although the subject of this
paper is ostensibly the computable numbers, it is almost equally easy to define and
investigate computable functions of an integral variable or a real or computable variable, computable predicates, and so forth."
The abacus can only calculate real numbers, and even then, only those numbers with finitely calculable decimals.
"We may compare a man in the process of computing a real number to a machine which is only capable of a finite number of conditions q1, q2, ..., qR which will be called 'm-configurations'. The machine is supplied with a 'tape', (the analogue of paper) running through it, and divided into sections (called 'squares') each capable of bearing a 'symbol'. At any moment there is just one square, say the r-th, bearing the symbol S(r) which is 'in the machine'. We may call this square the 'scanned square'. The symbol on the scanned square may be called the 'scanned symbol'. The 'scanned symbol' is the only one of which the machine is, so to speak, 'directly aware'. However, by altering its m-configuration the machine can effectively remember some of the symbols which it has 'seen' (scanned) previously. The possible behaviour of the machine at any moment is determined by the m-configuration qn and the scanned symbol S(r). This pair qn, S(r) will be called the 'configuration': thus the configuration determines the possible behaviour of the machine. In some of the configurations in which the scanned square is blank (i.e. bears no symbol) the machine writes down a new symbol on the scanned square: in other configurations it erases the scanned symbol. The machine may also change the square which is being scanned, but only by shifting it one place to right or 1eft. In addition to any of these operations the m-configuration may be changed. Some of the symbols written down {232} will form the sequence of figures which is the decimal of the real number which is being computed. The others are just rough notes to 'assist the memory'. It will only be these rough notes which will be liable to erasure."
A two-slider abacus may conceivably have infinitely many decimal place rows (as "tape") and each of the rows will be considered the cell (i.e. the "square") which has the ability to represent a "symbol" for one, zero, or blank. We can consider a one-slide on the heaven tiles to be the blank-to-non-blank determiner, while the earth has an up (one) and down (zero) setting. While abacus users are likely to focus on the table itself, we can instead direct our attention to command sequences based on what happens to one side or another of the abacus.

An automated abacus, then, would function in this way:
  1. Start at a row, specific or arbitrary depending on the intended function.
  2. Read the symbol for that row.
  3. Depending on what's written on the row over which our reader (our finger, I'll suppose), we can alter the state (of infinitely many allowable) and perform exactly one of the following actions in 3.
  4. Erase on heaven tile (slide it down), slide heaven and earth tile up (to 1), slide heaven tile up and earth tile down (to 0), move left, or move right.
  5. HALT if there is no action rule for a given state and reading.
Actually, most of the basic arithmetic could be controlled by a series of mechanical functions which are determined by states and actions. There only needs to be an infinity of rows and enough programmed states to satisfy the operation from any given collection of preset entries.

It appears that, without extra earth tiles, the arithmetic has to be done in unary. However, the machine works on a two-tier binary system: the erased-unerased at the top, and the zero-one at the bottom.

There appears to be a substantial body of detail that needs to enter into proofs for the execution of every arithmetical operation, but for now I'll maintain that with a two-tiled abacus, one heaven tile and one earth tile, and an infinity of rows, one could complete all of the arithmetical operations following only a finite set of rules (i.e. of state changes and actions within those state changes).

That the Chinese did not conceive of automatic abaci is also not of much surprise. Plenty of cultures had them, but didn't think of their automatic calculation without non-human intervention, and more importantly, human mathematical reasoning!

What amazes me more about the Chinese not completing some sort of automation for their calculation machines prior to Turing's thought experiment and von Neumann's invention stems from listening to a recent lecture from Daniel Dennett in which he likens the Turing machine and Turing's conception to Darwin's conception of natural selection. Dennett calls it a "strange inversion of reasoning," which he uses as a cynical way of clarifying that efficiency and order does not imply agential intervention. Dennett's lecture, while quite efficient and sound, is a signature of a facet of Western philosophers out which I've earlier complained. Dennett, like most Western philosophers, never looked past the Abrahamic tradition or the Western hemisphere to check for consistency in his statements. Had Dennett known more of pre-modern East Asian culture, religious practice, and philosophy, he would have probably made two cautious qualifications to this "strange inversion of reasoning." First, this "strange inversion" is only "strange" and an "inversion" to us because of Westernized preconceptions; and second, that well-placed East Asian perspective took the idea that organization was not necessarily agential, and thus that the East Asian reasoning is not at all inverse or "strange" to Turing's or Darwin's reasonings.

While I generally prefer citing Daoist sources, perhaps a primary Confucian source will do much better, as the influence of Confucianism has been a greater mainstay through Chinese history than any of the other pre-Han schools.
"子曰:'參乎!吾道一以貫之。'曾子曰:'唯。'子出。門人問曰:'何謂也?' 曾子曰:'夫子之道,忠恕而已矣。'
"The Master said, 'Shen, my doctrine is that of an all-pervading unity.' The disciple Zeng replied, 'Yes.' The Master went out, and the other disciples asked, saying, 'What do his words mean?' Zeng said, 'The doctrine of our master is to be true to the principles of our nature and the benevolent exercise of them to others, this and nothing more.'" -- Analects, 4:15 (trans. Legge)
"子曰:'為政以德,譬如北辰,居其所而眾星共之。'
"The Master said, 'He who exercises government by means of his virtue may be compared to the north polar star, which keeps its place and all the stars turn towards it.'" -- Analects, 2:1 (trans. Legge)
"子曰:'性相近也,習相遠也。'
"The Master said, 'By nature, men are nearly alike; by practice, they get to be wide apart.'" -- Analects, 17:2 (trans. Legge)
"子曰:'賜也,女以予為多學而識之者與?'對曰:'然,非與?'曰:'非也,予一以貫之。'
"The Master said, 'Ci, you think, I suppose, that I am one who learns many things and keeps them in memory?' Zi Gong replied, 'Yes - but perhaps it is not so?' 'No,' was the answer; 'I seek a unity all pervading.'" -- Analects 15:3 (trans. Legge)
While these passages only give a brief glimpse into the greater Confucian (and by extension, a massive portion of the Chinese philosophical) reasoning, we note that a good many of these statements do not make use of discussion of creations from higher powers. Kongzi's work is not overrun with overt divine command or some tacit creationism. The divine command is replaced in Confucius's work with a (comparably fallacious) appeal to tradition, and the strong conviction that human agents of the past, slightly mythicized, had a proper and right view of the ideal state and household. Confucius himself regularly admits that his doctrine is a product of learning, and even laments in places that he had not intuited automatically what truly constituted justice, propriety, and virtue as his ancestors had. The creationism, the notion of nature as being a product of yet some other greater being, is actually outdone come the Zhou Dynasty. While supernatural elements reside in areas of Confucian thinking, those are not in the thoughts of the universe, and once again, those supernatural impulses appeal mainly to one's own ancestry.

This leads to a comparable "inversion" when compared to the views of the Abrahamic tradition: One does not need to create the universe or humanity in order to know everything, or even the most important truths, about either. In fact, one's knowledge could be virtually null, but one's virtuous and proper nature complete through bare intuition alone. The whole idea of "doing good without doing actively," or of "being of a sort without knowing how to be that was" is consistent, though somewhat divergent, from the same idea that prompt conversation about the abilities of unthinking machines to do the work of what those in the Western past would have regarded as a specially conscious activity.

Again, Chinese had hurdles aplenty that, not surmounted, stifled a good formal lead into anything resembling the Turing machine thought experiment. However, some of the facets that philosophers like Dennett are using to explain the seeming oddity of "unintelligent design" (my phrasing, not his) to those not used to being jostled from their anthropocentrically projected beliefs about the nature of the natural world (the Feuerbach summary), for as strongly as the analogy holds, also appears to favor some of the most important (pre-?)conceptions of ancient China.

No comments:

Post a Comment