• Tidak ada hasil yang ditemukan

PPT Languages and Finite Automata - uqu.edu.sa

N/A
N/A
Protected

Academic year: 2024

Membagikan "PPT Languages and Finite Automata - uqu.edu.sa"

Copied!
43
0
0

Teks penuh

(1)

Undecidable Problems

(unsolvable problems)

(2)

Recall that:

A language is decidable,

if there is a Turing machine (decider) that accepts the language and

halts on every input string

A

M

A

Turing Machine Input

string

Accept

M

Decider for

A

Decision On Halt:

Decidable Languages

YES NO

(3)

A computational problem is decidable

if the corresponding language is decidable

We also say that the problem is solvable

(4)

Problem: Does DFA accept

the empty language ?

M

Corresponding Language:

} language

empty accepts

that DFA

a is :

{

M M

EMPTYDFA

X

Description of DFA as a string

M

 ) 

(

M L

(For example, we can represent as a

M

(Decidable)

(5)

Determine whether there is a path from the initial state to any accepting state

Decider for : On input : M

DFA

)

(M L

M DFA M

)

(M L

Reject M

Decision: Accept M

EMPTYDFA

(6)

Problem: Does DFA accept a finite language?

M

Corresponding Language:

} language finite

a accepts that

DFA a

is :

{

M M FINITEDFA

X (Decidable)

(7)

Decider for : On input : M

DFA M DFA M

Reject M

Decision: Accept M

Check if there is a walk with a cycle

from the initial state to an accepting state

infinite finite

FINITEDFA

(8)

Problem: Does DFA accept string ?

M

Corresponding Language:

} string

accepts that

DFA a

is :

, {

M w M w

ADFA

X

w

(Decidable)

(9)

Decider for :

On input string : ADFA

Run DFA on input string M

w

If accepts

Then accept (and halt) Else reject (and halt)

M

w

w M,

w M,

w M,

(10)

Problem: Do DFAs and

accept the same language?

M

1

Corresponding Language:

} languages same

the

accept that

DFAs are

and :

, {

M1 M2 M1 M2 EQUALDFA

X

M

2

(Decidable)

(11)

Let be the language of DFA Let be the language of DFA

L

1

L

2

) (

) (

)

( M L

1

L

2

L

1

L

2

L    

Decider for : On input : M1,M2

M

1

M

2

Construct DFA such that:

M

(combination of DFAs) EQUALDFA

(12)

 ) ( ) ( L

1

L

2

L

1

L

2

2

1

L

L

and

L

1

 L

2

 

L L  L

1

L

2

L

2

L

1

2

1

L

L  L

2

 L

1

L

2

L

1
(13)

 ) ( ) ( L

1

L

2

L

1

L

2

2

1

L

L

or

L

1

 L

2

  L

1

L

2

L

2

L

1

2

1

L

L  L

2

 L

1

2

1

L

L 

(14)

Therefore, we only need to determine whether

 ( ) ( ) )

( M L

1

L

2

L

1

L

2

L

which is a solvable problem for DFAs:

EMPTY

DFA
(15)

Undecidable Languages

there is no Turing Machine which accepts the language and makes a decision (halts) for every input string

undecidable language = not decidable language There is no decider:

(machine may make decision for some input strings)

(16)

For an undecidable language, the corresponding problem is undecidable (unsolvable):

there is no Turing Machine (Algorithm) that gives an answer (yes or no)

for every input instance

(answer may be given for some input instances)

(17)

We have shown before that there are undecidable languages:

Decidable

Turing-Acceptable

L

L

L

is Turing-Acceptable and undecidable
(18)

We will prove that two particular problems are unsolvable:

Membership problem

Halting problem

(19)

Membership Problem Input: •Turing Machine

M

•String

w

Question: Does accept ?

M w

? ) ( M L

w 

Corresponding language:

} string

accepts

that machine

Turing a

is :

, {

w M

w M ATM

(20)

Theorem:

(The membership problem is unsolvable)

Proof:

We will assume that is decidable;

We will then prove that every decidable language is Turing-Acceptable

A

TM is undecidable

A

TM

Basic idea:

(21)

Suppose that is decidable

M H

w

YES

M

accepts

w

NO

M

rejects

w A

TM

Decider for

A

TM

w M,

Input string

(22)

Let be a Turing recognizable language

L

Let be the Turing Machine that accepts

M

L

L

We will prove that is also decidable:

L

we will build a decider for

L

(23)

NO YES

M

L

s

accept

L

reject Decider for

(and halt) (and halt)

Decider for ATM

Input string

s s

M

L accepts ?s

String description of

M

L
(24)

Therefore,

L

is decidable

But there is a Turing-Acceptable language which is undecidable

Contradiction!!!!

Since is chosen arbitrarily, every

Turing-Acceptable language is decidable

L

(25)

We have shown:

Decidable

A

TM

Undecidable

(26)

We can actually show:

Decidable

A

TM

Turing-Acceptable

(27)

Turing machine that accepts :

A

TM

w M,

1. Run on input

2. If accepts then accept

M w

M w

w M,

A

TM is Turing-Acceptable
(28)

Halting Problem Input: •Turing Machine

M

•String

w

Question: Does halt while

processing input string ?

M

w

Corresponding language:

} string

input on

halts

that machine

Turing a

is :

, {

w M

w M HALTTM

(29)

Theorem:

(The halting problem is unsolvable)

Proof:

Suppose that is decidable;

we will prove that

every decidable language is also Turing-Acceptable

HALT

TM is undecidable

Basic idea:

A contradiction!

HALT

TM
(30)

M

w

YES

M

halts oninput

w

M

doesn’t halt on input

w

NO

Suppose that is decidable

HALT

TM

Decider for

HALT

TM

w M ,

Input string

(31)

Let be a Turing-Acceptable language

L

Let be the Turing Machine that accepts

M

L

L

We will prove that is also decidable:

L

we will build a decider for

L

(32)

halts and accepts

ML halts on ?s

YES NO

ML

Run

with input

M

L

reject

s

accept reject Decider for

L

s s s

Input string

Decider for HALTTM

s

ML

and halt

halts and rejects

ML

and halt

(33)

Contradiction!!!!

Therefore,

L

is decidable

But there is a Turing-Acceptable language which is undecidable

Since is chosen arbitrarily, every

Turing-Acceptable language is decidable

L

(34)

Theorem:

Proof:

Assume for contradiction that the halting problem is decidable;

(The halting problem is unsolvable)

HALT

TM is undecidable

we will obtain a contradiction

An alternative proof

Basic idea:

(35)

M H

w

YES

M

halts on

w

M

doesn’t

halt on

w

NO

Suppose that is decidable

HALT

TM

Decider

for

HALT

TM

w

M ,

Input string

(36)

H

w

M , q

0

accept

q

reject

q

Input string: YES

NO Looking inside

H

Decider for HALTTM

M

halts on ?

w

(37)

H

q

0

NO

q

a

q

b

H 

Loop forever

YES

w M ,

Construct machine :

H 

If halts on input Then Loop Forever Else Halt

M w

M

halts on ?

w

accept

q

reject

q

(38)

Construct machine :

M M, Copy

on tape

H 

F

If

M

halts on input

M

Then loop forever

M M

F

(39)

Run with input itself F

F , Copy

on tape

H 

If

F

halts on input

F

Then loops forever on input Else halts on input

F F

F

F

F F

F F

CONTRADICTION!!!

(40)

We have shown:

Decidable

Undecidable HALTTM

(41)

We can actually show:

Decidable Turing-Acceptable

HALT

TM
(42)

Turing machine that accepts :

w M,

1. Run on input 2. If halts on then accept

M w

M w

w M,

HALTTM

is Turing-Acceptable HALTTM

(43)

This Summary is an Online Content from this Book:

Michael Sipser, Introduction to the Theory of Computation, 2ndEdition

It is edited for

Computation Theory Course 6803415-3

T.Mariah Sami Khayat

by:

Teacher Assistant @ Adam University College

For Contacting:

Kingdom of Saudi Arabia Ministry of Education Umm AlQura University Adam University College Computer Science Department

ةيدوعسلا ةيبرعلا ةكلمملا ميلعتلا ةرازو ىرقلا مأ ةعماج مضأ ةيعماجلا ةيلكلا يللا بساحلا مسق

Referensi

Dokumen terkait

The measurement results based on accuracy, precision and recall show that the hybrid machine learning does not always result in better performance.. There is no better and vice

commit to user.. First, it is the translator’s language style preference. Second, there is no TL class word having the same meaning with the SL class word. There are

Zeijlstra (2004: 169, 172) further argues that the adverbial marker need not move at all and remains in vP-adjunct position in languages where there is no positive evidence of

Although teaching styles are different and there is no ‘Holy Grail’ method of teaching a foreign or second language, one can come to the assumption that, based on the outcome from the

The measurement results based on accuracy, precision and recall show that the hybrid machine learning does not always result in better performance.. There is no better and vice

“As part of every country’s drive to achieve universal health coverage, there is no better or more crucial place to start than by ensuring the Ten Steps to Successful Breastfeeding are

Currently, there are no mobile applications for people to learn Iban language thus this project is about to develop an Android mobile application called Aram Belajar Jaku Iban that