Computation. Binary Numbers Decimal numbers Binary numbers.

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

CS 345: Chapter 9 Algorithmic Universality and Its Robustness
The Big Picture Chapter 3. We want to examine a given computational problem and see how difficult it is. Then we need to compare problems Problems appear.
1 The Limits of Computation Intractable and Non-computable functions.
Computation.
Easy, Hard, and Impossible. Easy Tic Tac Toe Hard.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
CHAPTER 3 The Church-Turing Thesis
Analysis of Algorithms CS 477/677
Computability and Complexity 10-1 Computability and Complexity Andrei Bulatov Gödel’s Incompleteness Theorem.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
Boolean Logic Chapter 4 (Sections 4.1 and 4.2). The Roots: Logic 1848 George Boole The Calculus of Logic chocolate and  nuts and mint.
Introduction to Computer Science. A Quick Puzzle Well-Formed Formula  any formula that is structurally correct  may be meaningless Axiom  A statement.
04/25/13 Halting Problem Discrete Structures (CS 173) Derek Hoiem, University of Illinois 1
Universal Turing Machine
Definition: Let M be a deterministic Turing Machine that halts on all inputs. Space Complexity of M is the function f:N  N, where f(n) is the maximum.
Computability and Modeling Computation What are some really impressive things that computers can do? –Land the space shuttle (and other aircraft) from.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Review Byron Gao. Overview Theory of computation: central areas: Automata, Computability, Complexity Computability: Is the problem solvable? –solvable.
The Power and the Limits of Computation Elaine Rich.
Decidability of Languages That Do Not Ask Questions about Turing Machines Chapter 22.
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
Institute for Experimental Physics University of Vienna Institute for Quantum Optics and Quantum Information Austrian Academy of Sciences Undecidability.
Easy, Hard, and Impossible Elaine Rich. Easy Tic Tac Toe.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
Computation. Binary Numbers Decimal numbers Binary numbers.
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
Lecture 18. Unsolvability Before the 1930’s, mathematics was not like today. Then people believed that “everything true must be provable”. (More formally,
Course Overview and Road Map Computability and Logic.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Artificial Intelligence: Introduction Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
1 Theory: Models of Computation  Readings:  Chapter 11 & Chapter 3.6 of [SG]  Content:  What is a Model  Model of Computation  Model of a Computing.
Overview.  Explores the theoretical foundations of computing  What can and cannot be done by an algorithm  Most of the material predates computers!
Great Theoretical Ideas in Computer Science.
Great Theoretical Ideas in Computer Science.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
Computation Motivating questions: What does “computation” mean? What are the similarities and differences between computation in computers and in natural.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Easy, Hard, and Impossible Elaine Rich. Easy Tic Tac Toe.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
CSE 311: Foundations of Computing Fall 2014 Lecture 27: Cardinality.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
The Church-Turing Thesis Chapter 18. Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve: ●
1 Introduction to Turing Machines
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis (Winter 2016, these slides were also used for Day 33)
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
Decidability.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis Delayed due dates for HWs See updated schedule page. No class meeting.
Fall 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
CSE 311 Foundations of Computing I
Ch. 11 Theory of Computation
Great Theoretical Ideas in Computer Science
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
CSCE 411 Design and Analysis of Algorithms
How Hard Can It Be?.
Recall last lecture and Nondeterministic TMs
Class 24: Computability Halting Problems Hockey Team Logo
CO Games Development 2 Week 21 Turing Machines & Computability
Variations: Multiple tracks Multiple tapes Non-deterministic
Presentation transcript:

Computation

Binary Numbers Decimal numbers Binary numbers

Representing Text Decide how many characters we need to represent. Determine the required number of bits. Ascii: 7 bits. Can encode 2 7 = 128 different symbols.

Ascii

Representing Text Four …

When We Need More Characters 简体字 What about things like:

When We Need More Characters Answer: Unicode: 32 bits. Over 4 million characters. 简体字 What about things like:

Digital Images

RGB The red channel

RGB The green channel

RGB Red GreenBlue

Representing Pictures

Representing Sounds

Representing Programs public static TreeMap create() throws IOException { Integer freq; String word; TreeMap result = new TreeMap (); JFileChooser c = new JFileChooser(); int retval = c.showOpenDialog(null); if (retval == JFileChooser.APPROVE_OPTION) { Scanner s = new Scanner( c.getSelectedFile()); while( s.hasNext() ) { word = s.next().toLowerCase(); freq = result.get(word); result.put(word, (freq == null ? 1 : freq + 1)); } return result; }

The Roots of Modern Technology 5 th c B.C. Aristotelian logic invented 1642 Pascal built an adding machine 1694 Leibnitz reckoning machine

The Roots, continued 1834 Charles Babbage’s Analytical Engine Ada writes of the engine, “The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform.” The picture is of a model built in the late 1800s by Babbage’s son from Babbage’s drawings.

The Roots: Logic 1848 George Boole The Calculus of Logic chocolate nuts mint chocolate and  nuts and mint

Boolean Logic PQ PPP  QP  QP  QP  QP  QP  QP  Q True FalseTrue False TrueFalse True FalseTrueFalse TrueFalse True

Using Boolean Logic PQ PPP  QP  QP  Q(P  Q)  Q  P  ((P  Q)  Q) True FalseTrue False TrueFalse TrueFalse True False TrueFalseTrue

How Big Are the Truth Tables? PQR True False TrueFalseTrue False True FalseTrueFalse True False

2n2n

Increased Power of Quantified Logic TaiShanHasTail SmokyHasTail PuffyHasTail ChumpyHasTail SnowflakeHasTail

Increased Power of Quantified Logic Panda(TaiShan). Bear(Smoky).  x (Panda(x)  Bear(x, Tail)).  x (Bear(x)  HasPart(x)).  x (Bear(x)  Animal(x)).  x (Animal(x)  Bear(x)).  x (Animal(x)   y (Mother-of(y, x))).  x ((Animal(x)   Dead(x))  Alive(x)).

Using Quantified Logic (FOL) We can represent what we know as a set of logical formulas and then manipulate them.

Using Quantified Logic Panda(TaiShan). Bear(Smoky).  x (Panda(x)  Bear(x, Tail)).  x (Bear(x)  HasPart(x, Tail)).  x (Bear(x)  Animal(x)).  x (Animal(x)   y (Mother-of(y, x))).  x ((Animal(x)   Dead(x))  Alive(x)).

Search

Breadth-First Search Is this a good idea?

Depth-First Search

Scalability Solving hard problems requires search in a large space. To play master-level chess requires searching about 8 ply deep. So about 35 8 or 2  nodes must be examined.

Growth Rates of Functions

Scalability To play one master-level game 2  nodes Seconds since Big Bang 3  Number of sequential games since Big Bang 150,000

The Advent of the Computer 1945 ENIAC The first electronic digital computer

1949 EDVAC The first stored program computer

Programs Are Just Strings (Bits) public static TreeMap create() throws IOException { Integer freq; String word; TreeMap result = new TreeMap (); JFileChooser c = new JFileChooser(); int retval = c.showOpenDialog(null); if (retval == JFileChooser.APPROVE_OPTION) { Scanner s = new Scanner( c.getSelectedFile()); while( s.hasNext() ) { word = s.next().toLowerCase(); freq = result.get(word); result.put(word, (freq == null ? 1 : freq + 1)); } return result; }

Moore’s Law

How It Has Happened

How Much Computer Power Might It Take?

How Much Compute Power is There? From Hans Moravec, Robot Mere Machine to Transcendent Mind 1998.

Kurweil’s Vision match-humans-by-2030.phtml

Limits to What We Can Compute Are there fundamentally uncomputable things? Does God exist? What’s the best way to run a country? Does this puzzle have a solution?

Mathematics in the Early 20 th Century 1900 Hilbert’s program and the effort to formalize mathematics 1931 Kurt Gödel’s paper, On Formally Undecidable Propositions 1937 Alan Turing’s paper, On Computable Numbers with an application to the Entscheidungs problem

What Can We Do? 1.Can we make all true statements theorems? 2.Can we decide whether a statement is a theorem?

Gödel’s Incompleteness Theorem Kurt Gödel showed, in the proof of his Incompleteness Theorem [Gödel 1931], that the answer to question 1 is no. In particular, he showed that there exists no decidable axiomatization of Peano arithmetic that is both consistent and complete.

The Entscheidungsproblem Does there exist an algorithm to decide, given an arbitrary sentence w in first order logic, whether w is valid (i.e.,must be true)?

Turing Machines At each step, the machine must: ● choose its next state, ● write on the current square, and ● move left or right.

An Example

The Church-Turing Thesis Turing machines Lambda calculus Standard programming languages like Java Conway’s game of life DNA computing All formalisms powerful enough to describe everything we think of as a computational algorithm are equivalent.

The Game of Life Playing the game The rules: ● A dead cell with exactly three live neighbors becomes a live cell (birth). ● A live cell with two or three live neighbors stays alive (survival). ● In all other cases, a cell dies or remains dead (overcrowding or loneliness). A game halts iff it reaches some stable configuration.

Back to the Entscheidungsproblem 1.Given a Turing machine M, we can construct a logical formula F that is true iff M ever halts. 2.If there were a solution to the Entscheidungsproblem, then we could determine the truth of F and thus be able to decide whether M ever halts. 3.But there is no procedure for determining (in the general case) whether M halts. 4.So there is no solution to the Entscheidungsproblem. Theorem: The Entscheidungsproblem is unsolvable. Proof: (A variant of Turing’s proof)

The Halting Problem Turing machine, M input string, w Does M halt on w? Accept Reject

An Example of a Similar Question Does this program halt on all inputs? times3(x: positive integer) = While x  1 do: If x is even then x = x/2. Else x = 3x + 1. Let’s try it.

The Halting Problem Is Undecidable Proof: If it were decidable, then some TM M H would decide it. M H would implement the specification: halts( ) = If is a Turing machine description and M halts on input w then accept. Else reject.

Trouble Trouble(x: string) = if halts(x, x) then loop forever, else halt. What is Trouble( )? What is halts( )? ● If halts reports that Trouble( ) halts, Trouble ________. ● If halts reports that Trouble( ) does not halt, Trouble __________.

Another Undecidable Problem The Post Correspondence Problem

A PCP Instance With a Simple Solution iXY 1 baab 2 abbb 3 abaa 4 baaababa

A PCP Instance With a Simple Solution iXY 1 baab 2 abbb 3 abaa 4 baaababa Solution: 3, 4, 1

Another PCP Instance iXY

A PCP Instance With No Simple Solution iXY

A PCP Instance With No Simple Solution iXY Shortest solution has length 252.

A Tiling Problem Given a finite set T of tiles of the form: Is it possible to tile an arbitrary surface in the plane?

A Set of Tiles That Cannot Tile the Plane

Is the Tiling Problem Decidable? Wang’s conjecture: If a given set of tiles can be used to tile an arbitrary surface, then it can always do so periodically. In other words, there must exist a finite area that can be tiled and then repeated infinitely often to cover any desired surface. But Wang’s conjecture is false.

The Implications The Entscheidungs problem is undecidable. There’s no black box reasoning engine for FOL. Would quantum computing change the picture? Does undecidability doom our attempt to make artificial copies of ourselves?

Is Decidability Enough?

Boolean Logic, Again PQ PPP  QP  QP  Q(P  Q)  Q  P  ((P  Q)  Q) True FalseTrue False TrueFalse TrueFalse True False TrueFalseTrue How many steps would it take a deterministic Turing machine to examine this table?

Nondeterminism P is True P is False Q is True Q is False

Nondeterministically Deciding SAT PQ PPP  QP  QP  Q(P  Q)  Q  P  ((P  Q)  Q) True FalseTrue False TrueFalse TrueFalse True False TrueFalseTrue How many steps in a single path of the process of examining this table?

P and NP P – problems that are solvable deterministically in polynomial time. NP – problems that are solvable nondeterministically in polynomial time.

The Traveling Salesman Problem Given n cities and the distances between each pair of them, find the shortest tour that returns to its starting point and visits each other city exactly once along the way

The Traveling Salesman Problem Given n cities: Choose a first cityn Choose a secondn-1 Choose a thirdn-2 … n!

The Traveling Salesman Problem Can we do better than n! ● First city doesn’t matter. ● Order doesn’t matter. So we get (n-1!)/2.

The Growth Rate of n!  10 41

The Traveling Salesman Problem

Solving it Nondeterministically First, we change the problem slightly. New problem: Given a value n, is there a tour of length less than n?

SAT and Traveling Salesman DND SAT2n2n n Traveling Salesmann!n!n

Growth Rates of Functions, Again

P and NP P – problems that are solvable deterministically in polynomial time. NP – problems that are solvable nondeterministically in polynomial time. NP-complete – NP problems that are at least as hard as every other NP-complete problem.

Does Complexity Doom AI?