Download - COMPUTABILITY AND COMPLEXITY TUTORIAL 6people.cs.aau.dk/~srba/courses/tutorials-CC-10/t6.pdf · 2 are CFGs such that L(G 1) = L(G 2) g. By reduction from ALL CFG prove that EQ ...

Transcript
Page 1: COMPUTABILITY AND COMPLEXITY TUTORIAL 6people.cs.aau.dk/~srba/courses/tutorials-CC-10/t6.pdf · 2 are CFGs such that L(G 1) = L(G 2) g. By reduction from ALL CFG prove that EQ ...

COMPUTABILITY AND COMPLEXITY TUTORIAL 6

Tutorial 6

Exercise 1 (compulsory)We know that the problem ALLCFG (does a given context-free grammar recognize all strings from Σ∗?)is undecidable.

Consider the problem EQCFGdef= {〈G1, G2〉 | G1 and G2 are CFGs such that L(G1) = L(G2) }.

• By reduction from ALLCFG prove that EQCFG is undecidable.

• Prove that EQCFG is co-recognizable.

• Can EQCFG be also recognizable?

Exercise 2 (compulsory)Consider the following instance P of Post correspondence problem.

P = {[ ab

abab

],[ b

a

],[aba

b

],[aa

a

]}

Find a match of P (a nonempty sequence of indices between 1 and 4).

Exercise 3 (compulsory)Consider the problem silly Post correspondence problem (SPCP). An instance P of SPCP is

P = {[ t1b1

],[ t2b2

], . . . ,

[ tkbk

]}

where ti, bi ∈ Σ∗ and moreover |ti| = |bi| for all i, 1 ≤ i ≤ k. In other words in each pair the top stringhas the same length as the bottom string. The question is whether P contains a match (like in standardPCP).

• Is the problem SPCP decidable or undecidable? Give a precise proof of your claim.

Exercise 4 (compulsory)Consider the problem binary Post correspondence problem (BPCP). An instance P of BPCP is

P = {[ t1b1

],[ t2b2

], . . . ,

[ tkbk

]}

where ti, bi ∈ {0, 1}∗ for all i, 1 ≤ i ≤ k.In other words BPCP instance is like PCP instance, we only restrict the alphabet for the top and bottom

strings to consist only of two symbols.

• Is the problem BPCP decidable or undecidable? Give a precise proof of your claim.

Hint: Consider an instance of standard PCP over some general alphabet Σ = {a1, a2, . . . , an}. Is itpossible to construct an instance of BPCP which has a match if and only if the original instance has amatch?

1

Page 2: COMPUTABILITY AND COMPLEXITY TUTORIAL 6people.cs.aau.dk/~srba/courses/tutorials-CC-10/t6.pdf · 2 are CFGs such that L(G 1) = L(G 2) g. By reduction from ALL CFG prove that EQ ...

COMPUTABILITY AND COMPLEXITY TUTORIAL 6

Exercise 5 (optional)Consider the problem whether two given context-free grammars have a nonempty intersection of the lan-guages they generate.

• Describe the decision problem as a language INTERSECTIONCFG.

• Prove that INTERSECTIONCFG is undecidable by reduction from PCP.

Hint: For a given PCP instance

P = {[ t1b1

],[ t2b2

], . . . ,

[ tkbk

]}

you might find useful to consider the following grammars G1 and G2 (where i1, i2, . . . , ik are new terminalsymbols).

G1 : S1 → t1S1i1 | . . . | tkS1ik | t1i1 | . . . | tkik

G2 : S2 → b1S2i1 | . . . | bkS2ik | b1i1 | . . . | bkik

Exercise 6 (optional)Show that any Turing machine that is allowed to use only the first 2|w| tape cells when run on an input wis equivalent to LBA (which can use only |w| of the first tape cells).

Exercise 7 (optional)Problem 5.17 on page 216 and Exercise 5.8 on page 215.

2