SEL2211: Contexts Lecture 5: Computer Science Computers are everywhere. Our world could not function without them, and we use them naturally as tools in our daily lives. Perhaps surprisingly, however, the science underlying the computer technology which surrounds us is fundamental to contemporary understanding of mind, cognition, and language. This lecture outlines the fundamentals of this science. SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.1 History Historically, computation was restricted to numerical calculation. The earliest numerical calculation device we know about was the abacus, invented as early as c.2000 BC in Mesopotamia: SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.1 History This was subsequently developed in the ancient Mediterranean world as well as in China, and is still in use in some countries today. SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.1 History The Greeks appear to have developed a non-abacus type of calculating device by about 100 BC, which is what the archaeological find opposite is taken to be. SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.1 History Several types of mechanical calculating machine were developed in the Islamic world between about 700 and 1300 AD. In the West nothing is known until the 17th century, when several mechanical calculating devices were invented. The German mathematician Leibniz, for example, designed and had built the 'step reckoner' by 1694, and as the replica opposite shows, things had come a long way in terms of sophistication. SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.1 History None of the early computational devices were really computers in the modern sense. For these to emerge, several more developments were required: SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.1 History -- Modern digital computers work not with the base-10 number system with which humans are most familiar, but with the binary number system, which has only two digits, 1 and 0. The binary system was invented by the same Leibniz as he of step reckoner fame, but it could only be applied to general computation after George Boole had developed a binary algebra named Boolean algebra in his honour. SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.1 History -- In the early part of the 20th century, mathematicians became interested in the question of computability –whether all conceivable mathematical functions could be calculated, and, if not, which ones could be and which could not. This work, in combination with Boolean algebra, led directly to the invention of the Turing Machine, the theoretical model for all subsequent computational theory and technology, of which more below. SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.2 Fundamental ideas Understanding computation in the contemporary scientific sense requires familiarity with just a few simple ideas. Once these ideas are grasped, the principle of computation is perfectly straightforward. SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.2 Fundamental ideas 1.2.1 Symbols and symbol systems A symbol is any physical thing that represents –in other words, that humans agree to interpret as standing for something else. When anyone in the world sees a flag with stars and stripes, for example, it is immediately recognized as a symbol for the USA. A symbol system is a collection of related symbols –the flags of the world’s countries, for example, constitute a symbol system. The western alphabet is another symbol system: its individual letters are symbols that stand for phonemes of a language. SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.2 Fundamental ideas 1.2.2 Strings A string is a left-to-right sequence of symbols taken from some symbol system. Thus, using the alphabet symbol system as an example, the following are strings: aaabbb Xdghjfdsahjll computer SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.2 Fundamental ideas 1.2.3 Algorithms An algorithm is a sequence of instructions which is guaranteed to result in some desired state of affairs. Say the desired state of affairs is to get to the Student Union from the third floor of the Percy Building. An algorithm to achieve that might be: i. Go through the red doors on the landing ii. Walk down to the ground floor iii. Go through the front door iv. Walk down the quad v. Walk under the arches vi. Cross the road vii. Walk 10 metres viii. Turn right SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.2 Fundamental ideas 1.2.4 Computation What, in terms of symbols, symbol strings, and algorithms, is computation? Computation is string transformation according to an algorithm, no more and no less. Some examples: SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.2 Fundamental ideas 1.2.4 Computation -- Arithmetic: The computation is to multiply two numbers together, divide the result by a third number, and output the result. The numbers are represented by symbols taken from the symbol system {0..9}, the arithmetic operators are represented by symbols taken from the symbol system {( ) + - x /}, and the computation itself is written as a string: (2 x 6) / 3. An arithmetic algorithm is applied to this string, and that algorithm transforms it into another string, 4. SEL2211: Contexts Lecture 5: Computer Science 1. The nature of computation 1.2 Fundamental ideas 1.2.4 Computation -- Language translation: The computation is to translate German-language expressions into English-language ones. The German words are represented using symbols from the symbol system of German words given by, say a German dictionary, and the English ones are represented using symbols from the symbol system of English words. The string to be translated is Das rote Buch. A translation algorithm is applied to it, and the result is another string: The red book. SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine As already noted, in the early part of the 20th century, mathematicians were interested in the question of computability: whether all conceivable mathematical functions could be solved, and, if not, which ones could be and which could not. An important class of functions are those which can be solved in principle but which, as the size of the problem is increased, become so time-consuming that they become impractical to solve. A famous example is the Tower of Hanoi problem. SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine According to legend (actually invented in 1883 by French mathematician Edouard Lucas), there was a temple with a dome which marked the center of the world in Benares. Within the dome, priests moved golden disks between diamond needles. God had placed 64 gold disks on one needle at the time of creation, and it was said that, when they completed their task, the universe would come to an end (http://www.superkids.com/aweb/tools/logic/towers/). SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine Here's how Wikipedia (http://en.wikipedia.org/wiki/Tower_of_Hanoi) describes what the monks were doing: The Tower of Hanoi...is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape. SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine The objective of the puzzle is to move the entire stack to another rod, obeying the following rules: •Only one disk may be moved at a time. •Each move consists of taking the upper disk from one of the rods and sliding it onto another rod, on top of the other disks that may already be present on that rod. •No disk may be placed on top of a smaller disk. SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine This seems simple, but anyone attempting it quickly discovers that it is anything but. There are algorithms to solve it, described in detail at the above Wikipedia page and elsewhere on the Web, and where the number of discs is relatively small, as above, following any one of the algorithms leads to a solution in a small number of steps. But as the number of discs grows the number of steps increases very quickly. Intuitively, one expects that the number of steps for 6 discs will be double the number of steps for three, but this is not the case, as the following animation shows: Mazeworks: http://www.mazeworks.com/hanoi/ SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine For 3 discs 7 steps are required, but for 6 the number of steps is not 14 but 63, nine times as many, and for 9 discs the number of steps is not 21 but 511, which is 73 times as many. This dramatic rate of increase in the number of steps relative to modest increases in the number of discs soon exceeds all reasonable bounds: for 64 discs it takes 264 -1 steps and, assuming one step per second, the solution would take 585,000,000,000 years to complete (http://www.superkids.com/aweb/tools/logic/towers/). SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine This type of rather abstruse research question became very relevant to real-world concerns during the Second World War, when Allied shipping in the North Atlantic was being sunk by German submarines and Britain was thereby being starved of resources. The reason the German submarines were so successful is that they and their command centre were using a code to send messages that the Allies could not decipher using existing methods. A team of mathematicians was assembled at Bletchley Park near Milton Keynes. SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine Their remit was to crack the code; using ideas from research into computability they were successful, thereby contributing greatly to the Allied victory. The breakthrough came when one of these mathematicians, Alan Turing, came up with a design for what he called an 'automatic machine' which, once physically implemented, was able to break the German code. This design was to have momentous consequences beyond the immediate one of affecting the course of the Second World War, because it underlies all present day computer technology and is the basis of contemporary scientific understanding in a range of sciences including cognitive science and linguistics. SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine The following diagram shows a Turing Machine. SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine The string to be transformed is written on the input tape, one symbol per square. The transformed string which is the result of the computation is written on the output tape, one symbol per square. The memory tape is used to store symbols used in the course of the computation The control contains an algorithm which orchestrates reading from the input tape using the read head, writing to the output tape using the write head, and reading and writing symbols to from and to the memory tape using the read/write head. SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine To show how the Turing machine carries out its computations, let’s look at a very simple example: transformation of the string 1+1 into the string 2 SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine SEL2211: Contexts Lecture 5: Computer Science 2. The Turing Machine Follow this link to see a physically-implemented Turing machine at work: This design for a computer, simple as it is, can compute any computable function, no matter how complex. SEL2211: Contexts Lecture 5: Computer Science 3. The Turing Machine and Computer Technology The Turing Machine as described above is the basis for standard present-day computer technology. Turing’s formulation is theoretical, and therefore too simple for practical purposes, but actual computers differ only in terms of complexity and efficiency –they all work in principle as described above. SEL2211: Contexts Lecture 5: Computer Science 3. The Turing Machine and Computer Technology The input tape = keyboard of a computer: successive key strokes constitute the input string to be transformed. The output tape = the monitor and/or the printer, both of which put out letter sequences or strings which the user then interprets. The memory tape = a combination of random access memory (RAM) and hard disk inside the computer case. The control of the Turing Machine corresponds to the central processor inside the computer case The algorithms / programs that allow the computer to perform its various tasks, such as word processing, email, Web browsing and so on, are stored as files on the hard disk. The central processor executes these algorithms by going to the appropriate file on the disk and then following the instructions. SEL2211: Contexts Lecture 5: Computer Science 4. Outline of modern computer technological development The theory of computation was invented in the 1930s to solve the mathematical problem of computability: what sorts of problem can mathematics solve? It had nothing to do with representation of language The first physical computer was built to break enemy codes during WW2 by numerical calculation. The earliest peacetime computers, built soon after WW2, were still used exclusively for numerical calculation. In the mid-later 1950s, it was realized that there could be useful applications of computers to representation and analysis of language. These applications developed slowly, and the main use of computers was still numerical. SEL2211: Contexts Lecture 5: Computer Science 4. Outline of modern computer technological development Prior to 1975, computers had been huge and very expensive devices, well out of the reach of all but governments and large businesses. Thereafter, advances in electronics made possible the construction of smaller and much less expensive computers, bringing them within financial reach of interested individuals. These were called 'microcomputers'. As microcomputers became more popular, some enthusiasts saw their educational and commercial potential and developed (relatively) easy to use software; in this period --the late 1970s and early 1980s-- Microsoft and Apple were established. A crucial piece of software in this period was the word processor, effectively an electronic typewriter, which revolutionized language representation by moving it from print produced by typewriters to electronic text files produced by computers. SEL2211: Contexts Lecture 5: Computer Science 4. Outline of modern computer technological development Computers had from early on been networked, that is, connected together with wires to that electronic data could be moved between and among them. Such early networks were relatively small and slow. From the mid-1980s, as the number of computers rapidly grew, the networks became much larger and very much quicker. This formed the basis for the present-day Internet. As the Internet developed, software that could exploit it was invented. Email came first, and then Web browsers like Netscape. This network software was at first used mainly by governments, the military, and academics. These made it possible to move electronic text quickly and cheaply from computer to computer. By the early 1990s, computers and the software that runs on them had become consumer products. The consequences are observable around us. SEL2211: Contexts Lecture 5: Computer Science 5. Computation and meaning As we shall see next week, computation provides the theoretical framework for contemporary understanding of cognition in general and language in particular. There is a major problem with this, however. Human cognition includes meaning, and linguistic expressions more specifically have meaning. There is no meaning in a Turing Machine-based computational system. On the face of it, therefore, computation would appear inadequate as a theoretical framework for understanding of cognition and language. Much depends, however, on the nature of meaning, as we shall see.