Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Turing Machines and the Halting Problem, Slides of Artificial Intelligence

Turing machines, a fundamental concept in computer science developed by alan turing in the 1930s. Turing machines consist of a control unit with a read/write head that can read and write symbols on an infinite tape. The importance of turing machines, the halting problem, and an attempt to construct a program to solve the halting problem, which leads to a contradiction. The document also covers problem-solving basics and introduces decision trees and game trees.

Typology: Slides

2012/2013

Uploaded on 04/24/2013

banani
banani 🇮🇳

4.3

(3)

91 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
CSCI 100
Think Like Computers
Lecture 4
Fall 2008
Turing Machines
Alan Turing developed the concept of a
computing machine in the 1930s
A Turing machine, as his model became
known, consists of a control unit with a
read/write head that can read and write
symbols on an infinite tape
Turing Machines
Why is such a simple
machine (model) of any
importance?
It is widely accepted that
anything that is intuitively
computable can be computed
by a Turing machine
If we can find a problem for
which a Turing-machine
solution can be proven not to
exist, then the problem must
be unsolvable
Turing machine processing
Halting Problem
It is not always obvious that a computation
(program) halts
The Halting problem: Given a program
and an input to the program, determine if
the program will eventually stop with this
input
This problem is unsolvable
Halting Problem
Assume that there exists a Turing-machine
program, called SolvesHaltingProblem that
determines for any program Example and input
SampleData whether program Example halts
given input SampleData
Proposed program for solving the Halting problem
Halting Problem
The intuition: such a program might have a
hard time checking itself.
We can construct a program that leads to
a contradiction in much the same way as
does the phrase: “This sentence is a lie”.
Docsity.com
pf3
pf4

Partial preview of the text

Download Turing Machines and the Halting Problem and more Slides Artificial Intelligence in PDF only on Docsity!

CSCI 100

Think Like Computers

Lecture 4

Fall 2008

Turing Machines

  • Alan Turing developed the concept of a

computing machine in the 1930s

  • A Turing machine, as his model became

known, consists of a control unit with a

read/write head that can read and write

symbols on an infinite tape

Turing Machines

  • Why is such a simple

machine (model) of any

importance?

Š It is widely accepted that anything that is intuitively computable can be computed by a Turing machine Š If we can find a problem for which a Turing-machine solution can be proven not to exist, then the problem must be unsolvable Turing machine processing

Halting Problem

  • It is not always obvious that a computation

(program) halts

  • The Halting problem: Given a program

and an input to the program, determine if

the program will eventually stop with this

input

  • This problem is unsolvable

Halting Problem

  • Assume that there exists a Turing-machine

program, called SolvesHaltingProblem that determines for any program Example and input SampleData whether program Example halts given input SampleData

Proposed program for solving the Halting problem

Halting Problem

  • The intuition: such a program might have a

hard time checking itself.

  • We can construct a program that leads to

a contradiction in much the same way as

does the phrase: “This sentence is a lie”.

Halting Problem

Proposed program for solving the Halting problem

Halting Problem

  • Now let’s construct a new program, NewProgram, that

takes program Example as both program and data.

Š It uses the algorithm from SolvesHaltingProblem , such that: Š NewProgram writes “Halts” if Example loops, and Š NewProgram goes into an infinite loop if Example halts

  • Let’s now apply program SolvesHaltingProblem to

NewProgram, using NewProgram as data:

Š If SolvesHaltingProblem prints “Halts”, program NewProgram goes into an infinite loop Š If SolvesHaltingProblem prints “Loops”, program NewProgram prints “Halts” and stops Š In either case, SolvesHaltingProblem gives the wrong answer

Halting Problem

Construction of NewProgram

Solving Problems

  • What is a problem?
  • How do we represent information (data)?
  • How do we represent the answer?
  • How do we get the answer from the

information?

Exercise 1

  • The number guessing game:
  • Suppose I have a number in the 1..

range

  • Ask any questions, but I can only give

yes/no answer

Decision trees

  • A decision tree takes as input a situation described by a set of attributes and returns a yes/no “decision”. (represents a boolean function).

What about Chess?

• In principle, the same idea

• But …

Š A lot bigger, deeper tree!

Š Need a lot of optimizations

Š AND empirical values (for utility estimation)

Evaluating chess states

In chess, evaluation function might be based on

• Material : pawn=1, bishop=3, knight=3, rook=5,

queen=

• Position : (1) pawns on final rank, (2) check next

move (3) fork next move etc.

• Weighted linear evaluation function

e = w 1 f 1 + w 2 f 2 + ... + w n f n

where f is some feature and w is a weighting that biases

the contribution of that feature to the final score.