Docsity

COMPUTER STUDIES AND HUMAN SCIENCES, Appunti di Fondamenti di informatica

Toggle sidebar
bg1
COMPUTER STUDIES AND HUMAN SCIENCES
1822: Charles Babbage started the development of the machine.
A reproduction of the machine was built out of Babbage’s designs at the Science Museum (London) and exhibited
at the Computer History Museum in Mountain View (California).
He was the first one to understand the complexity of performing all this calculations by hand;
the idea is that doing calculations by hand is a very error prone activity, so he started
developing the machine. The machine, named by him Difference Engine, could perform
operations similar to those that the human computer used to perform. The difference would
be that these operations would have been automatically, quickly and without error. He tried
and managed to build a partial prototype but then he realized that it was very limited, it was
able to perform a very limited number of operations on the input received so he decided to
give up; that designed machine was simply not flexible enough and in order to change the
type of computation he should have changed physically the configuration of the machine.
Still, the great-grandfather of computers!
1837: the Analytical Engine (Babbage)
After 15 years, he came up with another idea. This time the machine was only design on
paper, no prototype. The idea is that this machine should enable any procedural calculation
and this would have been the very first computer in history, if only it would have been there!
The difference between the Difference Engine and the Analytical Engine is that the latter one
could receive instructions and data in input through the use of the so-called punch cards.
So you use cards in order to change the type of computation that the machine would have to
go for. The operator would not have need to perform physical manipulation of the machine -
like in the Difference Engine -, he could have simply changed the cards: changing the cards, that
is changing the specifics, the instructions, would have been enough. The concept of
instructions begins here.
1940: Bomba (Alan Turing)
Eventually, than a century later, the idea presented by Babbage was developed in a physical
machine!
The Bombe developed by Alan Turing based on the previous work done by Polish cryptologists
like Marian Rejewski. The main tool that allowed a group of people, locked up in the base
British secret military in Bletchley Park, to decipher the German communications encrypted
by the Enigma machine.
The Bombe was effective and efficient but for a single operation and it was based on
mechanical components. It was crucial for the purpose and it succeeded but, after that, one
must say, its use was limited!
1946: ENIAC, Electronic Numerical Integrator and Computer
The Eniac is the first all-digital computer, as conceived by Babbage with its Analytical
Machine. It was developed in the United States of America. More than one century later the
It was a break-through but there is still a huge limitation: there is no way that the computer
may store this program, this computer had no memory unit.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Anteprima parziale del testo

Scarica COMPUTER STUDIES AND HUMAN SCIENCES e più Appunti in PDF di Fondamenti di informatica solo su Docsity!

COMPUTER STUDIES AND HUMAN SCIENCES

1822: Charles Babbage started the development of the machine. A reproduction of the machine was built out of Babbage’s designs at the Science Museum (London) and exhibited at the Computer History Museum in Mountain View (California). He was the first one to understand the complexity of performing all this calculations by hand; the idea is that doing calculations by hand is a very error prone activity, so he started developing the machine. The machine, named by him Difference Engine , could perform operations similar to those that the human computer used to perform. The difference would be that these operations would have been automatically, quickly and without error. He tried and managed to build a partial prototype but then he realized that it was very limited, it was able to perform a very limited number of operations on the input received so he decided to give up; that designed machine was simply not flexible enough and in order to change the type of computation he should have changed physically the configuration of the machine. Still, the great-grandfather of computers! 1837: the Analytical Engine (Babbage) After 15 years, he came up with another idea. This time the machine was only design on paper, no prototype. The idea is that this machine should enable any procedural calculation and this would have been the very first computer in history, if only it would have been there! The difference between the Difference Engine and the Analytical Engine is that the latter one could receive instructions and data in input through the use of the so-called punch cards. So you use cards in order to change the type of computation that the machine would have to go for. The operator would not have need to perform physical manipulation of the machine - like in the Difference Engine -, he could have simply changed the cards: changing the cards, that is changing the specifics, the instructions, would have been enough. The concept of instructions begins here. 1940: Bomba (Alan Turing) Eventually, than a century later, the idea presented by Babbage was developed in a physical machine! The Bombe developed by Alan Turing based on the previous work done by Polish cryptologists like Marian Rejewski. The main tool that allowed a group of people, locked up in the base British secret military in Bletchley Park, to decipher the German communications encrypted by the Enigma machine. The Bombe was effective and efficient but for a single operation and it was based on mechanical components. It was crucial for the purpose and it succeeded but, after that, one must say, its use was limited! 1946: ENIAC , Electronic Numerical Integrator and Computer The Eniac is the first all-digital computer, as conceived by Babbage with its Analytical Machine. It was developed in the United States of America. More than one century later the It was a break-through but there is still a huge limitation: there is no way that the computer may store this program, this computer had no memory unit.

BASIC OF INFORMATICS: THE ORIGIN

What is a computer? An electronic device (or system of devices) which is used to store, manipulate, and communicate information, perform complex calculations, or control or regulate other devices or machines, and is capable of receiving information (data) and of processing it in accordance with variable procedural instructions (programs or software); esp. a small, self-contained one for individual use in the home or workplace, used esp. for handling text, images, music, and video, accessing and using the internet, communicating with other people (e.g. by means of emails), and playing games. (Oxford English Dictionary) Our definition of computer Any agent, that is, an entity capable of acting it properly trained, such as a person or a machine, which is capable of doing calculations and producing a response (output) from some initial information (input). Person or machine, the important thing is that it is instructed! Human calculations – examples Passages of Halley’s Comet – calculations made by Alexis Claude Clairaut and colleagues. Napoleon Bonaparte imposed the creation of mathematical tables to convert the values described with the old imperial measurement system towards the new metric system.

THE LANGUAGE OF ELECTRONIC COMPUTERS

The binary system. Computers speak binary. All the data are represented using two symbols: 0 and 1. Why did we decide, as humans, to use this cryptic and not actually readable to represent data? If we want a machine to do something useful, something that has a meaning, we have to find a representation system that goes along with ours, so that we can communicate with the machine. Why did we chose the binary system? There is a physical reason. The circuits in a computer’s processor are made up of billions of transistors. A transistor is a tiny switch; it is activated by an electronic signal, which causes an electrical passage. Either a transistor can be ON or OFF; it cannot represent two value at the same moment. On means TRUE, OFF means FALSE. This is basically the way we communicate with the computer by switching 1 and 0, ON and OFF, TRUE and FALSE. BINARY IS A SYSTEM OF COUNTING. What is a system of counting? Let’s see two examples 1) Tally marks The simples system of counting we can use. Tally marks is what we use for tallying ongoing results such as the score in a game or sport. It is a UNARY numeral system: you use the same symbol for representing different amounts of things. What counts is the number of symbols

Why using binary? First of all, because of a physical limitation of the computer! Everything a computer does comes down to what is known as computer micro transistors: tiny little switches that can either on or off, flicked on/off with a very weak electrical charge. The first thing we need to get is one markone transistor ON. Using the tally marks system, 8 transistors can represent a number as large as 8, by turning all of them on. Using the binary system, 8 transistors can present a number as large as 255. (because 2^8 is

on = 1 off = 0 Each transistor is known as bit. ( bi (nary-digi) t ) 8 bits in a row make a byte. A byte is eight switches in a row, which means any number between 0 and 255. What it means to spell things in binary? It means to spell things in ASCII: American Standard Code Information Interchange. It is a way to convert computer data, which can only be numbers, into letters. It gives the chance to have from 0 to 255 (actually 256 if we consider the 0 as well) different symbols, which is enough for anything!

Ci sono due metodi per calcolare qual è il corrispondente di un numero decimale in binario:

metodo per divisione : con il riporto di 1 (sempre 1) quando il numero è dispari E SI CHIUDE SEMPRE CON 1; metodo per sottrazione : MAX (P) | 2 P^ ≤ n (dove per n si intende il numero scritto in decimale, chiaramente). E poi esercizietti con Eugenio, riusciti! Adesso so dimostrare che (^23712) (10)  (^101110010100000) (2).

HOW DOES A COMPUTER WORK?

Eniac solved a limit but it had a limit itself: it did not have any memory unit this means it had no capability to store the program and the data that it was executing. Von Neumann Architecture (named after the Hungarian-American scientist) is the very first computer architecture, which introduced the memory unit, where programs could be stored. This is a milestone in the history of computers: our computers are based as well on this architecture; surely, we have had and we will have many implementations but the reference architecture of computers is still this one! The CENTRAL PROCESSING UNIT (CPU) contains:

  • control unit (cu) starts everything since it is in charge of reading and interpreting instructions;
  • arithmetic or logic unit (alu) executes arithmetic operations; Along with cu and alu, the central processing unit has registers too: small units for very fast data storage.
  • input devices and output devices , devices that allow communication between computer and the external world. Examples of input devices are the keyboard, the microphone, the camera; on the other side, among the output devices, we have for example the printer, the screen and further types of memory (as the hard disk).
  • memory unit (temporarily) stores data and programs instructions.
  • memory unit ≠ the disk where we store our files: the first one is memory that computers use while running, the second one ( hard disk / mass storage, secondary memory unit) is also used for storing large amount of data but persistently. The central processing unit and the memory unit continuously communicates, as we can see from the arrows. They create a continuous cycle, the machine cycle: Fetch, decode, execute. The cpu fetches from the memory the next instruction, it decodes it, executes and then it starts again with the next one. The very first instruction the cpu reads is the one of a

The main memory unit is mounted on the motherboard and the cpu can read it very very fast, much faster than if it had to read from the secondary memory storage, the permanent one. The RAM is the main memory unit, the one where programs are copied to be executed by the cpu.

  • it stores sequences of bits;
  • it allows to retrieve sequences of bits (previously stored);
  • it is composed of a sequences of cells , numbered and ordered. Numbers represent cell addresses. Again, RAM storage is temporary: when you switch off the computer, instructions and data are reset. The dimension of the RAM indicates the number of available cells so it is very important when it comes to the capability of computers to be efficient and handle many programs together. unit of measure (mega/giga) byte The dimension of a RAM influences the dimension of programs and data that can be contemporarily loaded in memory. A computer with a small RAM will be slow because it needs frequently to free space to make room for programs and data. When the computer is “slow”, it is because of the RAM, not the cpu. This is why when one buys a new computer, depending on what one has to do with the computer; attention should be paid on RAM dimension: videogames, computer graphics, streaming etc. require a significant amount of space; Word processors, emails etc. surely require a smaller amount. Anyway, whatever kind of computer one uses, using many applications at the same time will slow down the computer, you may run out of space. ROM: Read only memory There is another kind of memory unit, which is not temporary, since the instructions of this kind of memory are encoded in the hardware so they are fixed (in fact it is called read only , you cannot write and change it!). The RAM is a small component of the motherboard and it is the first memory that is read when one switches on the computer: the phase when this happens, when the computer is switched on, is called bootstrap. The bootstrap is, by definition, the first piece of code that runs when a machine starts and it is responsible for loading the rest of the operating system. One may say that ROM stores the address of the very first instruction. Motherboard The motherboard is the backbone that ties computers’ components together at one spot and allows them to talk to each other. CPU and RAM are mounted on the motherboard and talk through buses, tiny cables.

THE OPERATING SYSTEM

The operating system is a program (software), the basic program of a computer system, the most important one. As a matter of fact, the operating system is actually not a simple program but a complex one, which is to say it is a composition of programs, each taking care of different elementary functions. It takes care of:

  1. Efficient management of hardware resources (cpu, memory, input/output);
  2. Creation of a virtual environment to support human-machine interaction. The operating system manages the order of the execution of applications in the performance of a task. The operating system has different roles:
  3. Bootstrap: when you switch the computer on, the first instruction read is the one starting the operating s;
  4. It allows the execution of more than one application concurrently:
  • cpu management: distribution of its time among different programs;
  • memory management: distribution of its space among different programs.
  1. Secondary (mass) storage management and the name of this specific program is “file system”;
  2. Support for user interaction.

HOW CAN I TELL A COMPUTER WHAT TO DO?

We tell computers what to do by using programs; writing and executing a program means being able to create a communication with an (electronic) computer by means of a language that both the computer and the human in front of it, the programmer, understand. We said it already, we repeat it for the sake of clarity, a program is a sequence of instructions , a sequence of steps, to be executed by the computer. We use programs to tell, to instruct the computer on how to do something in order to obtain what we want. The sequence of instructions (regardless of the language used for describing them) is called an algorithm. [Programming languages are less expressive than natural ones ‘cause of limited sets of terms and vocabulary. There is a language called machine language , that is basically a set of very simple instructions such as “sum” “copy” “data” “8” “paste” “2” and so on, all very basic instructions that that the cpu can do. Also, there is another language, very close to the previous one, called assembly language. And also other many languages lol] We were saying, algorithm. Implementing an algorithm means writing a program in a specific language. There are many different programming languages and one can implement the same algorithm in many different languages: it is the algorithm is the main protagonist; it is the conception of the solution. The very first machine that could have been able to handle algorithms in the proper way would have been the Analytical Engine, if only Babbage had built it! The Analytic Engine would have been in fact the first engine capable of encoding a program on punch cards, so transform the algorithm into something concrete and give it to the machine. Ada Lovelace Ada Lovelace (1815 - 1852), daughter of the British poet Lord Byron, was a brilliant mathematician. She met Babbage at a party in 1833 and they became friends, exchanging letters for 27 years, quite a long period of time, during which the young mathematician became very passionate about the project of Babbage.

As we can clearly see, there may be different solutions to solve the same problem , different algorithms. Now the fact is that all these three algorithm accomplish the same goal, but they have different costs! The taxi, for example, is the fastest way but also the most expansive; Waiting for you friend to come may have an indefinite cost in time and, also, you potentially bother a friend! Taking the bus is definitely the less expensive way but it is also the one that will take longer! This whole example is to say that you choose the algorithm based on circumstances and resources. It is depending on the resources that one already has or resources that one is willing to put in place that at the end one algorithm is preferred to another one / others. There is a whole sub-field of informatics, the study of algorithm, dedicated to the identification of algorithms with reasonable complexity. This is a crucial point in computer science in general and it is very important in terms of practical impact as well: one of the main problem for algorithm computer scientists is in fact solving problems that involve graphs (nodes and edges connected) in the most convenient way, something like “find the shortest path between two nodes”. (just think about all the practical implications of these research on everyday life: Google maps, buses timetables, transportations etc.)

FLOWCHARTS

The flowchart represents the flow of operations in the procedure that one is describing: there are a limited set of graphic objects employed to compose the diagram, every instruction is represented by an elementary block, each of which is shaped in a way that tells you a specific type of instruction. Every algorithm has an input and provides an output so, in this sense, the algorithm may be seen as a function that transforms an input into the output. Very important concept: we said before that programs are implementations of algorithms. There are 5 building blocks , five different shapes.

  1. START, starting block;
  2. READ/WRITE block;
  3. A - action block;
  4. C - condition (or control) block, with true or false;
  5. END, ending block. Now, a flowchart will ALWAYS show both a starting block at the beginning and an ending block at the end; between the starting and ending block, there will be at least one action block and/or a reading/writing block.

*** A is the algorithm** and as we can see from the IN upon it and the OUT beneath it, it transform and input into an output. Flowcharts: conditions and rules

  • each action block or reading/writing block only has one incoming arrow and one outcoming arrow;
  • each control (condition) block only has one incoming arrow but always two outcoming arrows;
  • each arrow enters in a block or it can join another arrow that is already there;
  • each block is reachable from the starting block;
  • the ending block is reachable from any other block. A block B is reachable from a block A if there is a block sequence X 1 , X2, ….. Xn such that A = X 1 and B = Xn and ∀ Xi I = 1, …. n-1, Xi is connected to Xi+. Structured programming Inexperienced programmers tend to write “convoluted” programs, by introducing numerous jumps, making the algorithm quite hard to be read and thus understood. Structured programming (a term introduced by Dijkstra) favours the definition of algorithms that are easy to understand and document. A program (flowchart) is organized according to three main control structures:

Now, we should notice how this whole “false path? ok then if it is false, do it and then go to the right path” (as in: is the machine clean? false? ok then clean it and then go to the right path) is something very similar to the cycle at the very basis of robotics (and a bunch of other things!): perceive - process (or compute) - act****.

Programming language Algorithms are implemented by using programming languages; a programming language is a language with defined syntax and semantics that the computer understands. But did not we say that computer only understand binary? Well… yes. Multilevel machine 1) Let’s call the binary language as L0. (low level programming language). The machine that understand the language L0 is, we say, the machine zero, M. P0 is a program written by the use of the language L0. 2) Ok we have a little problem: L0 is, compared to natural languages, quite tricky to understand. L1 is a language with a new set of instructions that are more convenient for humans to understand than L0. This new L1 language requires a new machine that is able to understand it, so we have a M. As regards the program, we could create a virtual machine , which is a program itself , a software itself, P1. Then we write a T0 , a translator, a program that is able to translate the program written in L1 (which is closer to the human natural language) into the corresponding program written in P0. 3) Ok, now, we all agree L1 is clearer than L0, but still. Let’s step once again in this “comprehension staircase”. L2 is the easiest of the three languages so far mentioned; we also need a machine that understands it, which is called M2 , we have a P2 as program and, going on from the previous step, we have a T1 , another translator. And this could go on and on…

Let’s see the main characteristics of the two approaches: Of course, both of them have their strong suits: ● Knowledge representation and reasoning are powerful for planning, scheduling, management and for all applications that need 100% accuracy and explainability.

  • coverage is often an issue;
  • they may benefit from LM approaches e.g. for knowledge extraction to populate the knowledge base and extend coverage. ● Deep learning is powerful for perceptive tasks: image recognition, speech recognition etc. as well as for some other tasks such that NLP (machine translation, etc.)
  • they benefit from (rely on) large knowledge bases;
  • there is a risk they can be fooled, especially with image recognition.

IRI (evolution of URL)

The idea is that you can assign a name (an IRI) to anything. IRI for real world objects: Be on the Web:

  • given only a IRI, machines and people should be able to retrieve a description about the resource identified by the URI from the Web;
  • machines should get machine readable information (RDF), humans should get readable representation (HTML); Be unambiguous:
  • there should be no confusion between identifiers for Web documents and identifiers for other resources. A very intuitive and quick view on linked open data : semantic web knowledge graphs Triple based data model: Resource Description Framework (RDF). A triple is a subject – predicate - object statement. in natural language: “Umberto Eco is author of “The name of the rose”. in RDF: subject  Umberto Eco predicate  is author of object  “The name of the rose” Each triple is representable graphically as two nodes (subject and object) connected by an arch (predicate). NATURAL LANGUAGE PROCESSING (NLP) (that she would rather call Natural Language Understanding) NLP has many different applications but also many different problems that need to be solved, starting from the simple recognition of the difference between a name and a verb. Basically the ideal goal is the creation of a machine , which is able to interact with us. The first chatbot ( 1965 ): Joseph Weizenbaum) at MIT creates Eliza , which poses as a psychotherapist. Word Embeddings Embeddings are geometrical entities, vectors. Each vector represents a term, in a geographical space.
  • A neural net that takes a text corpus in input and returns a set of vectors as output;
  • The vector used for describing words are called neural word embeddings ;
  • Word2Vec ( from words to vectors ) turns text into a numerical form that deep neural networks understands;
  • The purpose and utility of Word2vec is to group the vectors of similar words together in a vector space;