theory of computer science - post correspondence problem

4
Math- I, II, III, IV, RSA & TCS by Parmar Sir [9764546384] MU | TCS/FA | Un-decidability | Feb 2014 | Parmar Sir Page 1 Un-decidability Recursive Languages A language L over the alphabet is called recursive if it is accepted by some Turing Machine, M that accepts every word in L and reject every word in (i.e. not belonging to L) i.e. Accept (M) =L Reject (M) = Loop (M) = (No output) Example TM accepting L over that starts with “a” and reject for in all cases. So L is recursive. For recursive languages we can define algorithm. The union of two recursive languages is recursive language. The complements of recursive language is recursive Recursively Enumerable Languages A language L over the alphabet is called recursive enumerable languages if it is accepted by some Turing Machine, M that accepts every word in L and either rejects or loops for every word in i.e. Accept (M) =L Reject (M)+ Loop (M) = (No output) Example A TM accepting language and reject or loops all words not in L. So L is recursive enumerable. The universal language is recursively enumerable. [Universal Language: this language consists of strings that are interpreted as TM followed by an Input for that TM. The string is in if the TM accepts that input.] But diagonalisation language is not recursively enumerable. [Diagonalisation Language: this language is the set of strings of 0’s and 1’s that when interpreted as a TM, are in the language of that TM] For recursive enumerable languages we cannot define algorithm. The union of two recursive enumerable languages is recursive enumerable language. Accept Reject L L’ Accept L L’

Upload: karan-thakkar

Post on 07-Aug-2015

46 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Theory of Computer Science - Post Correspondence Problem

Math- I, II, III, IV, RSA & TCS by Parmar Sir [9764546384]

MU | TCS/FA | Un-decidability | Feb 2014 | Parmar Sir Page 1

Un-decidability

Recursive Languages

A language L over the alphabet is called recursive if it is

accepted by some Turing Machine, M that accepts every word

in L and reject every word in (i.e. not belonging to L)

i.e. Accept (M) =L

Reject (M) =

Loop (M) = (No output)

Example

TM accepting L over that starts with “a” and reject for in all cases. So L is recursive.

For recursive languages we can define algorithm.

The union of two recursive languages is recursive language.

The complements of recursive language is recursive

Recursively Enumerable Languages

A language L over the alphabet is called recursive

enumerable languages if it is accepted by some Turing

Machine, M that accepts every word in L and either rejects

or loops for every word in

i.e. Accept (M) =L

Reject (M)+ Loop (M) = (No output)

Example

A TM accepting language and reject or loops all words not in L. So L is recursive

enumerable.

The universal language is recursively enumerable. [Universal Language: this language

consists of strings that are interpreted as TM followed by an Input for that TM. The string is in

if the TM accepts that input.]

But diagonalisation language is not recursively enumerable. [Diagonalisation Language: this

language is the set of strings of 0’s and 1’s that when interpreted as a TM, are in the language of

that TM]

For recursive enumerable languages we cannot define algorithm.

The union of two recursive enumerable languages is recursive enumerable language.

Accept

Reject

L

L’

AcceptL

L’

Page 2: Theory of Computer Science - Post Correspondence Problem

Math- I, II, III, IV, RSA & TCS by Parmar Sir [9764546384]

MU | TCS/FA | Un-decidability | Feb 2014 | Parmar Sir Page 2

Difference between Recursive and Recursive Enumerable languages

There is a profound difference between recursive and recursively enumerable language.

If there is a regular language, we always have a FA to accept it.

Now if the string w is given, and we want to know whether w belongs to this languages, w will

run it on the FA, and within n number of steps, where , as each state will

consume one character, we will get the answer YES if w belongs to L, otherwise NO. This is

called effective decision procedure.

With TM accepting the language which is recursively enumerable and if w is executed on TM, we

are having a harder time. If then the machine will halt, otherwise we will have to wait,

perhaps for a very long time.

In the worst case if w is in loop set for this machine, we shall never get a answer.

A recursive language has the advantage that we shall at least some day get the answer, even

though we may not know how long it will take.

An interesting observation is that, not all TM’s that accept a recursive language have no loop set.

A language is recursive if at least one TM accepts it and rejects its complement. Some TM’s

which accept the same language but loops on some inputs.

Undesirability and Un-solvability

A problem whose language is recursive is said to be decidable otherwise it is un-decidable (RE

languages).

If the problem is un-decidable then there is no algorithm which take the input and find the answer

either YES or NO.

The problem “Whether a TM will halt for the given input word” is un-decidable problem

If there is a TM which, when applied to any problem in the class, always eventually terminates

with the correct (YES/NO) answer, we call the problem solvable.

If there is a TM which, when applied to any problem in the class, always eventually terminates

with the correct answer when the answer is YES and may or may not terminate when the correct

answer is NO, we call the problem semi-solvable or partially solvable.

If there is no TM which, when applied to a problem in the class, eventually with the correct

answer YES, we call the problem un-solvable.

Rice’s Theorem

Every non-trivial property of the RE (Recursive Enumerable) languages is un-decidable.

Proof

Let P be any nontrivial property of the RE languages. That means at least one language has a

property and the at least one language does not.

Page 3: Theory of Computer Science - Post Correspondence Problem

Math- I, II, III, IV, RSA & TCS by Parmar Sir [9764546384]

MU | TCS/FA | Un-decidability | Feb 2014 | Parmar Sir Page 3

Initially we will assume an empty language is not having the property P

Since P is non-trivial, there should be some language L having property P i.e. And

therefore there exists a coded TM accepting language L let this TM is

Now to prove construct a Universal Turing Machine that simulate TM, M and

The design of be given in figure, if M does not accept w, and if M

accept w.

M

M L

M’Accept

AcceptAcceptStart

x

w

Let reduce a universal language to and is un-decidable, so is also un-decidable (by

reduction theorem).

The Turing machine can be produced on reduction. For the reduction algorithm the pair (M,

w) can be given input.

is a two tape TM.

One tape is used to simulate M on input w. then input is used for designing the transitions

of

Second tape is used to simulate on input x. again the pair is used for designing the

transitions of

The TM, is constructed to do the following things-

1. Simulate M on input w. note that w is not the input to ; rather writes M and w onto one

of its tapes and simulate the Universal Turing Machine on this pair.

2. If M does not accept w, then does nothing else. never accepts its own input, x so

. Since we assume is not in property P, that means the code for is not in

3. If M accepts w, then begins simulating on its own input x. Thus, will accept

exactly the language L. since L is in P, the code for is in P.

Since constructing from M and w can be carried out by an algorithm. Since this algorithm

turns (M, w) into an that is in if and only if (M, w) is in , this reduction of to ,

and hence proves that the property P is un-decidable.

Now another possibility when is in P.

If so, consider the complements property of P i.e. , the set of RE languages that do not have

property P.

Page 4: Theory of Computer Science - Post Correspondence Problem

Math- I, II, III, IV, RSA & TCS by Parmar Sir [9764546384]

MU | TCS/FA | Un-decidability | Feb 2014 | Parmar Sir Page 4

By the foregoing, is un-decidable. However, since every TM accepts an RE language, , the

set of (codes for) Turing machines that do not accept a languages in P is the same as , the set

of TM’s that accepts a language in .

Suppose were decidable, then so would be is decidable. since the complement of a

recursive language is recursive.

Post Correspondence Problem

Post’s correspondence Problem (PCP) was first introduced by Emil Post in 1946. Later, the

problem was found to have many applications in the theory of formal languages.

PCP is uses to check un-decidability of strings, (another way to check by Turing machine)

PCP define as

“the post’s correspondence problem consists of two lists of strings that are of equal length over

the input .

The two lists are and then there exists a non empty set

of integers such that ”

Another way we can say “The PCP is to determine whether or not there exist ,

where , such that

To solve the PCP, we try to find all combinations of to find the , then we say

that PCP has a solution.

PCP is un-decidable.

Example:

Does the PCP with two lists and have a solution?

Answer:

We have to find out such a sequence that strings formed by x and y are identical.

Such sequences are 2, 1, 1, and 3.

Hence from x and y list equal

2 1 1 3 2 1 1 3

= (combined and see)

Which forms thus PCP has a solution.

........................................................................................................................................................

Theorem: It is Un-decidable a CFG is ambiguous.

Proof: