Undecidable languages
• Language which is not RE(undecidable):
Language containing the pairs (M,w) are undecidable.
- Representation of TM in binary coded form:
a. Transitions are represented in binary form.
(q,a)->(q,a,d)
qi: i no. of 0’s
a=tape symbol, no. of 0 depends on integer assigned to the tape symbol
d=direction, one 0 for right, 2 0’s for left
all parts of transition separated by a single 1
b. All the transitions (separated by 2 1’s) in combination form the
representation of TM M.
c. Binary strings which do not follow the rules will not represent any
TM. They will have single state and no transitions, halts on any input.
1Isha Padhy, Asst. Prof,CSE Dept.
Diagonalization Language (Ld)
- Def: The Ld is the set of strings wi, s.t. wi L(M∉ i).
-If w is the code for M, then Ld consists of all those strings w
which are not accepted by itself M. i.e TM M does not halt
when given itself as input.
- Table consists of M and s values, which tells whether Mi
accept sj. If yes then “acc”, else for no “rej”. We can make an
(infinite) table of how each Turing machine behaves on each
input string.
- All M are ordered lexicographically.
- ith row is considered as characteristic vector(CV) for
L(Mi). “Acc” are the strings which are in the language L(Mi).
- Ld: complement the diagonal, so we get
w1=rej, w2=“rej”,w3=“rej”,w4=“acc”……
w1:ε, w2=0,w3=1,…..
Now complementing the diagonal is also a CV for the
language Ld, so it cannot be representing any other language in
the list.
Mi rej rej rej acc …
2Isha Padhy, Asst. Prof,CSE Dept.
Ld is not RE
• No TM accepts Ld
Pf: 1. Let Ld=L(M) for some TM M
since M is a TM it can be coded in binary and
present in the list.
2. Let the code be Mi.
- If wi L∈ d, then Mi accepts wi, but by def wi L∉ d. So
contradiction.
- If wi L∉ d, then Mi does not accept wi.
Thus Ld is not accepted by any TM, so undecidable.
3Isha Padhy, Asst. Prof,CSE Dept.
RE languages
RE can be:
1. A TM recognizes the RE languages and tells
when the string is not decided to be in
language.(recursive)
2. RE languages that are not accepted by any
TM with the guarantee of halting.
4Isha Padhy, Asst. Prof,CSE Dept.
Properties
• If L is RE but not recursive, L’ is
not RE then L cannot be recursive.
• If L is recursive, then L’ is also
recursive. i.e.M’ accepts exactly
those strings that M does not
accept, so M’ accepts L’.
• If both L and L’ are RE, then L is
recursive.
Let M gets w L, L M1, L’∈ ∈ ∈
M2, In both case M halts.
RE but not
recursive
Recur
sive
Not RE
M1
M2
w
Acc
Acc
A
R
M
5Isha Padhy, Asst. Prof,CSE Dept.
Universal TM and Lu(Universal Language)
• Lu: set of binary strings that encode a pair(M,w) where M is TM and w is a string accepted by
M.
• Universal Turing Machine U, Lu=L(U).
• Description Of U:
1. A multi-tape TM, transitions of M are stored in first tape along with w.
2nd tape: hold the simulated tape of M
3rd
tape: holds the state of M with qi represented by i 0’s.
2. Operation of U:
a. i/p code of M must be a correct code.
b. 2nd
tape contain w in its coded form of only 0 and 1, 0:10,1:100,B:1000
c. Place 0 , start state in 3rd
tape.
d. Move of M: 0i
10j
10k
10l
10m
0i in 3rd
tape, start head position at 0j in 2nd
tape
Change the contents of tape 3 by 0k by first making all 0’s blank then copy 0k from tape 1 to
tape 3.
Replace 0j on tape2 by 0l
Move the head on tape 2 to left or right till a 1 is reached.
3. If M has no matching transition then M halts and so U halts.
4. If M enters to accepting state then U accepts.
5. Lu is undecidable.
6Isha Padhy, Asst. Prof,CSE Dept.
Undecidable problems about TM
• Le: If w is a binary string, that represents some
TM, Mi and L(Mi)= φ i.e. Mi does not accept
any i/p, then w L∈ e.
• Lne: L(Mi) is not φ, then w L∈ ne.
i.e. Lne is the language of all codes for TM
that accept at least 1 input string.
Lne is RE but not recursive.
7Isha Padhy, Asst. Prof,CSE Dept.
Property
• Property: set of languages
Ex property of RE languages means set of RE
languages, property of being context free
means set of all CFL’s.
• A property is trivial: If it is either
empty( satisfied by no languages) or is all RE
languages. Otherwise it is non-trivial.
• Empty property φ:set of all languages which
are empty
{φ}: property is empty.
8Isha Padhy, Asst. Prof,CSE Dept.
Rice theorem
• Th: Every nontrivial property of the RE
languages is undecidable.
Let P: a nontrivial property of RE
languages.
Lp: set of codes for TM Mi s.t.L(Mi) is a
language in P.
Assume there is no empty language, and L
is any non empty language in P.
Let ML accept L. We reduce Lu to Lp which
proves Lp is also undecidable.
• Reduction is a way of converting one
problem into another s.t. a sol to 2nd
problem can be used to solve the
first.i.e reduction from A to B is a
computable function f:Σ*-> Σ* , w A∈
iff f(w) B.∈
• L(M’)= φ, if M doesnot accept w
• L(M’)=L ,if M accepts w.
M
ML
ACC
x ACC
ACC
M’
w
U
9Isha Padhy, Asst. Prof,CSE Dept.
PCP(Post Correspondence Problem)
• Def: A instance of PCP consists of 2 lists of strings over
some alphabet Σ, the 2 lists must be of equal
length(same no. of strings). Let the list be A and B,
A: w1,w2,w3,….wk
B: x1,x2,x3….xk for some k
For each i, the pair(wi,xi) is said to be corresponding pair.
This instance has a sol ,if there is a sequence of one or
more intergers i1,i2,…im s.t. when interpreted as
indexes for strings in A and B lists yield the same string.
i.e. wi1wi2…wim=xi1xi2…xim, we say i1,i2,….im is a sol to this
instance of PCP.
• PCP is undecidable.
10Isha Padhy, Asst. Prof,CSE Dept.
Examples
• M = (abb, aa, aaa) and N = (bba, aaa, aa)
Sol:2,1,3
• M=(110,0011,0110) N=(110110,00,110)
Sol:2,3,1
• M = (ab, bab, bbaaa) and N = (a, ba, bab)
No sol.
• A = (1, 10111, 10) B = (111, 10, 0)
Sol: 2, 1, 1, 3
11Isha Padhy, Asst. Prof,CSE Dept.

Undecidability1

  • 1.
    Undecidable languages • Languagewhich is not RE(undecidable): Language containing the pairs (M,w) are undecidable. - Representation of TM in binary coded form: a. Transitions are represented in binary form. (q,a)->(q,a,d) qi: i no. of 0’s a=tape symbol, no. of 0 depends on integer assigned to the tape symbol d=direction, one 0 for right, 2 0’s for left all parts of transition separated by a single 1 b. All the transitions (separated by 2 1’s) in combination form the representation of TM M. c. Binary strings which do not follow the rules will not represent any TM. They will have single state and no transitions, halts on any input. 1Isha Padhy, Asst. Prof,CSE Dept.
  • 2.
    Diagonalization Language (Ld) -Def: The Ld is the set of strings wi, s.t. wi L(M∉ i). -If w is the code for M, then Ld consists of all those strings w which are not accepted by itself M. i.e TM M does not halt when given itself as input. - Table consists of M and s values, which tells whether Mi accept sj. If yes then “acc”, else for no “rej”. We can make an (infinite) table of how each Turing machine behaves on each input string. - All M are ordered lexicographically. - ith row is considered as characteristic vector(CV) for L(Mi). “Acc” are the strings which are in the language L(Mi). - Ld: complement the diagonal, so we get w1=rej, w2=“rej”,w3=“rej”,w4=“acc”…… w1:ε, w2=0,w3=1,….. Now complementing the diagonal is also a CV for the language Ld, so it cannot be representing any other language in the list. Mi rej rej rej acc … 2Isha Padhy, Asst. Prof,CSE Dept.
  • 3.
    Ld is notRE • No TM accepts Ld Pf: 1. Let Ld=L(M) for some TM M since M is a TM it can be coded in binary and present in the list. 2. Let the code be Mi. - If wi L∈ d, then Mi accepts wi, but by def wi L∉ d. So contradiction. - If wi L∉ d, then Mi does not accept wi. Thus Ld is not accepted by any TM, so undecidable. 3Isha Padhy, Asst. Prof,CSE Dept.
  • 4.
    RE languages RE canbe: 1. A TM recognizes the RE languages and tells when the string is not decided to be in language.(recursive) 2. RE languages that are not accepted by any TM with the guarantee of halting. 4Isha Padhy, Asst. Prof,CSE Dept.
  • 5.
    Properties • If Lis RE but not recursive, L’ is not RE then L cannot be recursive. • If L is recursive, then L’ is also recursive. i.e.M’ accepts exactly those strings that M does not accept, so M’ accepts L’. • If both L and L’ are RE, then L is recursive. Let M gets w L, L M1, L’∈ ∈ ∈ M2, In both case M halts. RE but not recursive Recur sive Not RE M1 M2 w Acc Acc A R M 5Isha Padhy, Asst. Prof,CSE Dept.
  • 6.
    Universal TM andLu(Universal Language) • Lu: set of binary strings that encode a pair(M,w) where M is TM and w is a string accepted by M. • Universal Turing Machine U, Lu=L(U). • Description Of U: 1. A multi-tape TM, transitions of M are stored in first tape along with w. 2nd tape: hold the simulated tape of M 3rd tape: holds the state of M with qi represented by i 0’s. 2. Operation of U: a. i/p code of M must be a correct code. b. 2nd tape contain w in its coded form of only 0 and 1, 0:10,1:100,B:1000 c. Place 0 , start state in 3rd tape. d. Move of M: 0i 10j 10k 10l 10m 0i in 3rd tape, start head position at 0j in 2nd tape Change the contents of tape 3 by 0k by first making all 0’s blank then copy 0k from tape 1 to tape 3. Replace 0j on tape2 by 0l Move the head on tape 2 to left or right till a 1 is reached. 3. If M has no matching transition then M halts and so U halts. 4. If M enters to accepting state then U accepts. 5. Lu is undecidable. 6Isha Padhy, Asst. Prof,CSE Dept.
  • 7.
    Undecidable problems aboutTM • Le: If w is a binary string, that represents some TM, Mi and L(Mi)= φ i.e. Mi does not accept any i/p, then w L∈ e. • Lne: L(Mi) is not φ, then w L∈ ne. i.e. Lne is the language of all codes for TM that accept at least 1 input string. Lne is RE but not recursive. 7Isha Padhy, Asst. Prof,CSE Dept.
  • 8.
    Property • Property: setof languages Ex property of RE languages means set of RE languages, property of being context free means set of all CFL’s. • A property is trivial: If it is either empty( satisfied by no languages) or is all RE languages. Otherwise it is non-trivial. • Empty property φ:set of all languages which are empty {φ}: property is empty. 8Isha Padhy, Asst. Prof,CSE Dept.
  • 9.
    Rice theorem • Th:Every nontrivial property of the RE languages is undecidable. Let P: a nontrivial property of RE languages. Lp: set of codes for TM Mi s.t.L(Mi) is a language in P. Assume there is no empty language, and L is any non empty language in P. Let ML accept L. We reduce Lu to Lp which proves Lp is also undecidable. • Reduction is a way of converting one problem into another s.t. a sol to 2nd problem can be used to solve the first.i.e reduction from A to B is a computable function f:Σ*-> Σ* , w A∈ iff f(w) B.∈ • L(M’)= φ, if M doesnot accept w • L(M’)=L ,if M accepts w. M ML ACC x ACC ACC M’ w U 9Isha Padhy, Asst. Prof,CSE Dept.
  • 10.
    PCP(Post Correspondence Problem) •Def: A instance of PCP consists of 2 lists of strings over some alphabet Σ, the 2 lists must be of equal length(same no. of strings). Let the list be A and B, A: w1,w2,w3,….wk B: x1,x2,x3….xk for some k For each i, the pair(wi,xi) is said to be corresponding pair. This instance has a sol ,if there is a sequence of one or more intergers i1,i2,…im s.t. when interpreted as indexes for strings in A and B lists yield the same string. i.e. wi1wi2…wim=xi1xi2…xim, we say i1,i2,….im is a sol to this instance of PCP. • PCP is undecidable. 10Isha Padhy, Asst. Prof,CSE Dept.
  • 11.
    Examples • M =(abb, aa, aaa) and N = (bba, aaa, aa) Sol:2,1,3 • M=(110,0011,0110) N=(110110,00,110) Sol:2,3,1 • M = (ab, bab, bbaaa) and N = (a, ba, bab) No sol. • A = (1, 10111, 10) B = (111, 10, 0) Sol: 2, 1, 1, 3 11Isha Padhy, Asst. Prof,CSE Dept.