Problems
[27/89%]Let . Show that PSPACE.
A ladder is a sequence of strings , 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 . Show that is in PSPACE.
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 board. Let
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 PSPACE.
Show that if every NP-hard language is also PSPACE-hard, then PSPACE = NP.
Show that restricted to formulas where the part following the quantifiers is in conjunctive normal form is still PSPACE-complete.
Define . Show that is PSPACE-complete.
- 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).
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.)
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). .
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.
Show that MIN-FORMULA PSPACE.
Explain why this argument fails to show that MIN-FORMULA coNP: If FORMULA, then has a smaller equivalent formula. An NTM can verify that by guessing that formula.
Let be the language of properly nested parentheses. For example, (()) and (()(()))() are in , but)( is not. Show that is in L.
- Let be the language of properly nested parentheses and brackets. For example, (()()[])is in but ([)] is not. Show that is in L.
- 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 piles containing sticks. Call the position balanced if each column of bits contains an even number of 1s when each of the numbers 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.
Starting in an unbalanced position, a single move exists that changes the position into a balanced one.
Starting in a balanced position, every single move changes the position into an unbalanced one.
Let . Use the preceding facts about balanced positions to show that .
Let . Show that MULT .
For any positive integer , let be the integer whose binary representation is the reverse of the binary representation of . (Assume no leading 0s in the binary representation of .) Define the function where .
Let . Show .
Let . Show .
Let . Show that .
Let . (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 .
- Define . Show that UCYCLE . (Note: may be a graph that is not connected.)
- For each , exhibit two regular expressions, and , of length , where , but where the first string on which they differ is exponentially long. In other words, and must be different, yet agree on all strings of length up to for some constant .
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 . Show that BIPARTITE NL.
Define UPATH to be the counterpart of PATH for undirected graphs. Show that UPATH. (Note: In fact, we can prove UPATH , and therefore BIPARTITE , but the algorithm [62] is too difficult to present here.)
Recall that a directed graph is strongly connected if every two nodes are connected by a directed path in each direction. Let
Show that STRONGLY-CONNECTED is NL-complete.
Let . Show that is NL-complete.
Show that is NL-complete.
Show that is NL-complete.
- Show that 2SAT is NL-complete.
Let . Show that is NLcomplete.
- Give an example of an NL-complete context-free language.
ᴬ Define . Show that CYCLE is NL-complete.