|
| Q1: Is it ok if we in our FO proofs we use the macros we described in class? For example (a -->b) is equivalent to (not a V b) and likewise the conversion from universal to existential forms. If so, what is the correct justification. Is it just a tautology because we know they're equivalent forms? |
| A1: Yes, feel free to make these substitutions. The justification, for example, for replacing a→ b by ¬ a ∨ b would be "definition of→", although you could also justify this by the fact that (a→ b) → ( ¬ a ∨ b) is an instance of Axiom 0. Similary you could replace ∃ x ( A(x)) with ¬ ∀ x ( ¬ A(x)) and the justification would be "definition of ∃". Given all our meta rules, you don't need to use these substitution rules, but you may. |
| Q1: By "∃ has a winning strategy" on slide 22 you mean that "∃ can always win no matter what the other player (called ∀) does". Am I right ?. The reduction from QSAT then totally makes sense. |
| A1: Yes, that's right. Geography is a finite game of perfect information, so one of the two players always has a winning strategy, i.e., a strategy that is guaranteed to win regardless of how the opponent plays. The question is who has the winning strategy. |
| Q1: You did not cover the slides beyond 12 in lecture 21. I am wondering if that will be part of the exam or not ? (Complexity classes CRAM, ASPACE, bounded number of alternations etc in particular)? |
| A1: You're right, there was a bunch of material in lecture 21 that I didn't get to. This was a survey of some topics in parallel complexity classes. I will mostly only want you to know about things that I have given you homework on, and this doesn't include CRAMs, but it does include PH, and some of the circuit complexity classes. I'll try to make it clear in the study guide for the final what I want you to study. |
| Q1:
I am stuck in one small aspect for question 4a in hw 10. Namely, I don't know how to enforce that some row (first column) in the tiling table does indeed contain the final configuration of the encoded TM. Without this constraint I can't conclude that a successful tiling implies that the string is accepted by the TM. I am wondering if you could give me a small hint on how to go about thinking this. I am trying to have the first tile f(1,1) = t1 somehow encode this for me, but have not able to do it yet. I also tried to add row number information to each tile, but this blows up the number of times exponentially and my reduction is no longer in logspace. So this approach is clearly not right. |
| A1:
That's a good question. Let's think about part (b). Fix an
NTIME[nk] TM, N, and let w be an arbitrary input, and
let n = |w|. You want to construct a tiling problem,
f(w) = T, H, V, 1r such that r is nO(1), and
f(w) is in UNARY-TILING iff w is in L(N). I suggest that you modify N to N' so that its computation on input w can fill up the r × r space iff w is in L(n) = L(N'). A hint is that N' can count up to nk and it can see whether or not it is in an accept state. |
| Q2:
For problem 2, does the reduction have to be in logspace or a polynomial-time reduction suffices? I have some trouble doing the reduction in logspace when the source s of |
| A2: I do want you to do a logspace reduction because a P reduction could just solve the problem. Remember that the reduction is given an acyclic alternating graph and it wants to produce a monotone circuit. Sinc you are outputting each edge of the circuit, if you don't like edges to s, you can just not output them. |
| Q3: Any hints for question 3? |
| A3:
I will reiterate the hint that I gave at the discussion section and at
my office hour: You want to reduce a 3-CNF boolean formula α to a
first-order sentence ϕ followed by a pad, #^r, such that α
is in 3SAT iff ϕ is valid, and in this case, ϕ has a
first-order proof of length at most r symbols. By the way, you may choose
whatever vocabulary you want for ϕ. Now ϕ is supposed to mean "α is satisfiable". To say that, you'd want ϕ to be talking about a universe with at least two elements -- for the boolean values 0 and 1. I suggest that you write your formula ϕ ≡ (there is only one element in the unverse) or (there are at least two elements in the universe and α is satisfiable). Finally, once you have ϕ, you want to show that if α is satisfiable, then ϕ has a short first-order proof. So assume that you have a satisfying assignment for α and see how you would turn that into a proof for ϕ. Feel free to use meta theorems as you are describing the construction of the proof. Finally, how much longer would the first-order proof have to be if you weren't allowed to use meta theorems. (This involves going back to the proof of the validity of the metatheorems -- almost all by induction on the length of a given proof, and seeing that the first-order proofs that we constructed are not much longer.) |
| Q1: We know that REACH is complete for NL, but is bar(REACH) complete for co-NL? |
| A1: Good question. You should be able to figure this out yourself, recalling that a reduction from A to B is also a reduction from bar(A) to bar(B). |
| Q1: When did we define log(CFL)? I can't seem to find it in the notes. |
| A1:
I haven't talked about log(CFL) much if at all yet. log(CFL) = { A | for some CFL, S, A ≤ S} This is the set of problems that are (logspace) reducible to some CFL. Since CFL is not closed under basic operations such as intersection, log(CFL) is a more robust class than CFL. log(CFL) is closed under reductions of course. Much less obviously, it is also closed under intersection and complementation, and has several elegant characterizations that I'll try to get to later when discussing parallel complexity classes. |
| Q1: Suppose, k = max (highest arity of functions, highest arity of relations). Is it OK if I show that problem 4 can be solved using at most klogn space? I guess that since the vocabulary is fixed and finite in this problem, k is also fixed, i.e, constant. So,DSPACE[klogn]=L. Am I right? |
| A1:
Yes, you are right, the vocabulary is fixed. In fact, the arity
affects the size of the input. If the
universe has n elements and the maximum arity is k, then the
size of the binary encoding of an input structure is O(nk) (if there
are no function symbols of arity k, o.w., O(nk log n)). Since log(nk log n) = O(log n), the arity issues do not cause serious problems. |
| Q1: Just to make sure I got the reach reduction mentioned on slide 8 in today's class. The only property we are using of A being in logspace is that the # of scratch tape configurations is bounded by |w|. Hence we only need log|w| bits to go through all the vertices while deciding whether or not there is an edge b/w (ID_i, ID_j). So this reduction would not be in logspace if A was say in PSPACE, then the reduction function would take PSPACE (exponential time) and hence it won't be in F(L). I am wondering if I got this right ? |
| A1: The key points for the reduction is that the ID of the logspace machine N accepting A, on input w, with n = |w|, can be written with O(log n) bits. Thus, the DSPACE[log n] machine computing the reduction, on input w, can cycle through all possible pairs of ID's: (ID1,ID2) and output those pairs that are edges in CompGraph(N,w). As you say, if N was a PSPACE TM, then its ID's would require polynomial space, so a DSPACE[log n] machine could not cycle through all possible pairs of ID's. |
| Q2: Could you please repeat the reason why DTIME is treated differently for Hierarchy theorems. In other words, why can't we do more problems by going from DTIME(n) to DTIME(n log n). |
| A2: The diagonalization that we do to prove the DSPACE hierarchy theorem is efficient, i.e., we can simulate a DSPACE[g(n)] machine with O(g(n)) bits of space. To simulate a DTIME[t(n)] machine that has k+1 work tapes via a DTIME machine with only k tapes seems to require O(t(n) log(t(n)) time. Note that one fixed machine with a fixed number, k, of tapes is require to diagonalize against all DTIME[t(n)] machines. If we just restricted attention to machines with only k tapes, then the DTIME-k-tape hierarchy is strict. |
| Q3: The reason we want f to be DSPACE constructible in the space hierarchy theorem, is because we want to be able to calculate f(n) "without using more than f(n) space.". Am I right ?. Can you give me an example of a function that will not be f-space constructible ?. Is the σ(n) [busy beaver function] space constructible ? |
| A3: You are right. The busy beaver function is not even computable, so it doesn't really make sense to talk about whether it is space constructible, but your insight is good: we can diagonalize against tape constructible Turing machines to produce a not very large function that is not tape constructible. I'll think about presenting one for you. The intuition though is that not being tape constructible is WEIRD. |
| Q4: In the proof for Space hierarchy theorem: w' \in L(D) can also be true if M_w' (w') needs more time or space (line 3). In that case how can we say that w' \notin L(M_w') ?. In other words why can't M_{ w' } not take more than f(n) space ?. I understand that M_w can't take more than f(n) space (as we claim that M_w uses at max c.g(n) space). But I don't see why the same should also hold for M_{w'}. |
| A4: I didn't have time to explain this in class and will explain in the discussion section today. The answer is that the TM state diagram w' is exactly the same as w but it has lots of extra, non-reachable states, enough that |w'| > N. Thus, Mw' uses at most cg(n) bits of space for inputs of size n, exactly the same as Mw. Thus, on input w', D's simulation of Mw'(w') succeeds and D does the opposite of what Mw'(w') does. Thus, as desired, w' is in L(D) iff w' is not in L(Mw). |
| Q1: I didn't understand how we prove that the set S in Godel's incompleteness Thm is RE. Particularly when Γ can be infinite. I am wondering if you could sketch out that proof a bit. Thanks. |
| A1: We showed in slide 4 of Lecture 13 that FO-THM is r.e. because we can list out all valid first-order proofs, and thus list out their final statements. The same idea shows that if Γ is r.e., then we can list out all formulas ϕ such that Γ ⊢ ϕ: the idea is that we can eventually list out all of Γ, and thus all valid proofs that use assumptions from Γ. It follows that S = {n | Γ ⊢ ¬ ϕK(n) } is an r.e. subset of bar(K). |
| Q2: I also am a bit confused about why we place FO-Sat in co-Recomplete ?. (I understand that FO-Valid/Theorem are in RE-complete). |
| A2:
We showed that FO-Valid = FO-Thm is r.e. complete. We also proved
that FO-Valid and FO-Unsat are equivalent, i.e., reducible to each
other with the reduction f(α) = ¬α. Thus FO-Unsat is r.e. complete. Thus it's complement, FO-Sat, is co-r.e. complete. |
| Q3: To conclude today's lecture. Can we say something about the power of FO vis-a-vis turing machines. Is FO equally powerful as TM ? (You hinted to this in the initial part of the course). But then, we showed that some problems (like graph reachability etc) cannot be expressed using FO logic. So, I am a bit confused about how FO logic relates to TM. |
| A3:
Good question. What we showed in Lecture 15 is that every r.e. set,
Wi, is representable by a bounded formula ϕi, and thus n ∈ L(Mi)      ⇔      ⊢ NT → ϕi(n) Thus checking if a Turing machine accepts an input is the same thing as checking if a corresponding first-order formula is valid. That is one way of seeing that proving first-order theorems and doing computation is closely tied. Concerning expressing properties in logic, we will see more later concerning descriptive complexity -- the close relationship between the computational complexity of a problem and the richness of a logical language needed to express the problem. |
| Q1: In the hint for Problem 2, you said that we should assume that x^A = x^B for free variables in \phi. This does not follow from the definition of substructures but is an additional assumption you added specifically for this problem. Am I right? Thanks, |
| A1: Yes, you are right, thanks for pointing this out. The point is that we mostly want to prove (b) and (c) for sentences ϕ, but the easiest way to do this is to make our assumption stronger and then prove (a), (b), and (c) for formulas as well as sentences. |
| Q2: For Problem 3, could you remind me of the definition for two first-order formulas being logically equivalent? I couldn’t find it in the notes. |
| A2: Formulas \phi and \psi are logically equivalent iff they have exactly the same meaning in all structures, i.e., ⊢ ϕ ↔ ψ . |
| Q3:
In question 4, can we make the following simplifications to our proof: + By first showing some lemma is FO - provable and then using that lemma in our proof ? + By assuming that some basic things like: if a is true, b is true -- then a ∧ b is true, without explicitly writing the AX0 axiom each time for this. ? |
| A3:
Yes to both questions. Your second example is the natural deduction
∧-introduction rule. You may use any
natural deduction rules -- see: www.cs.umass.edu/ immerman/cs601/naturalDeductionRules.pdf |
| Q4: For problem 4 can we apply/undo abbreviations directly as a step in the proof. For instance, can we turn (¬ a ∨ b) into (a → b), or ∃ x(a) into ¬ ∀ x (¬ a)? |
| A4: Yes, you may: justify such changes as "abbrev". |
| Q1: Is there a deeper reason why the symbol for "semantically implies" is identical to the symbol of "satisfies / models" ? |
| A1: Yes, they are both semantic notions, i.e., having to do with when something is true. Once we have proved the completeness theorem which says that Γ ⊨ ϕ iff Γ ⊢ ϕ, we will use the latter symbol instead. |
| Q2: In the recognizer to show that the set of FO-Theorems is RE (slide 4) -- Shouldn't we be returning 1 only when the S is a correct FO proof "for the given theorem ϕ". It seems we are outputting lastLine(S) regardless of whether or not S is for ϕ. Why ? |
| A2: In the proof I describe a Turing machine that prints out exactly all elements of FO-Theorems, thus showing that FO-Theorems is r.e. As in the proof of the Fundamental Theorem of RE Sets, from Lecture 7, we could then build a recognizer for FO-Theorems which on input ϕ would systematically search for a FO proof of ϕ and return 1 if it finds such a proof. |
| Q3: I am not sure I understand what is meant by "All generalizations of the following" for the 5 axioms. Does that statement mean that we can quantify / replace free variables in those axioms anyhow we please? |
| A3: For each axiom, α, and each variable, v, ∀ v(α) is also an axiom. |
| Q4: On slide 8 -- what does the word 'intro' mean ?. (I understood the meaning of the statement and its proof, but I don't understand what that ∀ intro means). |
| A4: The name of this meta rule is "∀ intro". It is a meta rule for introducing a forall quantifier, i.e., to prove a formula of the form ∀ x(ϕ). |
| Q5: In slide 8 on lecture 13. Do we require that x does not occur freely in ϕ ?. The statement of the ∀ intro does not say so, but the base case proof uses that assumption. |
| A5: In the base case, when ϕ is in Γ, since x does not occur freely in Γ, it does not occur freely in ϕ. In general, if ϕ is not in Γ then x may occur freely in ϕ and as you guessed, that is the interesting case of the ∀-intro rule. |
| Q1: In 1(a), can the relations A, B be the same? Also, can you give me an example of 1-ary relation? |
| A1:
A and B are two relations symbols, each of arity one. A given
structure, S, may interpret A and B as any relations of arity one
on its universe, i.e., any subset of the universe. S could
interpret A and B as the same relation. For structure S of universe, U = |S|, any subset of U corresponds to a unary relation on S, thus if U is finite with n elements, there are 2^n possible unary relations on U, and if U is infinite then there are uncountably many such relations. |
| Q2: For question 3: If we have an expression A \lor B, Is the set of free variables in (A \lor B) equal to the union of free variables in A and B ?. |
| A2: Yes, exactly: freeVar(α ∨ β) = freeVar(α) ∪ freeVar(β). |
| Q3: In Question 4b -- when you say that Σ is finite -- does that mean that both the sets Φ and Π are finite ?. |
| A3: Yes, when I say Σ is finite I mean that Φ and Π are finite, i.e., there are finitely many function and predicate symbols. (By the way, this problem is still true if Σ is infinite, but there need not any more be a single sentence that gives a complete description of the structure A even though |A| is finite.) |
| Q1: On question 2, I am not clear what it means for a set S of boolean expressions to be satisfiable. |
| A1: It means that one truth assignment, T, satisfies the whole set S of formulas simultaneously. |
| Q2: Q 2b). In the definition of Γi+1, what does THIS refer to? |
| A2: "this set" refers to Γi ∪ {xi}. |
| Q3: In 3c, can the primitive recursive predicate in our solution be a combination of COMP() operations using, for example, boolean operations? |
| A3: Yes, as you suggest, you want to construct appropriate primitive recursive predicates. You may certainly use any closure properties of primitive recursive functions and predicates that we derived in lecture 9. |
| Q4:
Question 3: I am wondering if there are some rules
for moving quantifiers to the front of an expression, for example, in ∀ x ( ∀ y( Q(y,x) ) ∨ ∃ z( P(x,z) ) ), I want to move all the quantifiers to the left so that I can get the formula in the form required for arithmetic hierarchy. |
| A4:
Good question: the main way to move quantifiers out front is to if
necessary change the names of dummy variables so they don't repeat,
and then you can move quantifiers through and's and or's if the
quantified variable is not present on one side, i.e., If x is not in free(α), then Qx(α op β)      is equivalent to     α op Qx(β), where Q ∈ {∀,∃}; op ∈ {∨, ∧}. |
| Q1:
I am a bit confused about how to classify a set S into its proper complexity
class. i. To prove S is not co-RE -- we just need to show that S is RE-Complete. Right ? ii. To show S is recursive -- we should show S is RE, in co-RE _and_ give a function F that will decide (and halt) S. iii. To show S is neither RE nor co-RE -- we need to show that S is RE complete _and_ co-Re complete. Right ? |
| A1:
i: You don't mean "r.e. complete", you mean "r.e. hard". S is
r.e. hard iff all r.e. sets are reducible to S. This is
equivalent to K ≤ S. Suppose for the sake of a
contradiction that S is r.e. hard and S is co-r.e. It then would
follow that all sets reducible to S, including K, are co-r.e. But
we have proved that K is not co-r.e. Thus, if you prove S is
r.e. hard, you may conclude it is not co-r.e.. Similarly, if you
prove S is co-r.e. hard then you know it is not r.e. ii: To show that S is recursive it would be most natural to give an algorithm that always halts and decides S. It does suffice to show that S is r.e. and co-r.e., but that is rarely a natural thing to do. iii: Not quite: from my comment in (i), it does suffice to show that S is r.e hard and co.-r.e. hard. |
| Q2: I have a question in hw4 regarding question 2(b). If Mn diverges for any input, does it belong to Sb? |
| A2: Yes. Sb is the set of n such that for all x, if Mn(x)↓, then Mn(x) = 17. |
| Q3: In several reduction example, you wrote that if Mn(n)=1 then return 'a' else return 'b'. When will b be returned? Is it possible that b will be returned if Mn diverges? |
| A3:
No. More explicilty, in some of the reductions I built in class, I
wrote an algorithm, Mf(n) that gave complete control to another
TM, e.g., as you described above:
on input x: In this case,
if Mn(n) = ↗ then Mf(n)(x) = ↗ |
| Q4: I have a question on notation in homework 4. Three kinds of notations on "Mn" appear in homework and slides, Mn(N), Mn, Mn(x), Mn(.) Could you please clarify their differences? |
| A4:
Thanks for your question. Here are the meanings: Mn is Turing Machine number n, i.e., the Turing Machine whose program is encoded as n. Mn(·) is the partial, recursive function computed by Mn . Mn(x) is the output of Mn when it is started with input x. Mn(N) = {Mn(x) | x in N} is the range of Mn(·) |
| Q1:
In slide 4, I am unable to understand why we return a_0 ( \in S).
I can't see what difference it
would make even if we return something not in S. I understand we must
return something as f must be recursive.
In slide 6 -- is it also okay if we write: On Slide 7: Must a TM explicitly erase its input -- can't it just disregard its input ?. I.e just do whatever it wants without erasing its input ? |
| A1:
In Slide 4, we are required to build a TM Mm whose range is exactly
S, thus everything Mm outputs must be in S and for every element
x in S, there must be some input z such that Mm(z) = x. The need
for a0 is that if Mm has not found an answer in its allowed time
it must give some correct answer and a0 is always
correct. In Slide 6, your program is not correct because if M_r(0) does not halt then we will never look at M_r(1), etc., so you must dovetail, i.e. run M_r on each of its inputs for longer and longer waiting to see if any of them eventually output x. On Slide 7, the reason I say "erase input and write n" is that I am describing a TM that first simulates Mn(n). Of course you could program this one of many ways, but this feels to me like the simplest because here I am explicitly running Mn, just modified so that where Mn would halt it instead goes on to the next stage: "if (M_n's answer is 1) then return(17) else loop". The main point in all of these constructions is that we are given a string encoding some combination of inputs and Turing machine programs, and we do a simple modification of these inputs and programs to get an appropriate input for the problem we are reducing to. Thanks for your questions, I hope this helps. |
| Q2:
I am confused about the reduction of K ≤ A0,17 in slide 8: It says that Mn(n) = 1 iff Mf(n)(0) = 17. What confuses me is the restriction that 0 must be the input. In Mf(n) you erase the input, so it has no effect on the proof. Wouldn't this imply that the above statement is true for all inputs and not just when its 0? |
| A2:
Yes you're right, it is true that Mn(n) = 1 iff ∀ w
(Mf(n)(w) = 17). The reason that I only mention the condition Mf(n)(0) = 17 is that this is exactly the defining condition for f(n) to be a member of A0,17. |
| Q1:
I have a question whether all totally defined functions can be called
computable by a TM or not ? I mean consider a function f defined on all natural numbers. A function is just a mapping that satisfies some constraints. Some of these mappings obey some property (like x -> x**2) or something but not all mappings need to be obey any computable property. So my question is whether all total functions are computable, or is that not necessarily true. ? |
| A1: No, not all total functions are recursive. We will see our first counterexample in Lecture 6. |
| Q2: Small question, I wasn't able to find the sample Bloop programs from question 4 of the new homework. The links seem to be broken. Are they not up on the website yet? How can we obtain them? |
| A2: Sorry, pointers now fixed. |
| Q3:
I have the following questions about question 4: 1. Are these Bloop1, Bloop2 etc different subsets of the Bloop language or do they just define what is allowed and not allowed in Bloop? 2. Are conditions allowed in the Bloop language ?. I mean is branching allowed ? |
| A3:
Bloop1 to Bloop9 give are the axioms defining Bloop. No, there is no explicit branching construct. This at first seems like a very limited language. |
| Q4: I have a question about hw3, 2b. What exactly do you mean by "L"? |
| A4: L = DSPACE[log n], see Lecture 5. |
| Q5: Could you give a formal definition of an encoding? I kind of feel awkward to give a mathematical proof for something not mathematically defined. |
| A5:
Good question. Intuitively an encoding is any reasonable
1:1 function from Turing machines to binary strings. I'll talk about
this in the discussion section tomorrow. We gave one encoding of
Turing machines into binary strings in Lecture 6, call that μ1, and
Papadimitriou gives a similar one in section 3.1. Thus we defined the
Turing machines M0, M1, . . ., via that
encoding, i.e., μ1(M_i) =
i. Now we can formally define an encoding as a total recursive function f: N → {0,1}* that admits a universal TM, Uf, with the property that for all i and w, Mi(w) = Uf(f(i),w), i.e., f(i) is an encoding of Mi that Uf understands. |
| Q6:
I have a question regarding Kolmogorov Complexity. According to the definition given in the book, K(x) = min {|Mj| : Mj(epsilon) = x} But the statement below that states: K(x) is the length of the smallest "program" in our encoding that outputs the string x. They dont talk about the input given to Mj in the statement. I was wondering whether is it necessary that only those TMs which produce x on input "epsilon" should be considered for calculating K(x). |
| A6: Yes. Remember that ε is the empty string, so these are programs that don't need input, or you could think of the program and the input data as one entity and you are measuring the minimum total size needed. |
| Q7: Could you give me any hints on a problem3? |
| A7:
You have to show two things: 1. if S is the range of a non-decreasing total recursive function, f, then S is recursive. Here you should assume that you have the Turing machine that computes f, and show how to design a TM that computes χS: S's characteristic function. 2. if S is non-empty and recursive, then S is the range of a total recursive function. Here you assume that S is non-empty and you have a TM that computes χS, and you want to produce f which enumerates S in non-decreasing order. It might be easier if you separately consider the cases where S is finite and where S is infinite. This question may be challenging if you have not seen this kind of argument before. You might want to take a look in advance at the slides for Lecture 7 which contains some arguments of this kind. |
| Q8:
I have two more questions regarding Kolmogorov
complexity. (1). In A6 above you said "you could think of the
program and the input data as one entity and you are measuring the
minimum total size needed", but then that's different from our
definition of measuring the encoding of TM alone. Are the two definition equivalent? (2). In the definition of an encoding, the universal TM U_f seems to have two input, f(i) and w, but our definition of TM always has one input, right? If U_f has only one input, then we must be doing some implicit transformation from f(i) and w into a new string. What will the definition look like, if we make this transformation explicit? |
| A8:
This is a great question which gets to the heart of the matter, thank you! (1). The definitions: just program, or program and data pair are equivalent, but it is not obvious that they are. The idea is that there is really no way to look at a program and say definitively what is the program part and what is the data part. (2). Our definition is that a TM is given one string as its input. Except in Kolmogorov complexity where we are counting number of bits, we could encode a pair of inputs in any simple way, e.g., having an input alphabet with symbols 0,1,# where # is a separator; or as we usually do in 601, interpreting an input string w as the pair P(x,y) and separating it that way. However, in Kolmogorov complexity we encode everything in binary so the above two definitions are both unacceptably wasteful. To do part (a) of this problem, you need to create an encoding that is optimal up to an additive constant with respect to the data. It can be suboptimal with respect to program size. This question turned out to be more subtle than I had intended, so I am changing part (a) of question 1 to be "extra credit". |
| Q9: have a small question: In the axiom 7 of Bloop, it is said that assignment can only be in the form of v=f(u1,u2...,uk), i.e, variables can only be assigned with a return value of a function. But in the example (bloop1.rb), the variable ans is assigned as "ans=1",which is an assignment of a constant to a function. I am a little bit confused. |
| A9:
You are absolutely right, thanks for noticing this.
We have the constant function, 0, and the successor function, so to be completely within the rules instead of "ans=1" I should have written the following two lines, or defined the constant function 1.
ans = 0 Thank you for pointing this out. |
| Q1:
In the textbook it says that the space consumed by a TM is the number
of cells written to the scratch tapes, whereas you defined the space
to be number of cells 'accessed'. Are the two equivalent or should we follow one definition over the other ?. |
| A1: Thank you very much for pointing out this difference. I would rather go with my very slightly more restrictive definition: we count work tape cell that we access. The two definitions are actually equivalent in terms of what is computable in DSPACE[s(n)], but I prefer mine because we know that an s(n) space TM visits at most O(s(n)) work tape cells, so it is a bit simpler to describe its instantaneous description (ID). |
| Q1: What is R in question #3 in HW 2? A regular language or a constant? |
| A1: Thanks for your question. By wR, I mean the string w reversed, e.g. (abb)R = bba. |
| Q2:
I have questions regarding problem 1. a) Why is the language defined as ww, why not w^2? Is there any difference between these two? b) If w=a^n or b^n, then ww can be generated by some CFG. So, when we shall do case analysis using pumping lemma, is it OK that some cases might pass? To put it differently, is it necessary to show that all cases contradict the hypothesis that the language is CFL? |
| A2:
a) Usually I use exponents just for single letters, e.g. a2 = aa.
Technically I suppose you could write (w)2 for ww, but it is usually
not done. b) When using the CFL pumping lemma, YOU choose the string z in the language, of length at least n. Only a good choice of z will lead to a contradiction. |
| Q3: I am wondering if the question 8 has anything to do with CFL's at all, or am I missing something ?. |
| A3: No question 8 does not concern CFLs, but it will be very useful when we get to recursive function theory. |
| Q4: A generic question about PDA's: whenever a PDA reads an input symbol, can it pop or push more than one symbol from the stack alphabet or must it be exactly one symbol? |
| A4: The way we defined PDAs in class, a PDA has a fixed, finite set of possible transitions which may include reading zero or more input symbols, popping zero or more symbols from the stack, and then pushing zero or more symbols on the stack. Many people define PDA's in a more restrictive way, where they can only read, push, or pop a single symbol at a time. However, since a PDA may make epsilon transitions, by increasing the number of states it can chain together a series of pops and pushes while reading a single symbol from the input. |
| Q1:
I have a question about the format of homeworks: When there is a
question in the HW which we were not able to cover in the class until
the HW is due, will that question still be graded? I guess I am asking if say -- we are not able to cover the pumping lemma by Friday, will we still be supposed to do questions on the pumping lemma in HW1 ? PS: Is there a mailing list for the course -- cs601@cs.umass.edu or something similar ?
|
| A1:
Hi. Good question. The beauty of having the discussion section on
Friday is that I can make sure that by then anything needed for the
homework will be covered. I will go over the pumping lemma for
regular sets in the
discussion section this Friday. There is no course mailing list, but I will post useful questions and answers on http://www.cs.umass.edu/~immerman/cs601/qa.html
|
| Q2: Hi, I am wondering if for question 3 and 4a, we also need to prove whether L(D) = target language ? |
| A2: The answer is yes, but the proof does not have to terribly formal. In both of these questions I am asking you to show that a language, T, is regular. You will do this by coming up with a finite automaton, M, for which L(M) = T. You should give a convincing argument why L(M) = T. It does not have to be a detailed proof. |
| Q3: I have question on problem 2: can you say what you mean by "linear algorithm"? |
| A3: Think of the input DFA as a graph -- represented by adjacency lists -- with the edges labeled by letters from Σ. There are n = |Q| vertices, and m = n|Σ| edges. I am thinking of the standard unit cost RAM model of computation in which the computer word size is O(log n) bits and you can read and write any memory word in constant time. This is the standard model where graph algorithms are studied and analyzed in an algorithms course. Linear in this case means linear in the size of the input, i.e., O(n + m). |