560 likes | 731 Views
Artificial Intelligence and Computing Science. OCTOBER 10, 2014. Two Kinds of Reasoning:. Algorithmic and Heuristic. Muhammad ibn Musa al-Khwarizmi Persian mathematician, 780-850 Scholar at the House of Wisdom, Baghdad. Invented (and gave his name to) algebra and the algorithm.
E N D
Artificial Intelligenceand Computing Science OCTOBER 10, 2014
Two Kinds of Reasoning: Algorithmic and Heuristic
Muhammad ibn Musa al-Khwarizmi Persian mathematician, 780-850 Scholar at the House of Wisdom, Baghdad Invented (and gave his name to) algebra and the algorithm
``What must be the square, which, when increased by ten of its own roots, amounts to thirty nine?’’ x2 + 10x = 39 ``You halve the number of the roots, which in the present instance yields five. This you multiply by itself; the product is twenty-five. Add this to thirty-nine; the sum is sixty four. Now take the root of this, which is eight and subtract from it half the number of the roots, which is five; the remainder is three. This is the root of the square which you sought for; the square itself is nine.’’ x=√(10/2)2+39-10/2 = √64-5 = 3
Characteristics of Algorithmic Reasoning: If you don’t make a mistake, you’re guaranteed to get an answer… But there’s no guarantee of how quickly…
Consider, for example, the Travelling Salesman problem: Visit n cities, once each Finish where you started
One algorithm you might use: • Generate all possible routes (n!) • MaxCost = $bignum • For i = 1 to n! • Is cost(i) < MaxCost? • If yes: • MaxCost = cost(i); • BestRoute = i; • Next i
This works OK for small n, but not so well for n = 49, say… because the number of steps is then greater than the number of atoms in the universe
n! grows faster than Anmwhatever values you choose for A and m So the class of problems that can be solved in Anm is a relatively nice class, called `P’.
Suppose we learn the answer to a problem by consulting an oracle… It may be possible to verify the solution in polynomial time, even if we can’t find it in polynomial time. For example, Does any subset of the numbers {a1, a2, a3, …, an} add up to 0? Given a candidate set {a2=1, a5=2, a27 = 4, a1952 = -5}, we can easily verify that this is a solution. Problems like this are in the set `NP’
Is P = NP? No-one knows. But if any NP problem is P, then all NP problems are P
Heuristic Reasoning No `recipe’ for solving the problem:
Cannibals and Missionaries C C C M M M
A.I.’s Goal: To make machines that think like us. 1: Formalise the way we think 2: Whatever can be formalised can be mechanised.
To formalise a method is to reduce it to a chain of steps that even a stupid person could follow. Therefore, to know that we’ve formalised an argument correctly, we need an ideally stupid person.
Aristotle, 384-322 BC Developed a set of formal procedures -- the syllogism -- to capture the essence of rational thought: All cats are mammals Some cats have no tails Some mammals have no tails
However, the syllogism fails to capture some common modes of reasoning. For example: ``A horse is an animal, Therefore, the head of a horse is the head of an animal’’ is a valid argument which can’t readily be represented as a syllogism.
The Characteristica Universalis of Leibniz "It is obvious that if we could find characters or signs suited for expressing all our thoughts as clearly and as exactly as arithmetic expresses numbers or geometry expresses lines, we could do in all matters insofar as they are subject to reasoning all that we can do in arithmetic and geometry. For all investigations which depend on reasoning would be carried out by transposing these characters and by a species of calculus." (Preface to the General Science, 1677.)
1834: Charles Babbage invents the Analytical Engine, programmed with punched cards
1842: Ada Lovelace writes the first computer program. (To calculate the Bernoulli numbers)
1854: George Boole publishes ``An Investigation of The Laws of Thought’’ Shannon will later show how Boole’s logic can be implemented using digital circuitry.
Boole’s idea Any proposition attributing a predicate to a subject can be re-phrased as a statement about membership in a class. For example, ``Kant is boring’’ can be expressed as: ``Kant is a member of the class of boring things”
Denote the property of membership in a particular class by a symbol, x, for example. Membership in two classes can then be expressed as the product of their respective symbols: Let x denote membership in the class of boring things And y, membership in the class of long-winded things. Then ``Kant is boring and long-winded’’ can be written as `xy’
Repeating a symbol doesn’t accomplish anything: if we select the boring members of the class of boring things, we just get back the same class. This gives us the equation: x2=x (``Kant is boring and boring’’ just tells us Kant is boring) But the only values of x satisfying this are 0 and 1 So these are the only numbers used in Boolean logic
So logical statements can be translated to arithmetic operations: A x B y A and B x × y The operation `×’ behaves like the word `and’ 1 0 0 0 T T F F 1 1 0 0 T F T F 1 0 1 0 T F F F
Samuel Butler, Erewhon, 1871 ``…there is no a priori improbability in the descent of conscious (and more than conscious) machines from those which now exist,…’’ Erewhon’s `The Book of the Machines’
``The present machines are to the future as the early Saurians to man. The largest of them will probably greatly diminish in size. Some of the lowest vertebrates attained a much greater bulk than has descended to their more highly organised living representatives, and in like manner a diminution in the size of machines has often attended their development and progress.’’ Erewhon’s `The Book of the Machines’
``I fear… the extraordinary rapidity with which they are becoming something very different to what they are at present. No class of beings have in any time past made so rapid a movement forward. Should not that movement be jealously watched, and checked while we can still check it? And is it not necessary for this end to destroy the more advanced of the machines which are in use at present..?’’ Erewhon’s `The Book of the Machines’
Gottlob Frege, 1879 Introduced the predicate calculus, also known as `second-order logic’ Showed that this more powerful logic could be used as a basis for mathematics. A formal language, or `concept script’ based on this logic could also be used to reason about the sciences and philosophy.
Predicate calculus deals with parts of sentences E.g., ``…. is intelligent.’’ These can be combined with the symbols E `There exists’ A `For all’
Thus we can define, for example, F(x) = ``x is intelligent.’’ And go on to write: (x):F(x) E `There exists an intelligent person’ (x):F(x) `Everyone is intelligent’ A
Let F(x) = ``x is a moon of Mars’’ Then the formula: says: `Something (x) is a moon of Mars, and something else (y) is also a moon of Mars, and if anything else (z) is a moon of Mars, then either z is x or z is y’
This allows us to say ``Mars has two moons’ without using any numerals explicitly. In the same way, Frege proposes to reduce all of mathematics to logic. Then we are guaranteed that mathematics is consistent as long as logic is consistent.
The Turing Machine A complete abstract description of the perfectly stupid slave
The ELIZA Effect Joseph Weizenbaum, MIT, 1966 Patient: ``I went for a long boat ride’’ Therapist: ``Tell me about boats.’’
AI in the 40’s, 50’s and 60’s: Arthur Samuel, Checker-playing program, 1947-1967 Games and Puzzles 2. C.E. Shannon, `Programming a Computer For Playing Chess’, Philosophy Magazine, Vol. 41, pp. 256-275 (1960)
How does a computer play chess (or checkers?) Create a tree: Current position My next move P-K4 P-Q4 P-K3 Position before Kasparov’s next move Kasparov’s next move
Position before my next move My next move Position before Kasparov’s next move . . . . . . . . . Kasparov’s next move Position after Kasparov’s final move I WIN I LOSE I WIN (This can all be done by deduction)
Now move back up the tree, using the minimax strategy: ``Assuming that Kasparov will choose the move to his maximum advantage, I should choose the move that minimizes my disadvantage:’’ Position after my penultimate move I WIN I LOSE I WIN I WIN I WIN I LOSE I WIN Position after Kasparov’s final move
Position after Kasparov’s penultimate move (assume he will chose red node) I WIN I LOSE My penultimate move Position after my penultimate move I WIN I LOSE Kasparov’s final move I WIN I WIN I WIN I LOSE I WIN Position after Kasparov’s final move