PREPARED FOR:
Dr. Gede Pramudya Ananta
PREPARED BY:
THAMER J.ABBAS M031020009
SAIF MOHAMMED MAKKI M031020010
SAIF ZUHAIR ABDULMAJEED M031110012
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
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.
EXAMPLE: use problem B to solve problem A
CAN'T TAKE IT DIRECT.. XX
A
B
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
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
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
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
X2 + Y2 + Z2 = A2 + B2
10 11 12 13 14
= 365 365
6 7 8 9 10
149 ≠ 182
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.
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.
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.
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.
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
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.
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.
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.
18
Post’s (Domino) Correspondence Problem
PCP as a gameUsually dominoes is played as follows:
19
Post’s (Domino) Correspondence Problem
Usually dominoes is played as follows:
•
• •
20
Post’s (Domino) Correspondence Problem
Usually dominoes is played as follows:
• •
• •• •
•
• •
21
Post’s (Domino) Correspondence Problem
Usually dominoes is played as follows:
• •• •
• • •
•
• •
• •
• •• •
22
Post’s (Domino) Correspondence Problem
Usually dominoes is played as follows:
• • •
• • •
•
• •
• •
• •• •
• •• •
• • •
23
Post’s (Domino) Correspondence Problem
Usually dominoes is played as follows:
• • •
• • •
•
• •
• •
• •• •
• •• •
• • •
• • •
• • •
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:
•
• •
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:
•
• •
• •• •• •
•
26
Post’s (Domino) Correspondence Problem
Let’s play with the following 2 prototypes:
•
• •
Total
Total
• •• •• •
•
27
Post’s (Domino) Correspondence Problem
Let’s play with the following 2 prototypes:
• •• •• •
•
•
• •
Total1
Total
2
•
• •
28
Post’s (Domino) Correspondence Problem
Let’s play with the following 2 prototypes:
• •• •• •
•
•
• •
Total2
Total
4
•
• •
•
• •
29
Post’s (Domino) Correspondence Problem
Let’s play with the following 2 prototypes:
• •• •• •
•
•
• •
Total8
Total
5
•
• •
•
• •
• •• •• •
•
30
Post’s (Domino) Correspondence Problem
Let’s play with the following 2 prototypes:
• •• •• •
•
•
• •
Total9
Total
7
•
• •
•
• •
• •• •• •
•
•
• •
31
Post’s (Domino) Correspondence Problem
Let’s play with the following 2 prototypes:
• •• •• •
•
•
• •
Total10
Total
9
•
• •
•
• •
• •• •• •
•
•
• •
•
• •
32
Post’s (Domino) Correspondence Problem
Let’s play with the following 2 prototypes:
WINNER!
• •• •• •
•
•
• •
Total11
Total
11
•
• •
•
• •
• •• •• •
•
•
• •
•
• •
•
• •
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
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
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
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
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
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
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
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
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
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
There is much more I haven’t told you about It ..