theory of computation / post’s correspondence problems (pcp)

43
PREPARED FOR: Dr. Gede Pramudya Ananta PREPARED BY: THAMER J.ABBAS M031020009 SAIF MOHAMMED MAKKI M031020010 SAIF ZUHAIR ABDULMAJEED M031110012

Upload: technical-advisor-at-iraqi-government

Post on 27-Jun-2015

1.567 views

Category:

Entertainment & Humor


3 download

TRANSCRIPT

Page 1: Theory of computation / Post’s Correspondence Problems (PCP)

PREPARED FOR:

Dr. Gede Pramudya Ananta

PREPARED BY:

THAMER J.ABBAS M031020009

SAIF MOHAMMED MAKKI M031020010

SAIF ZUHAIR ABDULMAJEED M031110012

Page 2: Theory of computation / Post’s Correspondence Problems (PCP)

Turing machines

a device with a finite amount of read-only “hard” memory (states), and an unbounded amount of read/write tape-memory

The output depends only on input and the previous output Black box reads a

sequence of 0’s and 1’s

The main thing is ???? That the changes from one output state to the next Given by definite rules, called the TRANSITION rules

Page 3: Theory of computation / Post’s Correspondence Problems (PCP)

ReducibilityDefinition Primary method for Proving that problems are

computationally unsolvable.

Reducibility also occurs in mathematical problems .

A Reduction : is a way of converting one problem to another problem in such a way that a solution to the second problem can be used to solve the first problem. Such reducibilities come up often in everyday life, even if we don't usually refer to them in this.

Page 4: Theory of computation / Post’s Correspondence Problems (PCP)

EXAMPLE: use problem B to solve problem A

CAN'T TAKE IT DIRECT.. XX

A

B

Page 5: Theory of computation / Post’s Correspondence Problems (PCP)

Recall that:A language A is decidable, if there is a Turing

machine M (decider) that accepts the language

A and halts on every input string.

Turing Machine

Inputstring

Accept

RejectDecider for

YES

NO

M

A

DecisionOn Halt:

DECIDABLE

Page 6: Theory of computation / Post’s Correspondence Problems (PCP)

UNDECIDABLE

• Undecidable problems have no algorithm, regardless of whether or not they are accepted by a TM that fails to halt on some inputs

• Undecidability: undecidable languages that cannot be decided by any Turing Machine

Page 7: Theory of computation / Post’s Correspondence Problems (PCP)

Example for: Decidable And Undecidable

Assume, we have a program which assigns all possible combination of 3 integers to variables x, y and z. For the first case there is at least one solution (x = 2, y = 1, z =5). Thus, the program will eventually stops. But for the second case we don’t know if this system has a solution. If there is no solution for the second system, then the program never stops.

x = 2

y = 1

z =5

Page 8: Theory of computation / Post’s Correspondence Problems (PCP)

Examples: Halting Problem

halts(“2+2”) Truehalts(“def f(n): if n==0: return 1

else: return n * f(n-1) f(5)”) Truehalts(“def f(n): if n==0: return 1

else: return n * f(n-1) f(5.5)”) false

Page 9: Theory of computation / Post’s Correspondence Problems (PCP)

X2 + Y2 + Z2 = A2 + B2

10 11 12 13 14

= 365 365

6 7 8 9 10

149 ≠ 182

Page 10: Theory of computation / Post’s Correspondence Problems (PCP)

Post’s Correspondence Problems (PCP)

Definition An instance of PCP consists of two lists of strings

over some alphabet S.The two lists are of equal length, denoted as A and

B.The instance is denoted as (A, B).

We write them as

A = w1, w2, …, wk

B = x1, x2, …, xk for some integer k.

For each i, the pair (wi, xi) is said a corresponding

pair.

Page 11: Theory of computation / Post’s Correspondence Problems (PCP)

PCP Instances

An instance of PCP is a list of pairs

of nonempty strings over some

alphabet Σ

Say (w1, x1), (w2, x2), …, (wn, xn).

The answer to this instance of PCP

is “yes” if and only if there exists a

nonempty sequence of indices i1,

…,ik, such that wi1…win = xi1…xin.

Page 12: Theory of computation / Post’s Correspondence Problems (PCP)

Post’s Correspondence Problem

(PCP) is an example of a problem that does not mention TM’s in its statement, yet is undecidable.

From PCP, we can prove many other non-TM problems undecidable.

Page 13: Theory of computation / Post’s Correspondence Problems (PCP)

Example: PCP

• Let the alphabet be {0, 1}.

• Let the PCP instance consist of the two

pairs (0, 01) and (100, 001).

• We claim there is no solution.

• You can’t start with (100, 001), because the

first characters don’t match.

Page 14: Theory of computation / Post’s Correspondence Problems (PCP)

Example: PCP

Recall: pairs are (0, 01) and (100, 001)

001

100 001

100 001

But we can never makethe first string as longas the second.

As manytimes as we like

Can add thesecond pairfor a match

Must startwith firstpair

Page 15: Theory of computation / Post’s Correspondence Problems (PCP)

Example: PCP – (3)

Suppose we add a third pair, so the instance becomes: 1 = (0, 01); 2 = (100, 001); 3 = (110, 10).

Now 1,3 is a solution; both strings are 0110.

In fact, any sequence of indexes in 12*3 is a solution.

Page 16: Theory of computation / Post’s Correspondence Problems (PCP)

A Simple Undecidable Problem

We say this instance of PCP has a

solution, if there is a sequence of

integers, i1, i2, …, im, that, when

interpreted as indexes for strings in

the A and B lists, yields the same

string, that is, wi1wi2

…wim = xi1

xi2…

xim.

We say the sequence is a solution

to this instance of PCP.

Page 17: Theory of computation / Post’s Correspondence Problems (PCP)

A Simple Undecidable Problem

The Post’s corresponding problem is:

given an instance of PCP, tell whether this instance has a solution.

The solution to an instance of PCP sometimes is not unique.

Also, an instance of PCP might have no solution.

Page 18: Theory of computation / Post’s Correspondence Problems (PCP)

18

Post’s (Domino) Correspondence Problem

PCP as a gameUsually dominoes is played as follows:

Page 19: Theory of computation / Post’s Correspondence Problems (PCP)

19

Post’s (Domino) Correspondence Problem

Usually dominoes is played as follows:

• •

Page 20: Theory of computation / Post’s Correspondence Problems (PCP)

20

Post’s (Domino) Correspondence Problem

Usually dominoes is played as follows:

• •

• •• •

• •

Page 21: Theory of computation / Post’s Correspondence Problems (PCP)

21

Post’s (Domino) Correspondence Problem

Usually dominoes is played as follows:

• •• •

• • •

• •

• •

• •• •

Page 22: Theory of computation / Post’s Correspondence Problems (PCP)

22

Post’s (Domino) Correspondence Problem

Usually dominoes is played as follows:

• • •

• • •

• •

• •

• •• •

• •• •

• • •

Page 23: Theory of computation / Post’s Correspondence Problems (PCP)

23

Post’s (Domino) Correspondence Problem

Usually dominoes is played as follows:

• • •

• • •

• •

• •

• •• •

• •• •

• • •

• • •

• • •

Page 24: Theory of computation / Post’s Correspondence Problems (PCP)

24

Post’s (Domino) Correspondence Problem

We’ll play horizontally instead of vertically. Furthermore, dominoes will not be allowed to be flipped so each half will be a different color:

• •

Page 25: Theory of computation / Post’s Correspondence Problems (PCP)

25

Post’s (Domino) Correspondence Problem

Aim of the game is to have same total number of dots on the top as on the bottom. Player is given a set of domino prototypes to choose from, and can choose as many of a given prototype as necessary.

Let’s play with the following 2 prototypes:

• •

• •• •• •

Page 26: Theory of computation / Post’s Correspondence Problems (PCP)

26

Post’s (Domino) Correspondence Problem

Let’s play with the following 2 prototypes:

• •

Total

Total

• •• •• •

Page 27: Theory of computation / Post’s Correspondence Problems (PCP)

27

Post’s (Domino) Correspondence Problem

Let’s play with the following 2 prototypes:

• •• •• •

• •

Total1

Total

2

• •

Page 28: Theory of computation / Post’s Correspondence Problems (PCP)

28

Post’s (Domino) Correspondence Problem

Let’s play with the following 2 prototypes:

• •• •• •

• •

Total2

Total

4

• •

• •

Page 29: Theory of computation / Post’s Correspondence Problems (PCP)

29

Post’s (Domino) Correspondence Problem

Let’s play with the following 2 prototypes:

• •• •• •

• •

Total8

Total

5

• •

• •

• •• •• •

Page 30: Theory of computation / Post’s Correspondence Problems (PCP)

30

Post’s (Domino) Correspondence Problem

Let’s play with the following 2 prototypes:

• •• •• •

• •

Total9

Total

7

• •

• •

• •• •• •

• •

Page 31: Theory of computation / Post’s Correspondence Problems (PCP)

31

Post’s (Domino) Correspondence Problem

Let’s play with the following 2 prototypes:

• •• •• •

• •

Total10

Total

9

• •

• •

• •• •• •

• •

• •

Page 32: Theory of computation / Post’s Correspondence Problems (PCP)

32

Post’s (Domino) Correspondence Problem

Let’s play with the following 2 prototypes:

WINNER!

• •• •• •

• •

Total11

Total

11

• •

• •

• •• •• •

• •

• •

• •

Page 33: Theory of computation / Post’s Correspondence Problems (PCP)

33

Post’s (Domino) Correspondence Problem

Could have represented dominos using unary strings:

Point of game is to get the same string to be written on top as bottom.

• •• •• •

• •

111111

1

1

11

Page 34: Theory of computation / Post’s Correspondence Problems (PCP)

34

Post’s (Domino) Correspondence Problem

In general, could use arbitrary strings. EG:

Aim: Get the same string on top as bottom. PCP: Given an alphabet S and finite set of

string pairs (u1,v1), (u2,v2), … , (un,vn) with ui ,vi S*, can a non-empty sequence of indices i1, i2, i3, … , it be chosen so that

ui1ui2ui3…uit = vi1vi2vi3…vit ?

c

ba

a

ac

acb

b

ba

a

Page 35: Theory of computation / Post’s Correspondence Problems (PCP)

35

Post’s (Domino) Correspondence Problem

Let’s play with the following 4 prototypes:

1: , 2: , 3: , 4:

Total

Total

Indices

c

ba

acb

b

ba

a

a

ac

Page 36: Theory of computation / Post’s Correspondence Problems (PCP)

36

Post’s (Domino) Correspondence Problem

Let’s play with the following 4 prototypes:

1: , 2: , 3: , 4:

Totala

Total

acIndices

1

c

ba

a

ac

acb

b

ba

a

a

ac

Page 37: Theory of computation / Post’s Correspondence Problems (PCP)

37

Post’s (Domino) Correspondence Problem

Let’s play with the following 4 prototypes:

1: , 2: , 3: , 4:

Totalac

Total

acbaIndices

12

c

ba

a

ac

acb

b

ba

a

a

ac

c

ba

Page 38: Theory of computation / Post’s Correspondence Problems (PCP)

38

Post’s (Domino) Correspondence Problem

Let’s play with the following 4 prototypes:

1: , 2: , 3: , 4:

Totalacba

Total

acbaaIndices

123

c

ba

a

ac

acb

b

ba

a

a

ac

c

ba

ba

a

Page 39: Theory of computation / Post’s Correspondence Problems (PCP)

39

Post’s (Domino) Correspondence Problem

Let’s play with the following 4 prototypes:

1: , 2: , 3: , 4:

Totalacbaa

Total

acbaaacIndices

1231

c

ba

a

ac

acb

b

ba

a

a

ac

c

ba

ba

a

a

ac

Page 40: Theory of computation / Post’s Correspondence Problems (PCP)

40

Post’s (Domino) Correspondence Problem

Let’s play with the following 4 prototypes:

1: , 2: , 3: , 4:

Answer: YES! (solution is 12314)

Totalacbaaac

bTotal

acbaaacb

Indices12314

c

ba

a

ac

acb

b

ba

a

a

ac

c

ba

ba

a

a

ac

acb

b

Page 41: Theory of computation / Post’s Correspondence Problems (PCP)

PCP is undecidable

We can try all lists i1, i2, … , ik

in order of k. if we find a solution, the answer is “yes”

But if we never find a solution, how can we be sure no longer solution exists?

So, we can never say no

Page 42: Theory of computation / Post’s Correspondence Problems (PCP)

A Simple Undecidable Problem

• Example 1Two lists of an instance of PCP are shown• A solution is 2, 1, 1, 3 (strings may be

repeated) because w2, w1, w1, w3 = 101111 110 = 10111 1110 = x2, x1, x1, x3

• Another solution is 2, 1, 1, 3, 2, 1, 1, 3

• Example 1Two lists of an instance of PCP are shown• A solution is 2, 1, 1, 3 (strings may be

repeated) because w2, w1, w1, w3 = 101111 110 = 10111 1110 = x2, x1, x1, x3

• Another solution is 2, 1, 1, 3, 2, 1, 1, 3

List A List B

i wi xi

1 1 111

2 10111 10

3 10 0

Page 43: Theory of computation / Post’s Correspondence Problems (PCP)

There is much more I haven’t told you about It ..