COT4210 Final Review
Consider the following language L = {a^n b^n c^n d^n | n >= 1} L is: a) CFL but not regular b) CSL but not CFL c) Regular d) Type 0 language but not type 1 e) None of the above
CSL but not CFL
if L = Σ* is undecidable if a) L is context free but not regular b) L is regular c) It does not matter the type of L d) All of the above
L is context free but not regular
Hilbert's Tenth asking for an algorithm to find the integral roots of polynomials with integral coefficients, is a) Decidable b) Undecidable c) Semi-decidable d) Not a computation problem e) Does not exist
Semi-decidable
Consider the following CFG S -> aB | bA B -> aBB | bS | b A -> bAA | aS | a Consider the following derivation S -> aB -> aaBB -> aaBb -> aabSb -> aabbAb -> aabbab This derivation is a) a leftmost derivation b) a rightmost derivation c) both leftmost and rightmost derivation d) neither leftmost nor rightmost derivation e) None of the above
d, neither leftmost nor rightmost derivation
Which is NOT the correct statement(s)? (i) Every context sensitive language is recursive. (ii) There is a recursive language that is not context sensitive a) (i) is true, (ii) is flase b) (i) is true and (ii) is true c) (i) is false, (ii) is false d) (i) is false and (ii) is true e) None of the above
(i) is true and (ii) is true
Which of the following problems are decidable? 1) Does a given program ever produce an output? 2) If L is context-free language, then is ~L also context free? 3)If L is regular, then is ~L also regular? 4) If L is recursive language, then, is ~:=L also recursive? a) 1,2,3,4 b) 1,2 c) 2,3,4 d) 3,4 e) None of the above
3,4
Function x * y defined as x * 0 = 0 x** (y + 1 ) x ** y + x is an example of a) A base function b) A primitive recursive function c) A μ-recursive function d) An undefined funtion e) Not a function
A primitive recursive function
Recursive languages are a) A proper superset of CFL b) Always recognized by PDA c) Are also called type 0 languages d) Always recognized by FSA e) None of the above
A proper subset of CFL
Which of the following statement(s) is/are correct? A. L= {a^n b^n a^n | n = 1, 2, 3...} is recursively enumerable B. Recursive languages are closed under union C. Every recursive language is closed under union D. None of these E. A,B, and C
A,B, and C
Which of the following is not primitive recursive but partially recursive? a) Carnot function b) Rierman function c) Bounded function d) Ackermann's function e) None of the above
Ackermann's function
Which of the following statements is wrong? a) Any regular language can be generated by a context-free grammar b) Some non-regular languages cannot be generated by any CFG c) The intersection of a CFL and regular set is a CFL d) All non-regular languages can be generated by CFGs e) None of the above
All non-regular languages can be generated by CFGs
The following languages are re excepta) a)For Type 0, emptiness and even membership problems b) Membership in L1/L2, L1 and L2 CFLs c) L regular, for CFL (CSL), L d) ˜L CFL, for CFL, L? e) All of the above
All of the above
Assume S1 and S2 are defined as: S1: L2-L1 is recursive enumerable where L1 and L2 are recursive and recursive enumerable respectively S2: The set of all turing machines is countable. Which of the following is true? a) S1 is correct and s2 is incorrect b) Both S1 and S2 are correct c) Both S1 and S2 are not correct d) S1 is not correct and S2 is correct e) None of the above
Both S1 and S2 are correct
Recursively enumerable languages are not closed under a) Union b) Homomorphism c) Complementaton d) Concatenation e) None of the above
Complementaton
Which of the following is the most general phase structured grammar? a) Regular b) Context-sensitive c) Context free d) None of the above e) None of the above
Context-sensitive
Sets N (natural numbers) and R (real numbers) are respectively: a) Both countably finite b) Both countable infinite c) Countably infinite and uncountably infinite d) Both uncountably infinite e) Have the same cardinality
Countably infinite and uncountably infinite
Which of the following problems is solvable? A. Writing a universal Turing machine B. Determining if an arbitrary Turing machine is a universal Turing machine C. Determining if a universal Turing machine can be written for fewer than k instructions for some k D. Determining if a universal Turing machine and some input will halt E. None of the above
Determining if a universal Turing machine can be written for fewer than k instructions for some k
Bounded minimization is a technique for A. Proving whether a primitive recursive function is Turing computable or not B. Proving whether a primitive recursive function is a total function or not C. Generating primitive recursive functions D. Generating partial recursive functions
Generating primitive recursive functions
Which of the following statements is false? A. Halting problem of Turing machines is undecidable B. Determining whether a context-free grammar is ambiguous is undecidable C. Given two arbitrary context-free grammars G1 G2 and it is undecidable whether L(G1) = L(G2) D. Given two regular grammars G1 G2 and it is undecidable whether L(G1) = L(G2) E. All of the above
Given two regular grammars G1 G2 and it is undecidable whether L(G1) = L(G2)
The following CFG is in S -> aBB B -> bAA | b A -> a a) Chomsky normal form but not strong Chomsky normal form b) Weak Chomsky normal form but not chomsky normal form c) Strong Chomsky normal form d) Greibach normal form e) None of the above
Greibach normal form
The Halting PRoblem -- Given an arbitrary program P, in some Language L, and an input x to P, will P eventually stop when run with input x? - can be defined as a) Halt (P,x) = 1 if φp(x) is defined 0 if φp(x) is not defined b) Halt (P,x) = 1 if φp(x) is not defined = 0 if φp(x) is defined c) Halt (P,x) = terminates if φp(x) is defined = runs forever if φp(x) is not defined d) None of the correct form e) Cannot be formulated using μ-recursive function
Halt (P,x) = 1 if φp(x) is defined 0 if φp(x) is not defined
Consider the following statements I. Recursive languages are closed under complementation II. Recursively enumerable languages are closed under union III. Recursively enumerable languages are closed under complementation Which of the following statements is true? a) I only b) I and II c) I and III d) II and III e) None of the above
I and II
Consider the following statements I. Recursive languages are closed under complementation II. Recursively enumerable languages are closed under union. III. Recursively enumerable languages are closed under complementation Which of the above statements are true? a) I only b) I and II c) II and III d) I and III e) None of the above
I and II
Which of the following problems are undecidable? a) Membership problem for CFL b) Membership problem for regular sets c) Membership problem for CSL d) Membership problem for type 0 languages e) None of the above
Membership problem for type 0 languages
Hilbert's 10th problem was to devise an algorithm to determine the roots of a polynomial. Is this problem decidable? Why, or Why not?
No, while an algorithm can probably determine some of the roots for some problems, it would be impossible to test for all roots for all problems
A total recursive function is A) partial recursive function B) primitive recursive function C) both a and b D) none of the above
None of the above
Which of the following denotes Chomskian hierarchy? a) REG -> CFL -> CSL -> type0 b) CFL -> REG -> Type0 -> CSL c) CSL -> type0 -> REG -> CSL d) CSL -> CFL -> REG -> type0 e) None of the above
REG -> CFL -> CSL -> type0
Which of the following is complement of a A. Recursive language is recursive B. Recursively enumerable language is recursively enumerable C. Recursive language is either recursive of recursively enumerable D. a. and b. E. None of the above
Recursive language is recursive
If there exists a language L, for which there exists a TM, T, that accepts every word in L and either rejects or loops for every work that is not in L, L is called A. Recursive B. Recursively enumerable C. NP-HARD D. None of these
Recursively enumerable
Suppose S != {} then the following are equivalent except: a) S is re b) S is the range of primitive rec. function c) S is the same class of language as TOTAL d) S is the domain of a partial rec. function e) S is the range/domain of a partial rec. function whose domain is the same as its range and which acts as an identity when it converges
S is the same class of language as TOTAL
The following CFG is in S -> AB B -> CD | AD | b D -> AD | d A -> a C -> a a) Chomsky normal form but not strong Chomsky normal form b) Weak Chomsky normal form but not Chomsky normal form c) Strong Chomsky normal form d) Greibach normal form e) None of the above
Strong Chomsky normal form
The statement, "A TM can't solve the halting problem" is A. True B. False C. Still an open question D. All of these
True
There exists a TM which when applied to any problem in the class, teminates, if correct answer is yes and may or may not terminate otherwise is called A. Stable B. Unsolvable C. Partially solvable D. Unstable
Unsolvable
Hilbert's 10th problem was to devise an algorithm to determine the roots of a polynomial. Is this problem turing recognizable?
Yes, there exists some TM that will be able to reach an accepting state based on input for this problem
If every string of a language can be determined whether it is legal or illegal in finite time the language is called a) decidable b) Undecided c) Interpretive d) Non deterministic e) None of the above
decidable
The following grammar G = (N, T, P, S), where N = {S, A, B, C, D, E}, T = {a, b, c} P: S-> aAB AB -> CD CD -> CE C -> aC C -> b bE -> bc is a) type 3 b) is type 2 but not type 3 c) is type 1 but not type 2 d) is type 0 but not type 1 e) None of the above
is type 1 but not type 2
The following grammar G = (N, T, P, S), where N = {S, A, B}, T = {a, b, c} P: S -> aSa S -> aAa A -> bB B -> bB B -> c is a) is type 3 b) is type 2 but not type 3 c) is type 1 but not type 2 d) is type 0 but not type 1 e) None of the above
is type 2 but not type 3
The running time T(n), where n is input size of a recursive function T(n) = {c + T(n - 1) if n > 1, d if n <= 1} The order of the algorithm is A. n^2 B. n C. n^3 D. n^n E. log n
n
CSGs are not closed under: a) Init b) Final c) Mid d) Quotient with regular sets e) none of the above
none of the above
Consider a language L for which there exists a Turing machine, T, that accepts and either rejects or loop for every word that is not in L. The language L is a) NP hard b) NP complete c) Recursive d) recursively enumerable e) None of the above
recursively enumerable
Which of the following CF languages is inherently ambiguous? a) {a^n b^n c^m d^m | n,m>=1} b) {a^n b^m c^p d^q | n = p or m = q, n, m, p, q >= 1} c) {a^n b^m c^p d^q | n >= m >= p>= q} d) a^n b^m c^p d^q | n <= m <= p <= q} e) All of the above
{a^n b^m c^p d^q | n = p or m = q, n, m, p, q >= 1}
The next move function δ of a Turing machine M = (Q, Σ, Γ...) A. δ : Q X Σ → Q X Γ B. δ : Q X Γ → Q X Σ X {L, R} C. δ : Q X Σ → Q X Γ X {L, R} D. δ : Q X Γ → Q X Γ X {L, R}
δ : Q X Γ → Q X Γ X {L, R}