Section 8.2

Problems

[27/89%]
Show
LaTeX
Problem 8.8

Let EQ⁡REX ={⟨R,S⟩∣R and S are equivalent regular expressions }\operatorname {EQ}_{\text{REX }}=\left\{ \langle R, S\rangle \mid R\text{ and }S\text{ are equivalent regular expressions }\right\}. Show that EQ⁡REX ∈\operatorname {EQ}_{\text{REX }} \in PSPACE.

?
Problem 8.9

A ladder is a sequence of strings s1,s2,…,sks_{1}, s_{2}, \ldots , s_{k}, wherein every string differs from the preceding one by exactly one character. For example, the following is a ladder of English words, starting with "head" and ending with "free": head, hear, near, fear, bear, beer, deer, deed, feed, feet, fret, free. Let LADDER⁡DFA ={⟨M,s,t⟩∣M is a DFA and L(M) contains a ladder of strings, starting with s and ending with t}\operatorname {LADDER}_{\text{DFA }}=\left\{ \langle M, s, t\rangle \mid M\text{ is a DFA and }L(M)\text{ contains a ladder of strings, starting with }s\text{ and ending with }t\right\}. Show that LADDER⁡DFA \operatorname {LADDER}_{\text{DFA }} is in PSPACE.

?
Problem 8.10

The Japanese game go-moku is played by two players, "X" and "O," on a 19 × 19 grid. Players take turns placing markers, and the first player to achieve five of her markers consecutively in a row, column, or diagonal is the winner. Consider this game generalized to an n×nn \times n board. Let

GM⁡={⟨B⟩∣B is a position in generalized go-moku,  where player "X" has a winning strategy }. \begin{array}{r} \operatorname {GM}=\left\{ \langle B\rangle \mid B \text{ is a position in generalized go-moku, } \\ \text{ where player "X" has a winning strategy }\right\} . \end{array}

By a position we mean a board with markers placed on it, such as may occur in the middle of a play of the game, together with an indication of which player moves next. Show that GM⁡∈\operatorname {GM} \in PSPACE.

?
Problem 8.11

Show that if every NP-hard language is also PSPACE-hard, then PSPACE = NP.

?
Problem 8.12

Show that TQBFT Q B F restricted to formulas where the part following the quantifiers is in conjunctive normal form is still PSPACE-complete.

?
Problem 8.13

Define ALBA ={⟨M,w⟩∣M is an LBA that accepts input w}A_{\text{LBA }}=\left\{ \langle M, w\rangle \mid M\text{ is an LBA that accepts input }w\right\}. Show that ALBA A_{\text{LBA }} is PSPACE-complete.

?
Problem 8.14
  • The cat-and-mouse game is played by two players, "Cat" and "Mouse," on an arbitrary undirected graph. At a given point, each player occupies a node of the graph. The players take turns moving to a node adjacent to the one that they currently occupy. A special node of the graph is called "Hole." Cat wins if the two players ever occupy the same node. Mouse wins if it reaches the Hole before the preceding happens. The game is a draw if a situation repeats (i.e., the two players simultaneously occupy positions that they simultaneously occupied previously, and it is the same player's turn to move).
\begin{aligned} \operatorname {HAPPY-CAT}=\left\{ \langle G, c, m, h\rangle \mid & G, c, m, h \text{ are respectively a graph, and } \\ & \text{ positions of the Cat, Mouse, and Hole, such that } \\ & \text{ Cat has a winning strategy if Cat moves first }\right\} . \end{aligned}

Show that HAPPY-CAT is in P. (Hint: The solution is not complicated and doesn't depend on subtle details in the way the game is defined. Consider the entire game tree. It is exponentially big, but you can search it in polynomial time.)

?
Problem 8.15

Consider the following two-person version of the language PUZZLE that was described in Problem 7.28. Each player starts with an ordered stack of puzzle cards. The players take turns placing the cards in order in the box and may choose which side faces up. Player I wins if all hole positions are blocked in the final stack, and Player II wins if some hole position remains unblocked. Show that the problem of determining which player has a winning strategy for a given starting configuration of the cards is PSPACE-complete.

Problem 7.28: You are given a box and a collection of cards, each of which fits in the box in either of two ways because of pegs in the box and notches in the cards. Each card contains two columns of holes, some of which may not be punched out. The puzzle is solved by placing all the cards in the box so as to completely cover the bottom of the box (i.e., every hole position is blocked by at least one card that has no hole there). PUZZLE⁡={⟨c1,…,ck⟩∣each ci represents a card and this collection of cards has a solution}\operatorname {PUZZLE}=\left\{ \left\langle c_{1}, \ldots , c_{k}\right\rangle \mid \text{each } c_{i} \text{ represents a card and this collection of cards has a solution}\right\}.

?
Problem 8.16

Read the definition of MIN-FORMULA in Problem 7.46.

Problem 7.46: Say that two Boolean formulas are equivalent if they have the same set of variables and are true on the same set of assignments to those variables (i.e., they describe the same Boolean function). A Boolean formula is minimal if no shorter Boolean formula is equivalent to it. MIN-FORMULA is the collection of minimal Boolean formulas.

?
(a)

Show that MIN-FORMULA ∈\in PSPACE.

(b)

Explain why this argument fails to show that MIN-FORMULA ∈\in coNP: If ϕ∉MIN⁡−\phi \notin \operatorname {MIN}- FORMULA, then ϕ\phi has a smaller equivalent formula. An NTM can verify that ϕ∈ MIN-FORMULA ‾\phi \in \overline{\text{ MIN-FORMULA }} by guessing that formula.

Problem 8.17

Let AA be the language of properly nested parentheses. For example, (()) and (()(()))() are in AA, but)( is not. Show that AA is in L.

?
Problem 8.18
  • Let BB be the language of properly nested parentheses and brackets. For example, (()()[])is in BB but ([)] is not. Show that BB is in L.
?
Problem 8.19
  • The game of Nim is played with a collection of piles of sticks. In one move, a player may remove any nonzero number of sticks from a single pile. The players alternately take turns making moves. The player who removes the very last stick loses. Say that we have a game position in Nim with kk piles containing s1,…,sks_{1}, \ldots , s_{k} sticks. Call the position balanced if each column of bits contains an even number of 1s when each of the numbers sis_{i} is written in binary, and the binary numbers are written as rows of a matrix aligned at the low order bits. Prove the following two facts.
?
(a)

Starting in an unbalanced position, a single move exists that changes the position into a balanced one.

(b)

Starting in a balanced position, every single move changes the position into an unbalanced one.

Let NIM⁡={⟨s1,…,sk⟩∣each si is a binary number and Player I has a winning strategy in the Nim game starting at this position}\operatorname {NIM}=\left\{ \left\langle s_{1}, \ldots , s_{k}\right\rangle \mid \text{each } s_{i} \text{ is a binary number and Player I has a winning strategy in the Nim game starting at this position}\right\}. Use the preceding facts about balanced positions to show that NIM⁡∈ L\operatorname {NIM} \in \mathrm{~ L}.

Problem 8.20

Let MULT⁡={a#b#c∣a,b,c are binary natural numbers and a×b=c}\operatorname {MULT}=\left\{ a \# b \# c \mid a, b, c\text{ are binary natural numbers and }a \times b=c\right\}. Show that MULT ∈L\in \mathrm{L}.

?
Problem 8.21

For any positive integer xx, let xRx^{\mathcal{R}} be the integer whose binary representation is the reverse of the binary representation of xx. (Assume no leading 0s in the binary representation of xx.) Define the function R+:N⟶N\mathcal{R}^{+}: \mathcal{N} \longrightarrow \mathcal{N} where R+(x)=x+xR\mathcal{R}^{+}(x)=x+x^{\mathcal{R}}.

?
(a)

Let A2={⟨x,y⟩∣R+(x)=y}A_{2}=\left\{ \langle x, y\rangle \mid \mathcal{R}^{+}(x)=y\right\}. Show A2∈ LA_{2} \in \mathrm{~ L}.

(b)

Let A3={⟨x,y⟩∣R+(R+(x))=y}A_{3}=\left\{ \langle x, y\rangle \mid \mathcal{R}^{+}\left(\mathcal{R}^{+}(x)\right)=y\right\}. Show A3∈ LA_{3} \in \mathrm{~ L}.

Problem 8.22
?
(a)

Let ADD⁡={⟨x,y,z⟩∣x,y,z>0 are binary integers and x+y=z}\operatorname {ADD}=\left\{ \langle x, y, z\rangle \mid x, y, z>0\text{ are binary integers and }x+y=z\right\}. Show that ADD⁡∈ L\operatorname {ADD} \in \mathrm{~ L}.

(b)

Let PAL-ADD⁡={⟨x,y⟩∣x,y>0 are binary integers where x+y is an integer whose binary representation is a palindrome}\operatorname {PAL-ADD}=\left\{ \langle x, y\rangle \mid x, y>0\text{ are binary integers where }x+y\text{ is an integer whose binary representation is a palindrome}\right\}. (Note that the binary representation of the sum is assumed not to have leading zeros. A palindrome is a string that equals its reverse.) Show that PAL-ADD ∈L\in \mathrm{L}.

Problem 8.23
  • Define UCYCLE⁡={⟨G⟩∣G is an undirected graph that contains a simple cycle }\operatorname {UCYCLE}=\left\{ \langle G\rangle \mid G\text{ is an undirected graph that contains a simple cycle }\right\}. Show that UCYCLE ∈L\in \mathrm{L}. (Note: GG may be a graph that is not connected.)
?
Problem 8.24
  • For each nn, exhibit two regular expressions, RR and SS, of length poly⁡(n)\operatorname {poly}(n), where L(R)≠L(S)L(R) \neq L(S), but where the first string on which they differ is exponentially long. In other words, L(R)L(R) and L(S)L(S) must be different, yet agree on all strings of length up to 2ϵn2^{\epsilon n} for some constant ϵ>0\epsilon >0.
?
Problem 8.25

An undirected graph is bipartite if its nodes may be divided into two sets so that all edges go from a node in one set to a node in the other set. Show that a graph is bipartite if and only if it doesn't contain a cycle that has an odd number of nodes. Let BIPARTITE ={⟨G⟩∣G is a bipartite graph }=\left\{ \langle G\rangle \mid G\text{ is a bipartite graph }\right\}. Show that BIPARTITE ∈\in NL.

?
Problem 8.26

Define UPATH to be the counterpart of PATH for undirected graphs. Show that  BIPARTITE ‾≤L\overline{\text{ BIPARTITE }} \leq_{\mathrm{L}} UPATH. (Note: In fact, we can prove UPATH ∈L\in \mathrm{L}, and therefore BIPARTITE ∈L\in \mathrm{L}, but the algorithm [62] is too difficult to present here.)

?
Problem 8.27

Recall that a directed graph is strongly connected if every two nodes are connected by a directed path in each direction. Let

 STRONGLY-CONNECTED ={⟨G⟩∣G is a strongly connected graph }.  \text{ STRONGLY-CONNECTED }=\left\{ \langle G\rangle \mid G \text{ is a strongly connected graph }\right\} \text{. }

Show that STRONGLY-CONNECTED is NL-complete.

?
Problem 8.28

Let BOTH⁡NFA ={⟨M1,M2⟩∣M1 and M2 are NFAs where L(M1)∩L(M2)≠∅}\operatorname {BOTH}_{\text{NFA }}=\left\{ \left\langle M_{1}, M_{2}\right\rangle \mid M_{1} \text{ and } M_{2} \text{ are NFAs where } L\left(M_{1}\right) \cap L\left(M_{2}\right) \neq \emptyset \right\}. Show that BOTH⁡nfa \operatorname {BOTH}_{\text{nfa }} is NL-complete.

?
Problem 8.29

Show that ANFA A_{\text{NFA }} is NL-complete.

?
Problem 8.30

Show that EDFA E_{\text{DFA }} is NL-complete.

?
Problem 8.31
  • Show that 2SAT is NL-complete.
?
Problem 8.32

Let CNF⁡H1={⟨ϕ⟩∣ϕ is a satisfiable cnf-formula where each clause contains any number of positive literals and at most one negated literal. Furthermore, each negated literal has at most one occurrence in ϕ}\operatorname {CNF}_{\mathrm{H} 1}=\left\{ \langle \phi \rangle \mid \phi \text{ is a satisfiable cnf-formula where each clause contains any number of positive literals and at most one negated literal. Furthermore, each negated literal has at most one occurrence in }\phi \right\}. Show that CNF⁡H1\operatorname {CNF}_{\mathrm{H} 1} is NLcomplete.

?
Problem 8.33
  • Give an example of an NL-complete context-free language.
?
Problem 8.34

ᴬ Define CYCLE⁡={⟨G⟩∣G is a directed graph that contains a directed cycle }\operatorname {CYCLE}=\left\{ \langle G\rangle \mid G\text{ is a directed graph that contains a directed cycle }\right\}. Show that CYCLE is NL-complete.

?