Computational Thinking MASTER IN DIGITAL HUMANITIES 9 December 2016 Teresa Scantamburlo DAIS and ECLT Ca Foscari University
Thinking as a computational process Thinking can be usefully understood as a computational process What does this conjecture amount to? Not that the brain is something like an electronic computer Thinking as a form of symbol processing that can be carried out purely mechanically without having to know what the symbols stand for
All computation? So much of our thinking seems to have very little to do with calculations Example: I know my keys are in my coat pocket or on the fridge. That s where I always leave them. I felt in my coat pocket, and there s noting there. So my keys must be on the fridge, and that s where I should look This example seems to have nothing to do with numbers and calculation
Thinking and computation Thinking is about something (e.g., keys, coat pocket, refrigerator, etc.) Computation seems to be about nothing. It is the process of manipulating symbols in a mechanical way There is a conceptual gap between the two that need to be bridged This work has much to do with philosophy!
Gottfried Leibniz He envisioned a special alphabet (characteristica universalis), a system of symbols whose elements represented a welldefined idea His idea: Thought ca be reduced to a manipulation of symbols (calculus ratiocinatur) It will in fact suffice to take pen in hand and to say: let us calculate
Propositions vs. sentences What about ideas and objects of ordinary thought? Examples: My keys are in my coat pocket Dinosaurs were warm-blooded Life expectancy in the USA declined for the first time since 1993 Sentence à sequence of words Proposition à the idea expressed
Propositions What can be said about propositions? Propositions are considered to hold or to not hold. A sentence is true if the propositions it expresses holds, and false if that proposition does not hold Propositions are considered to be related to people in certain ways: people may or may not believe them, fear them, etc. (propositional attitude) Propositions are related to each other in certain ways: a proposition may imply or contradict another one, etc.
Example Consider this: The snark was a boojum (The hunting of the Snark, L. Caroll) If we assume that the sentence is true, even without knowing what the words snark and boojum mean, we can answer certain questions: What kind of think was the snark? It was a boojum Is it true that the snark was either a beejum or a boojum? Yes, because it was a boojum What is an example of something that was a boojum? The snark, of course
Other examples My keys are in my coat pocket or on the fridge Noting is in my coat pocket So: My keys are on the fridge Henry is in the basement or in the garden Nobody is in the basement So: Henry is in the garden The frumble is frimble or framble Nothing is frimble So: The frumble is framble Again, one does not need to know what frimble means! What does matter is the form of the sentence
Logical entailment A collection of sentences S 1, S 2,, S n logically entails another sentence S if the truth of S is implicit in the truth of S i sentences In determining if a collection of sentences logically entails another, it is not necessary to know what the terms in those sentences mean (certain keywords in sentence, such as and, do have specific functions) Example: The snark was a boojum Logically entails Something was a boojum My keys are in my coat pocket or on the fridge Noting is in my coat pocket Logically entails My keys are on the fridge
Using what is known Thinking seems to be much richer than logical entailments Positive aspects: with logical entailments we can extract knowledge from what is already known It might be helpful to visualize sentences as forming a kind of network with nodes for each terms and links between them according to the sentences in which they appear.
Example
Assignment 3 Try to represent the sentences in the example as a network (using at least 5 sentences) Consider the sentence George is a bachelor and find out some logical entailments
Web of belief
Some logical entailments George has never been the groom at wedding Mary has an unmarried son born in Boston No woman is the wife of any of Fred s children
Turing s model of computation Turing s model resulted from the analysis of the possible processes a human can go through while performing a calculation using paper and pencil applying rules from a given finite set. Note that the rules are followed blindly, without using insight or ingenuity
The analysis of a computation process By observing a human doing calculi, Turing ends up with a series of constrains: Only a finite number of symbols can be written down and used in any computation There is a fixed bound on the amount of scratch paper that a human can consider at a time At any time symbols can be written down or erased Current state of mind along with the last symbol written determine what to do next
Example 4231 x 77 = 29617 29617 325787 4 2 3 1 X 7 7 = 2 9 6 1 7 + 2 9 6 1 7 = 3 2 5 7 8 7
Turing machine A Turing machine consists of: An unbounded tape divided into squares, each of which can hold exactly one symbol A tape head for reading and writing symbols from a given alphabet on the squares A controller which is in exactly one of finitely many states at any given time
Turing s main result From Turing analysis we derive a strong notion of computation: Anything computable by an algorithmic process can be computed by a Turing machine Therefore, if we prove that some task cannot be accomplished by a Turing machine, we can conclude that no algorithmic process can accomplish that task
Formulas in Turing machine Assume, for example, the statement: When the machine is in state R scanning the symbol a it will replace a by b, move one square to the right, and then shift into state S. Can be expressed as follows (quintuples): R a : b à S Analogous statements: R a : b ß S R a : b S
Testing a Turing machine Problem: Given natural number to see whether it is even or odd Number written on the tape (input): No limit to the amount of tape available Special symbol (blank square) for termination As the machine terminates squares will be all blank except for one (that will be 0 if the input was even, 1 it was odd) 4 states: Ø Q = starting state (from the leftmost square) Ø E, O = states resulting from scanning numbers, E (even), O (odd) Ø F = final state
Set of quintuples
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Output Note that: Unlike physical devices, Turing machines being a mathematical abstraction has no limitations on the amount of tape they can use. But this might have some problems
Halting problem For example, consider the Turing machine consisting of these 2 quintuples: Q 1 : 1 à Q Q 2 : 2 ß Q Input: 1 2 Some Turing machines with some inputs eventually halt, others do not. This reasoning led Turing to the conclusion that some problems cannot be solved by Turing machines...
Some conclusions In summary for Some Turing machines with some inputs eventually halt, others do not. This reasoning led Turing to the conclusion that some problems cannot be solved by Turing machines and to the unsolvability of Hilbert s problem (decision problem)
Some references M. Davis, The Universal Computer: The Road from Leibniz to Turing, Norton & Company, 2000 H. Levesque, Thinking as Computation, 2012 IMT Press