Chapter 8: Q18P (page 359)
Let B be the language of properly nested parentheses and brackets. For example,is in B but is not. Show that B is in L.
Short Answer
Every pair of matching parentheses or the brackets must be of the same kind.
Chapter 8: Q18P (page 359)
Let B be the language of properly nested parentheses and brackets. For example,is in B but is not. Show that B is in L.
Every pair of matching parentheses or the brackets must be of the same kind.
All the tools & learning materials you need for study success - in one app.
Get started for freeAn 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 Show that BIPARTITE NL.
For any positive integer x, let xR be the integer whose binary representation isthe reverse of the binary representation of x. (Assume no leading in the binary representation of x.) Define the function where
a. Let .
Show
b. Let . Show.
Show that is NL-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).
Are respectively a graph and positions of the Cat, Mouse, and Hole, such that Cat has a winning strategy if Cat moves first}.
Show that is in . (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.)
For each , exhibit two regular expressions, , of length , where, but where the first string on which they differ is exponentially long. In other words, must be different yet agree on all strings of length up to for some constant .
What do you think about this solution?
We value your feedback to improve our textbook solutions.