GATE Computer ScienceVery hardGATE CS (PYQ pattern)
For the CNF grammar S → AB | BC; A → BA | a; B → CC | b; C → AB | a, the CYK table for the string aabab has a top cell (the whole string). Which variables does that cell contain?
- A. { S, A, C }
- B. { A, B, C }
- C. { S, C }
- D. ∅
Correct answer: C. { S, C }
Computing all split points for the substring of length 5 with the table of shorter substrings leaves exactly { S, C } in the top cell.
More Theory of Computation questions
- A TM (blank B, start q0 on the leftmost cell, halting state qa) has rules: δ(q0,1) = (q0,1,R); δ(q0,0) = (q1,1,R); δ(q1,1) = (q1,1,R)…
- For the TM with rules δ(q0,1) = (q0,1,R); δ(q0,0) = (q1,1,R); δ(q1,1) = (q1,1,R); δ(q1,B) = (q2,B,L); δ(q2,1) = (qa,B,R) (start q0 on the…
- A TM with rules δ(q0,a) = (q1,X,R); δ(q0,Y) = (q3,Y,R); δ(q1,a) = (q1,a,R); δ(q1,Y) = (q1,Y,R); δ(q1,b) = (q2,Y,L); δ(q2,a) = (q2,a,L)…
- A single-tape TM (blank B, start q0 on the leftmost cell, accepting state qa) has rules: δ(q0,0) = (q1,B,R); δ(q0,1) = (q4,B,R); δ(q0,B) =…
- For the palindrome-checking TM with rules δ(q0,0) = (q1,B,R); δ(q0,1) = (q4,B,R); δ(q0,B) = (qa,B,R); δ(q1,0) = (q1,0,R); δ(q1,1) =…
- The grammar S → aSBC | aBC; CB → BC; aB → ab; bB → bb; bC → bc; cC → cc generates { aⁿbⁿcⁿ : n ≥ 1 }. How many derivation steps does EVERY…