Section 4.2

Problems

[23/96%]
Show
LaTeX
Problem 4.10

ᴬ Let INFINITE⁡DFA ={⟨A⟩∣A is a DFA and L(A) is an infinite language }\operatorname {INFINITE}_{\text{DFA }}=\left\{ \langle A\rangle \mid A\text{ is a DFA and }L(A)\text{ is an infinite language }\right\}. Show that INFINITE⁡DFA \operatorname {INFINITE}_{\text{DFA }} is decidable.

?
Problem 4.11

Let INFINITE⁡PDA ={⟨M⟩∣M is a PDA and L(M) is an infinite language }\operatorname {INFINITE}_{\text{PDA }}=\left\{ \langle M\rangle \mid M\text{ is a PDA and }L(M)\text{ is an infinite language }\right\}. Show that INFINITE⁡PDA \operatorname {INFINITE}_{\text{PDA }} is decidable.

?
Problem 4.12

ᴬ Let A={⟨M⟩∣M is a DFA that doesn’t accept any string containing an odd number of 1 s}A=\left\{ \langle M\rangle \mid M\text{ is a DFA that doesn't accept any string containing an odd number of 1 s}\right\}. Show that AA is decidable.

?
Problem 4.13

Let A={⟨R,S⟩∣R and S are regular expressions and L(R)⊆L(S)}A=\left\{ \langle R, S\rangle \mid R\text{ and }S\text{ are regular expressions and }L(R) \subseteq L(S)\right\}. Show that AA is decidable.

?
Problem 4.14

ᴬ Let Σ={0,1}\Sigma =\left\{ 0,1\right\}. Show that the problem of determining whether a CFG generates some string in 1∗1^{*} is decidable. In other words, show that

{⟨G⟩∣G is a CFG over {0,1} and 1∗∩L(G)≠∅} \left\{ \langle G\rangle \mid G \text{ is a CFG over }\left\{ 0,1\right\} \text{ and } 1^{*} \cap L(G) \neq \emptyset \right\}

is a decidable language.

?
Problem 4.15
  • Show that the problem of determining whether a CFG generates all strings in 1∗1^{*} is decidable. In other words, show that {⟨G⟩∣G is a CFG over {0,1} and 1∗⊆L(G)}\left\{ \langle G\rangle \mid G \text{ is a CFG over } \left\{ 0,1\right\} \text{ and } 1^{*} \subseteq L(G)\right\} is a decidable language.
?
Problem 4.16

Let A={⟨R⟩∣R is a regular expression describing a language containing at least one string w that has 111 as a substring (i.e., w=x111y for some x and y )}A=\left\{ \langle R\rangle \mid R\text{ is a regular expression describing a language containing at least one string }w\text{ that has 111 as a substring (i.e., }w=x 111 y\text{ for some }x\text{ and }y\text{ )}\right\}. Show that AA is decidable.

?
Problem 4.17

Prove that EQ⁡DFA \operatorname {EQ}_{\text{DFA }} is decidable by testing the two DFAs on all strings up to a certain size. Calculate a size that works.

?
Problem 4.18
  • Let CC be a language. Prove that CC is Turing-recognizable iff a decidable language DD exists such that C={x∣∃y(⟨x,y⟩∈D)}C=\left\{ x \mid \exists y(\langle x, y\rangle \in D)\right\}.
?
Problem 4.19
  • Prove that the class of decidable languages is not closed under homomorphism.
?
Problem 4.20

Let AA and BB be two disjoint languages. Say that language CC separates AA and BB if A⊆CA \subseteq C and B⊆CˉB \subseteq \bar{C}. Show that any two disjoint co-Turing-recognizable languages are separable by some decidable language.

?
Problem 4.21

Let S={⟨M⟩∣M is a DFA that accepts wR whenever it accepts w}S=\left\{ \langle M\rangle \mid M \text{ is a DFA that accepts } w^{\mathcal{R}} \text{ whenever it accepts } w\right\}. Show that SS is decidable.

?
Problem 4.22

Let PREFIX-FREE⁡REX ={⟨R⟩∣R is a regular expression and L(R) is prefix-free }\operatorname {PREFIX-FREE}_{\text{REX }}=\left\{ \langle R\rangle \mid R\text{ is a regular expression and }L(R)\text{ is prefix-free }\right\}. Show that PREFIX-FREE⁡REX \operatorname {PREFIX-FREE}_{\text{REX }} is decidable. Why does a similar approach fail to show that PREFIX-FREE⁡CFG\operatorname {PREFIX-FREE}_{\mathrm{CFG}} is decidable?

?
Problem 4.23
  • ᴬ Say that an NFA is ambiguous if it accepts some string along two different computation branches. Let AMBIG⁡NFA ={⟨N⟩∣N is an ambiguous NFA }\operatorname {AMBIG}_{\text{NFA }}=\left\{ \langle N\rangle \mid N\text{ is an ambiguous NFA }\right\}. Show that AMBIG⁡NFA \operatorname {AMBIG}_{\text{NFA }} is decidable. (Suggestion: One elegant way to solve this problem is to construct a suitable DFA and then run EDFA E_{\text{DFA }} on it.)
?
Problem 4.24

A useless state in a pushdown automaton is never entered on any input string. Consider the problem of determining whether a pushdown automaton has any useless states. Formulate this problem as a language and show that it is decidable.

?
Problem 4.25
  • ᴬ Let BAL⁡DFA ={⟨M⟩∣M is a DFA that accepts some string containing an equal number of 0s and 1s}\operatorname {BAL}_{\text{DFA }}=\left\{ \langle M\rangle \mid M\text{ is a DFA that accepts some string containing an equal number of 0s and 1s}\right\}. Show that BAL⁡DFA \operatorname {BAL}_{\text{DFA }} is decidable. (Hint: Theorems about CFLs are helpful here.)
?
Problem 4.26
  • Let PAL⁡DFA ={⟨M⟩∣M is a DFA that accepts some palindrome }\operatorname {PAL}_{\text{DFA }}=\left\{ \langle M\rangle \mid M\text{ is a DFA that accepts some palindrome }\right\}. Show that PAL⁡DFA \operatorname {PAL}_{\text{DFA }} is decidable. (Hint: Theorems about CFLs are helpful here.)
?
Problem 4.27
  • Let E={⟨M⟩∣M is a DFA that accepts some string with more 1s than 0s}E=\left\{ \langle M\rangle \mid M\text{ is a DFA that accepts some string with more 1s than 0s}\right\}. Show that EE is decidable. (Hint: Theorems about CFLs are helpful here.)
?
Problem 4.28

Let C={⟨G,x⟩∣G is a CFG x is a substring of some y∈L(G)}C=\left\{ \langle G, x\rangle \mid G\text{ is a CFG }x\text{ is a substring of some }y \in L(G)\right\}. Show that CC is decidable. (Hint: An elegant solution to this problem uses the decider for ECFG E_{\text{CFG }}.)

?
Problem 4.29

Let CCFG ={⟨G,k⟩∣G is a CFG and L(G) contains exactly k strings where k≥0 or k=∞}C_{\text{CFG }}=\left\{ \langle G, k\rangle \mid G\text{ is a CFG and }L(G)\text{ contains exactly }k\text{ strings where }k \geq 0\text{ or }k=\infty \right\}. Show that CCFGC_{\mathrm{CFG}} is decidable.

?
Problem 4.30

Let AA be a Turing-recognizable language consisting of descriptions of Turing machines, {⟨M1⟩,⟨M2⟩,…}\left\{ \left\langle M_{1}\right\rangle ,\left\langle M_{2}\right\rangle , \ldots \right\}, where every MiM_{i} is a decider. Prove that some decidable language DD is not decided by any decider MiM_{i} whose description appears in AA. (Hint: You may find it helpful to consider an enumerator for AA.)

?
Problem 4.31

Say that a variable AA in CFL GG is usable if it appears in some derivation of some string w∈Gw \in G. Given a CFG GG and a variable AA, consider the problem of testing whether AA is usable. Formulate this problem as a language and show that it is decidable.

?
Problem 4.32

The proof of Lemma 2.41 says that (q,x)(q, x) is a looping situation for a DPDA PP if when PP is started in state qq with x∈Γx \in \Gamma on the top of the stack, it never pops anything below xx and it never reads an input symbol. Show that FF is decidable, where F={⟨P,q,x⟩∣(q,x) is a looping situation for P}F=\left\{ \langle P, q, x\rangle \mid (q, x)\text{ is a looping situation for }P\right\}.

?