Discrete 2 Final

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

27. 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 is in the correct form e. Cannot be formulated using μ-recursive function.

a. Halt(P,x) = 1 if ϕp(x) is defined 0 if ϕp(x) is not defined

23. 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. A proper superset of CFL

2. 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. Undecidable c. Interpretive d. Non Deterministic e. None of the above

a. Decidable

32. 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. None of the above

a. L is context free but not regular

15. Which of the following denotes Chomskian hierarchy? a. REG → CFL → CSL → type0 b. CFL → REG → type0 → CSL c. CSL → type0 → REG → CFL d. CSL → CFL → REG → type 0

a. REG → CFL → CSL → type0

39. The statement, "A TM can't solve halting problem" is a. True b. False c. Still an open question d. All of these

a. True

34. Which of the following problems is solvable? a. Writing a universal Turing machine b. Determining of an arbitrary Turing machine is a universal Turing machine c. Determining of a universal Turing machine can be written for fewer than k instructions for some k d. Determining of a universal Turing machine and some input will halt e. None of the above

a. Writing a universal Turing machine

7. 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 false 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

b. (i) is true and (ii) is true

25. 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 u-recursive function d. An undefined function e. Not a function

b. A primitive recursive function

3. Assume statements S1 and S2 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 not correct. 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.

b. Both S1 and S2 are correct.

11. Consider the following language L = {anbncndn | 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

b. CSL but not CFL

4. Which of the following is the most general phase structured grammar? a. Regular b. Context-sensitive c. Context free d. None of the above

b. Context-sensitive

17. Consider the following statements I. Recursive languages are closed under complementation II. Recursive enumerable languages are closed under union III. Recursive enumerable languages are closed under complementation Which of the above statement are TRUE? a. I only b. I and II c. I and III d. II and III e. None of the above

b. I and II

5. 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

b. I and II

37. 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 word that is not in L, L is called a. Recursive b. Recursively enumerable c. NP-Hard d. None of these

b. Recursively enumerable

10. 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

b. a rightmost derivation (see third line of derivation. Rightmost B replaced)

8. 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

b. is type 2 but not type 3

42. The running time T(n), where 'n' is input size of a recursive algorithm, is given as 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

b. n

14. 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

b. {a^n b^m c^p d^q | n=p or m=q, n,m,p,q >= 1}

21. Recursively enumerable languages are not closed under a. Union b. Homomorphism c. Complementation d. Concatenation e. None of the above

c. Complementation

26. Set N (natural numbers) and R (real numbers) are respectively: a. Both countably finite b. Both countably infinite c. Countably infinite and uncountably infinite d. Both uncountably infinite e. Have the same cardinality

c. Countably infinite and uncountably infinite

36. Bounded minimization is a technique for a. Proving whether a primitive recursive function is turning computable or not b. Proving whether a primitive recursive function is a max computable or not c. Generating primitive recursive functions d. Generating partial recursive functions

c. Generating primitive recursive functions

40. If there exists a TM which when applied to any problem in the class , terminates, if correct answer is yes and may or may not terminate otherwise is called a. Stable b. Unsolvable c. Partially solvable d. Unstable

c. Partially solvable

33. Which of the following is a complement of a? a. Recursive language is recursive b. Recursively enumerable language is recursively enumerable c. Recursive language is either recursive or recursively enumerable d. (a) and (b) e. None of these

c. Recursive language is either recursive or recursively enumerable

28. Suppose S != {} then the following are equivalent except: a. S is re b. S is the range of a primitive rec. Function c. S is the same class of languages 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

c. S is the same class of languages as TOTAL

24. 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

c. Semi-Decidable

12. 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

c. Strong Chomsky normal form

9. 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. 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

c. is type 1 but not type 2

6. 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 language, 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

d. 3, 4

1. Which of the following is not primitive recursive but partially recursive? a. Carnot function b. Riemann function c. Bounded function d. Ackermann's function e. None of the above

d. Ackermann's function

20. Which of the following statements is wrong? a. Any regular language can be generated by context-free grammar b. Some non-regular languages cannot be generated by any CFG c. the intersection of a CFL and a regular set is a CFL d. All non-regular languages can be generated by CFGs. e. None of the above

d. All non-regular languages can be generated by CFGs.

44. Suppose A <m B, where A and B denote two problems one of which is known to be (un)decidable Which of the following statement is correct: a. If A is undecidable , so is B b. If B is undecidable, so is A c. A is no harder to solve than B d. All of the above e. None of these

d. All of the above

35. Which of the following statements is false? a. Halting problem of Turing machine is undecidable b. Determining whether a context-free grammar is ambiguous is undecidable c. Given two arbitrary context-free grammar G1,G2, it is undecidable whether L(G1)= L(G2) d. Given two regular grammar G1,G2, it is undecidable whether L(G1)= L(G2) e. All of the above

d. Given two regular grammar G1,G2, it is undecidable whether L(G1)= L(G2)

13. 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

d. Greibach normal form

22. Which of the following problem is 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

d. Membership problem for type 0 languages (double check doc)

41. A total recursive function is a a. Partial recursive function b. Primitive recursive function c. Both (a) and (b) d. None of these

d. None of these

16. Consider a language L for which there exists a Turing machine, T, that accepts every word in L and either rejects or loops for every word that is not in L. The language is a. NP hard b. NP complete c. Recursive d. Recursively enumerable e. None of the above

d. Recursively enumerable

43. Next move function of a Turing machine M = {Q, Σ, Γ, δ, q0, B, F} is a mapping 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}

d. δ : Q x Γ à Q x Γ x {L,R}

38. Which of the following statement(s) is/are correct? a. L = {anbnan | n = 1,2,3 ...} is recursive enumerable b. Recursive languages are closed under union c. Every recursive is closed under union d. None of these e. (a), (b), and (c)

e. (a), (b), and (c)

30. CSGs are not closed under: a. Init b. Final c. Mid d. Quotient with regular sets e. All of the above

e. All of the above

31. The following languages are undecidable except: a. For Type 0, emptiness and even the 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. They are all undecidable

e. They are all undecidable

18. missing

x

19. missing

x

29. missing

x


Ensembles d'études connexes

Chapters 5 and 6 Human Nutrition

View Set

Light Independent Reactions in Photosynthesis

View Set

INT ACC 1 - Chapter 7 CPA/CMA Q's

View Set

Unit 6 Financial Goals/Objectives maat

View Set

HW #1 Econ 202 questions (exam 1)

View Set

Management and Organization Test 2 Review

View Set