CMPSCI 601: Theory of Computation

David Mix Barrington

Fall, 2003

Here are questions and answers on HW#3, due Mon 20 October 2003. Questions are in black, answers in blue.

Question 7, 17 October 2003

In the "question and answer" section, you mention that for Q3 of HW3, '... "multiplication" is defined by the groupoid table rather than by ordinary multiplication of binary numbers.."

Does this mean that the groupoid table already contains the answers for each possible parentsized w and we have to somehow figure out a process that woud decide what parenthesization of w genrates 't' by looking up the table ? OR if its empty to start with, then is this table to be used in some other way ?

No, the groupoid table tells you what x times y is for every pair of elements x and y in the groupoid. If you want to know what x*((y*(w*u))*v) is you would have to look up w*u, then look up y times that, and so forth.

Question 6, 17 October 2003

In question 1, can you please clarify how the "length" of a boolean expression is measured?

The expression is a string, so it's the number of characters in the string. This is Theta of the number of occurrences of variables in the expression, which would be the number of leaves in the natural circuit. It's also Theta of the number of variables, constants, and operators in the expression, which is the number of gates in the natural circuit.

You can have a recursive definition of this last version of length, which is probably the most useful one:


length (variable) = 1
length (constant) = 1
length (s and t)  = length (s or t) = length(s) + length(t) + 1
length (not s)    = length(s) + 1

In question 1, would it help to convert the boolean circuit into a Turing machine?

Not that I can see. It might or might not help to think of an SLP.

In slides 13 through 15 of Lecture 10, can you give a sample SLP for each of the circuits?


Slide 13:

gate 1 = input 1
gate 2 = input 2
gate 3 = input 3
gate 4 = input 4
gate 5 = not gate 2
gate 6 = not gate 3
gate 7 = gate 1 or gate 5
gate 8 = gate 5 or gate 3
gate 9 = gate 2 or gate 6
gate 10 = gate 6 or gate 4
gate 11 = gate 7 and gate 8
gate 12 = gate 9 and gate 10
gate 13 = gate 11 or gate 12

Slide 14:

same except for:

gate 3 = true
gate 4 = false

Slide 15:

same as slide 14 except for

gate 1 = true
gate 2 = false

In question 3, does the input string w consist of zeroes and ones that are to be interpreted as binary numbers that multiply to a target element t with the correct parenthesization?

Yes, except that the "multiplication" is defined by the groupoid table rather than by ordinary multiplication of binary numbers. The elements of w in general can be multiplied together in many different parenthesizations, and the GMP problem is to determine whether any of these parenthesizations yield t.

On slide 13 of Lecture 27, there is a list of some complete problems for each complexity class that might be useful for doing reductions. Is there a more extensive list of complete problems available online, or in some reference book?

There are literally whole books with complete problems for NP (Garey and Johnson) and for P (Greenlaw, Hoover, and Ruzzo). The list I gave you should be pretty much what you need for this course. I don't know of a better list of complete problems online, though you might have a look at Scott Aaronson's "Complexity Zoo".

In question 1 of (the solutions to) Homework 2, is ATM just another name for HALT (the halting problem)?

ATM, following Sipser, is defined to be {(M,w): w is in L(M)}. This is one possible definition of HALT, different books use slightly different ones. I'll be pretty careful about defining things in problems, and you should know the definition you mean when you use a named class.

Question 5, 17 October 2003

In Q2-b of HW3 the question states "gate[i] = gate[j] XOR gate[k] where j and k < 1" Is that correct or will it be j and k < i ?

You're right, it should say "less than i".

I'll fix this right away, thanks.

Question 4, 16 October 2003

In the SLP on the slide 16 of lecture# 10, can we say that NOT GATE[1] is different from GATE[1] and similarly NOT GATE[2] is different from GATE[2] ? Therefore the given SLP is read-once becuase all gates appear only once ?

No. Gate 3 is a NOT gate that has gate 1 as an input. Gate 5 also has gate 1 as an input. So this circuit is certainly not read-once.

Question 3, 16 October 2003

In Q4 of HW3, we need to show U(n), A(n),D(n) and Z(n) are decidable by a QM.

I have a question on the languages U(n) D(n) and Z(n).

To show U(n) is decidable by some QM, (a) is it enough to show that if each of the IDs in the i/p string does not have a head symbol, a state and a content bounded by a marker it's invalid ? OR (b) do we need to show that every odd id is written in reverse order ?

If we indeed have to show (b) for U(n), then isn't it similar to language D(n) where we show that ID_i goes to ID_i+1 ? i.e. any string w not having the form "ID_i goes to ID_i+1" will necessarily not have the form ID_0#...ID_t ?

And does Z(n) implies that any string should end with a 1 ?

The reverse-order thing goes away with a queue machine, you just redefine the language so they're all in the same order.

Since a queue machine can simulate a DFA, the three of those four languages that are regular are no problem, you just have to worry about the next-configuration one.

Yes, being in Z(n) forces your string to end in a particlar way.

Question 2, 16 October 2003

I am kind of confused regarding the relation between boolean expression/function/circuits.

if we have two boolean variables A and B and then say we have the following:

> (A.B)+(A'.B).

1. if this is a boolean expression, then what would be the corresponding boolean function (say f) ?

Assuming you mean (A and B) or ((not A) and B), this is a function with two boolean inputs and one boolean output. The inputs are A and B and f(A,B) is what you get by evaluating the expression.

2. if I just create a boolean circuit (using gates) that will evaluate the expression does that mean it computes f ?

Yes, there is a natural circuit evaluating a boolean formula. It computes the function of the formula.

In question 1, though, you are given a _circuit_ and asked to make a formula. Here's an example of a circuit that doesn't correspond directly to a formula:

gate 1: input x_1
gate 2: input x_2
gate 3: gate 1 or gate 2
gate 4: not gate 2
gate 5: gate 1 and gate 4
gate 6: gate 3 and gate 5

3.what is meant by length of a boolean expression ?

The number of occurrences of variables, which is the number of input gates in the natural circuit. For example, in your formula above A and B occur twice each so the length is 4.

(Also see the answer to question 6 above)

Question 1, 13 October 2003

Q3. Can you give more information on the four langugaes described in slide 11 of Lecture #9. What they stand for, how to validate them (criteria for acceptance).

The overall idea here is that any string that is _not_ an accepting computation of M_n must fail to be an accepting computation in one of four ways. Each of the four possibilities can be detected by a PDA, so the language of strings that aren't accepting computations is a CFL.

An ID is a string of tape letters with one state letter (the instantaneous description of a TM. The language of ID's is regular, something like (tape letters)^*(state letters)(tape letters)^* with details depending on exactly how we encode configurations. Define ID_n to be the set of valid ID's for M_n. Note that here we don't have to worry about the fact that every other ID is written backwards, because this language ID_n is closed under reversal.

So the language U(n) is the complement of ((ID_n)#)^*(ID_n), a regular language. The DFA for it is essentially checking that there is exactly one state letter between each two consecutive "#"'s, with tape letters in between.

The initial configuration of M_n (on blank input) is a particular string, call it w. Then the language A(n) of strings that don't start with w is the complement of w(Sigma)^*, clearly a regular language.

Similarly Z(n), the set of strings that don't end with the final accepting ID, is also regular. (We'd better assume that M_n always takes an even number of moves so we can assume that this last ID is written forwards.

The most interesting of the four languages is D(n). It's the set of strings that contain a subsequence of the form (ID_1)#(ID_2) where ID_2 is _not_ the reversal of the ID that should follow from ID_1 in one step according to the rules of M_n.

There is a PDA that accepts a string only if it has such a subsequence. To have a bad subsequence, there has to be a three-letter sequence of the string, some number of letters, a #, the same number of letters, then a three-letter sequence that is not the one that follows from the first one.

The PDA is designed so that it has a way to accept iff this happens. (Remember that the pda is nondeterministic.) It "guesses" where the three-letters are, remembers them, puts the next k letters on the stack, reads the #, reads the next k letters counting them against the stack, then reads the next three letters and verifies that they don't follow from the first three.

We could make a single PDA who language is the union of these four languages, because CFL's are closed under union.

Also QM enqueues and dequeues, does it follow LIFO or FIFO?

A queue is always FIFO -- if it's LIFO then it's a stack.

Last modified 17 October 2003