flat it gate 2
TRANSCRIPT
-
8/13/2019 Flat It Gate 2
1/33
IT DEPARTMENT GATE MATERIAL
FORMAL LANGUAGES AND AUTOMATA THEORY
1.Consider a DFA over ={a,b}accepting all strings which have number of asdivisible by 6
and number ofbsdivisible by 8. What is the minimum number of states that the DFA will
have?
(1) 8
(2) 14
(3) 15
(4) 48
Solution: 3 [Gate-2001]
2. Consider the following languages:
Li ={wwwE {a,b}*}
L2 = {wwR w {a, b}*, wR is the reverse of w}
L3 = {021 i is an integer)
L4= {o2 i is an integer)
Which of the languages are regular?
(1) Only Li and L2
(2) Only L2, L3 and L4
(3) Only L3 and L4
(4) Only L3
Solution:1 [Gate-2001]
3. Consider the following problem X.
Given a Turing machine M over the input alphabet , any state q of M
And a word w E*, does the computation of M on w visit the state q?
Which of the following statements about X is correct?
(1) X is decidable
(2) X is undecidable but partially decidable
-
8/13/2019 Flat It Gate 2
2/33
IT DEPARTMENT GATE MATERIAL
(3) X is undecidable and not even partially decidable
(4) X is not a decision problem
Solution:2 [Gate-2001]
4. The regular expression 0* (10*)* denotes the same set as
1) (1*0)*1*
2) 0 + (0 + 10)*
3) (0 + 1)* 10(0 + 1)*
4) none of theseSolution:4 [Gate-2003]
5. If the strings of a language L can be effectively enumerated in lexicographic
(i.e., alphabetic) order, which of the following statements is true ?
1) L is necessarily finite
2) L is regular but not necessarily finite
3) L is context freebut not necessarily regular
4) L is recursive but not necessarily context free
Solution: 1 [Gate-2003]
6.Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar ?
1) Removing left recursion alone
2) Factoring the grammar alone
3) Removing left recursion and factoring the grammar
4) None of these
-
8/13/2019 Flat It Gate 2
3/33
IT DEPARTMENT GATE MATERIAL
Solution: 3 [Gate-2003]
7.Consider the following deterministic finite state automaton M .
Let S denote the set of seven bit binary strings in which the first, the fourth,
and the last bits are 1. The number of strings in S that are accepted by M is
1) 1 2) 5 3) 7 4) 8
Solution:1 [Gate-2003]
8.Define languages L0 and L1 as follows : L0 = {< M, w, 0 > | M halts on w}
L1 = {< M, w, 1 > | M does not halts on w}
Here < M, w, i > is a triplet, whose first component. M is an encoding of a Turing
Machine, second component, w, is a string, and third component, i, is a bit.
Let L = L0 L1. Which of the followingis true ?
1) L is recursively enumerable, but is not
2) is recursively enumerable, but L is not
3) Both L and are recursive
-
8/13/2019 Flat It Gate 2
4/33
IT DEPARTMENT GATE MATERIAL
4) Neither L nor is recrusively enumerable
Solution:1 [Gate-2003]
9.Consider the NFA M shown below.
Let the language accepted by M be L. Let L1 be the language accepted by the
NFA M1,obtained by changing the accepting state of M to a non-accepting state
and by changing the non-accepting state of M to accepting states. Which of the
following statements is true?
1) L1 = {0, 1}* - L
2) L1 = {0, 1}*
3) L1 L
4) L1 = L
Solution:3 [Gate-2003]
-
8/13/2019 Flat It Gate 2
5/33
IT DEPARTMENT GATE MATERIAL
10.The following finite state machine accepts all those binary strings in which the
number of l's and 0's are respectively
1) divisible by 3 and 2
2) odd and even
3) even and odd
4) divisible by 2 and 3
Solution:1 [Gate-2004]
11.The language {am bn Cm + n | m, n 1} is
1) regular
2) context-free but not regular
3) context sensitive but not context free
4) type-0 but not context sensitive
Solution:2 [Gate-2004]
12.Consider the following grammar
G: S bS | aA | b
AbA | aB
BbB | aS | a
-
8/13/2019 Flat It Gate 2
6/33
IT DEPARTMENT GATE MATERIAL
Let Na (w) and Nb (w) denote the number of a's and b's in a string w
respectively. The language L(G) {a, b}+ generated by G is
1) { w | Na(w) > 3Nb(w)}
2) { w | Nb(w) > 3Nb(w)}
3) { w | Na(w) = 3k, k {0, 1, 2, ...}}
4) { w | Nb(w) = 3k, k {0, 1, 2, ...}}
Solution:3 [Gate-2004]
13.L1 is a recursively enumerable language over. An algorithm A effectively
enumerates its words as w1, w2, w3, ... Define another language L2 over
Union {#} as {wi # wj : wi, wj L1, i
-
8/13/2019 Flat It Gate 2
7/33
IT DEPARTMENT GATE MATERIAL
The language recognized by M is :
1) {w {a, b}* / every a in w is followed by exactly two b's}
2) {w {a, b}* every a in w is followed by at least two b}
3) {w {a, b}* w contains the substring 'abb'}
4) {w {a, b}* w does not contain 'aa' as a substring}
Solution:2 [Gate-2005]
15. Let Nf and Np denote the classes of languages accepted by non-
deterministic finite automata and non-deterministic push-down automata,
respectively. Let Df and Dp denote the classes of languages accepted by
deterministic finite automata and deterministic push- down automata,
respectively. Which one of the following is TRUE?
1) Df Nf and Dp Np
2) Df Nf and Dp = Np
3) Df = Nf and Dp = Np
4) Df = Nf and Dp Np
Solution:4 [Gate-2005]
16.Consider the languages
-
8/13/2019 Flat It Gate 2
8/33
IT DEPARTMENT GATE MATERIAL
L1 = {anbncm | n, m > 0} and L2 = {a
nbmcm | n, m > 0} Which one of the following
statements is FALSE?
1) L1 L2 is a context-free language
2) L1 L2 is a context-free language
3) L1 and L2 are context-free language
4) L1 L2 is a context sensitive language
Solution: 1 [Gate-2005]
17. Consider the languages
L1 = {wwR |w {0, 1}*}
L2 = {w # wR | w {0, 1}*}, where # is a special symbol
L3 = {ww | w (0, 1}*)
Which one of the following is TRUE?
1) L1 is a deterministic CFL
2) L2 is a deterministic CFL
3) L3 is a CFL, but not a deterministic CFL
4) L3 is a deterministic CFL
Solution: 2 [Gate-2005]
18. The following diagram represents a finite state machine which takes as input
a binary number from the least significant bit.
-
8/13/2019 Flat It Gate 2
9/33
IT DEPARTMENT GATE MATERIAL
Which one of the following is TRUE?
1) It computes 1's complement of the input number
2) It computes 2's complement of the input number
3) It increments the input number
4) It decrements the input number
Solution: 2 [Gate-2005]
19. If s is a string over (0 + 1)*, then let n0 (s) denote the number of 0's in s and n1(s)
the number of 1's in s. Which one of the following languages is not regular ?
1) L = {s (0 + 1)* | n0 (s) is a 3-digit prime}
2) L = {s (0 + 1)* | for every prefix s' of s, | n0 (s') - n1(s') | 2}
3) L = {s (0 + 1)* | n0 (s) - n1(s) 4}
4) L = {s (0 + 1)* | n0 (s) mod 7 = n1(s) mod 5 = 0}
Solution:2 [Gate-2006]
20. For s (0 + 1) * let d(s) denote the decimal value of s (e.g. d (101) = 5).
Let L = {s (0 + 1)*
| d (s) mod 5 = 2 and d (s) mod 7 4) Which one of the followingstatements is true ?
1) L is recursively enumerable, but not recursive
-
8/13/2019 Flat It Gate 2
10/33
IT DEPARTMENT GATE MATERIAL
2) L is recursive, but not context-free
3) L is context-free, but not regular
4) L is regular
Solution:2 [Gate-2006]
21. Consider the following statements about the context-
free grammar, G = (S SS, S ab, S ba, S )
I. G is ambiguous
II. G produces all strings with equal number of a's and b's
III. G can be accepted by a deterministic PDA
Which combination below expresses all the true statements about G?
1) I only
2) I and III only
3) II and III only
4) I, II, and III
Solution:4 [Gate-2006]
22. Let L1 be regular language, L2 be a deterministic context-free
language and L3 a recursively enumerable, but not recursive, language.
Which one of the following statements is false ?
1) L1 L2 is a deterministic CFL
2) L3 L1 is recursive
3) L1 L2 is context free
4) L1 L2 L3 is recursively enumerable
Solution:4 [Gate-2006]
-
8/13/2019 Flat It Gate 2
11/33
IT DEPARTMENT GATE MATERIAL
23. Consider the regular language L = (111 + 11111)*. The minimum number of states
in any
DFA accepting this languages is
1) 3 2) 5 3) 8 4) 9
Solution:4 [Gate-2006]
24.Which of the following problems is undecidable?
1) Membership problem for CFGs.
2) Ambiguity problem for CFGs.
3) Finiteness problem for FSAs.
4) Equivalence problem for FSAs.
Solution:2 [Gate-2007]
25.Which of the following is TRUE?
1) Every subset of a regular set is regular
2) Every finite subset of a non-regular set is regular
3) The union of two non-regular sets is not regular
4) Infinite union of finite sets is regular
Solution:2 [Gate-2007]
26.A minimum state deterministic finite automaton accepting the languageL = {w | w {0, 1}*, number of 0s and 1s in w are divisible by 3 and 5, respectively}
has
-
8/13/2019 Flat It Gate 2
12/33
IT DEPARTMENT GATE MATERIAL
1) 15 states
2) 11 states
3) 10 states
4) 9 states
Solution: 1 [Gate-2007]
27.The language L = {0i 21i | i 0) over the alphabet {0, 1, 2} is
1) not recursive
2) is recursive and is a deterministic CFL
3) is a regular language
4) is not a deterministic CFL but a CFL
Solution: 2 [Gate-2007]
28.Which of the following languages is regular ?
1) {wwR | w {0, 1}+}
2) {wwRx | x, w {0, 1}+}
3) {wxwR | x, w {0, 1}+}
4) {xwwR | x, w {0, 1}+}
Solution:3 [Gate-2007]
29.Consider the grammar with non-terminals N = {S, C, S1), terminals T = {a, b, i, t, e},
with S as the start symbol, and the following set of rules
-
8/13/2019 Flat It Gate 2
13/33
IT DEPARTMENT GATE MATERIAL
S iCtSS1|a
S1 eS|
C b
The grammar is NOT LL(1) because:
1) It is left recursive
2) it is right recursive
3) it is ambiguous
4) it is not context-free
Solution:3 [Gate-2007]
30.Consider the following two statements : P : Every regular grammar is LL (1)
Q : Every regular set has a LR
(1) grammar
Which of the
following is TRUE ?
1) Both P and Q are true.
2) P is true and Q is false.
3) P is false and Q is true.
4) Both P and Q are false.
Solution:2 [Gate-2007]
-
8/13/2019 Flat It Gate 2
14/33
IT DEPARTMENT GATE MATERIAL
Consider the following Finite State Automaton :
31.The language accepted by this automaton is given by the regular expression
1) b * ab * ab * ab *
2) (a + b) *
3) b * a (a + b) *
4) b * ab * ab *
Solution:3 [Gate-2007]
32.The minimum state automaton equivalent to the above FSA has the following number
of states
1) 1 2) 2 3) 3 4) 4
Solution:2 [Gate-2007]
33.Which of the following is true for the language {ap | p
is a prime} ?
1) It is not accepted by a Turing Machine
2) It is regular but not context-free
3) It is context-free but not regular
4) It is neither regular nor context-free, but accepted by a Turing machine
-
8/13/2019 Flat It Gate 2
15/33
IT DEPARTMENT GATE MATERIAL
Solution:4 [Gate-2008]
34.Which of the following are decidable?
I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free
1) I and II
2) I and IV
3) II and III
4) II and IV
Solution:2 [Gate-2008]
35.If L and are recursively enumerable then L is
1) regular
2) context-free
3) context-sensitive
4) recursive
Solution:4 [Gate-2008]
36.Which of the following statements is false?
1) Every NFA can be converted to an equivalent DFA
2) Every non-deterministic Turing machine can be converted to an
equivalent deterministic Turing machine
3) Every regular language is also a context-free language
4) Every subset of a recursively enumerable set is recursive
-
8/13/2019 Flat It Gate 2
16/33
IT DEPARTMENT GATE MATERIAL
Solution:4
[Gate-2008]
37.Which of the following statements are true?
I. Every left-recursive grammar can be converted to a right-recursive grammar and
vice- versa
II. All -productions can be removed from any context-free grammar by
suitable transformations
III. The language generated by a context-free grammar all of whose productions are of
the form X w or X wY (where, w is a string of terminals and Y is a non-terminal),
is always regular
IV. The derivation trees of strings generated by a context-free grammar in
Chomsky
Normal Form are always binary
trees
1) I, II, III and IV
2) II, III and IV only
3) I, III and IV only
4) I, II and IV only
Solution:4 [Gate-2008]
38.. Match the following
(E)
Checking that identifiers are
declared before their use (P) L = (anbmcndm | n 1, m
(F)
Number of formal parameters i
the declaration of a function agree
with the number of actual parameter
in a use of that function
(Q) X X b X | X c X | d X f | g
-
8/13/2019 Flat It Gate 2
17/33
IT DEPARTMENT GATE MATERIAL
(G)
Arithmetic expression with matche
pairs of parentheses (R) L = {wcw | w (a | b) *}
(H) Palindromes (S) X b X b | c X c |
1) E P, F R, G Q, H S
2) E R, F P, G S, H Q
3) E R, F P, G Q, H S
4) E P, F R, G S, H Q
Solution:3 [Gate-2008]
39.Match the following NFAs with the regular expressions they correspond to.
1. + 0(01*1 + 00)*01*
2. + 0(10*1 + 00)*0
3. + 0(10*1 + 10)*1
4. + 0(10*1 + 10)*10*
-
8/13/2019 Flat It Gate 2
18/33
IT DEPARTMENT GATE MATERIAL
1) P 2, Q 1, R 3, S 4
2) P 1, Q 3, R 2, S 4
3) P 1, Q 2, R 3, S 4
4) P 3, Q 2, R 1, S 4
Solution:3 [Gate-2008]
40.Which of the following are regular sets?
I. {anb2m | n 0, m 0}
II. {an
bm
| n = 2m}
III. {anbm | n m}
IV. {xcy | x, y {a, b}*}
1) I and IV only
2) I and III only
3) I only
4) IV only
Solution:1 [Gate-2008]
41.S aSa | bSb | a | b; The language generated by the above grammar over the
alphabet
{a, b} is the set of
1) All palindromes.
2) All odd length palindromes.
3) Strings that begin and end with the same symbol.
-
8/13/2019 Flat It Gate 2
19/33
IT DEPARTMENT GATE MATERIAL
4) All even length palindromes.
Solution:2 [Gate-2009]
42.Which one of the following languages over the alphabet {0, 1} is described by
the regular expression:
(0 + 1)* 0(0 + 1)* 0(0 + 1)*?
1) The set of all strings containing the substring 00.
2) The set of all strings containing at most two 0s.
3) The set of all strings containing at least two 0s.
4) The set of all strings that begin and end with either 0 or 1.
Solution:3 [Gate-2009]
43.Which one of the following is FALSE?
1) There is unique minimal DFA for every regular language.
2) Every NFA can be converted to an equivalent PDA.
3) Complement of every context-free language is recursive.
4) Every nondeterministic PDA can be converted to an equivalent deterministic PDA.
Solution:4 [Gate-2009]
44.L = L1
L2
, where L1
and L2
are languages as defined below:
-
8/13/2019 Flat It Gate 2
20/33
IT DEPARTMENT GATE MATERIAL
L1 = {am bm c an bm | m,
n 0} L2 = {aibjck | i, j, k
0}
Then L is
1) Not recursive
2) Regular
3) Context free but not regular
4) Recursively enumerable but not context free
Solution:3 [Gate-2009]
45.
The above DFA accepts the set of all strings over {0, 1} that
1) begin either with 0 or 1
2) end with 0
3) end with 00
4) contain the substring 00
Solution:3 [Gate-2009]
46. Let L = { (0 + 1) * | has even number of 1s}, i.e. L is the set of all
bit strings with even number of 1s. Which one of the regular expressions
below represents L ?
-
8/13/2019 Flat It Gate 2
21/33
IT DEPARTMENT GATE MATERIAL
1) (0 * 10 * 1) *
2) 0 * (10 * 10 * ) *
3) 0 * (10 * 1 *) * 0 *
4) 0 * 1(10 * 1) * 10 *
Solution:2 [Gate-2010]
47.Consider the languages
L1 = {0i1j | i j}. L2 = {0i1j | i =j}. L3 = {0i1j | i = 2j + 1}. L4 = {0i1j | i 2j}.
Which one of the following statements is true ?
1) Only L2 is context free
2) Only L2 and L3 are context free
3) Only L1 and L2 are context free
4) All are context free
Solution:1 [Gate-2010]
48. Let be any string of length n in {0, 1}*. Let L be the set of all
substrings of. What is the minimum number of states in a non-deterministic
finite automaton that accepts L ?
1) n - 1
2) n
3) n + 1
4) 2n - 1
-
8/13/2019 Flat It Gate 2
22/33
IT DEPARTMENT GATE MATERIAL
Solution:3 [Gate-2010]
49.What is the complement of the language acceptedby the NFA show below?
Assume ={a} and is the empty string.
(1) (2) {} (3) a G (4) {a, }
Solution:2 [Gate-2011]
50.
Solution:B [Gate-2012]
51. The following grammar
G = (N, T, P, S)
N = {S, A, B}
T = {a, b, c}
-
8/13/2019 Flat It Gate 2
23/33
IT DEPARTMENT GATE MATERIAL
P : S aSa
S aAa
A bB
B bB
B c is
a. is type 3b. is type 2 but not type 3c. is type 1 but not type 2d. is type 0 but not type 1
52. The following grammar
G = (N, T, P, S)
N = {S, A, B, C, D, E}
T = {a, b, c}
P : S aAB
AB CD
CD CE
C aC
C bbE bc is
a. is type 3b. is type 2 but not type 3c. is type 1 but not type 2d. is type 0 but not type 1
53. The following grammar
G = (N, T, P, S)
N = {S, A, B, C}
-
8/13/2019 Flat It Gate 2
24/33
IT DEPARTMENT GATE MATERIAL
T = {a, b, c}
P : S aS
A bB
B cC
C a is
a. is type 3b. is type 2 but not type 3c. is type 1 but not type 2d. is type 0 but not type 1
54. The following grammar
G = (N, T, P, S)
N = {S, A, B, C, D, E}
T = (a, b, c}
P : S ABCD
BCD DE
D aD
D a
E bEE c is
a. is type 3b. is type 2 but not type 3c. is type 1 but not type 2d. is type 0 but not type 1
55. Consider the following CFG
S aB S bAB b A a
B bS A aS
-
8/13/2019 Flat It Gate 2
25/33
IT DEPARTMENT GATE MATERIAL
S aB S bA
B aBB A bAA
Consider the following derivation
S aB
aaBB
aaBb
aabSb
aabbAb
aabbab
This derivation is
a. a leftmost derivationb. a rightmost derivationc. both leftmost and rightmost derivationd. neither leftmost nor rightmost derivation
56. Consider the following language
L = {anbncndn|n 1}
L is
a. CFL but not regularb. CSL but not CFLc. regulard. type 0 language but not type 1
57. Consider the following language
L = {anbn|n 1}
L is
a. CFL but not regular
-
8/13/2019 Flat It Gate 2
26/33
IT DEPARTMENT GATE MATERIAL
b. CSL but not CFLc. regulard. type 0 language but not type 1
58. Consider the following language
L = {anbmcpdq|n, m, p, q 1}
L is
a. CFL but not regularb. CSL but not CFLc. regulard. type 0 language but not type 1
59. The following CFG is in
S AB
B CD
B AD
B b
D AD
D d
A a
C a
a. Chomsky normal form but not strong Chomsky normal formb. Weak Chomsky normal form but not Chomsky normal formc. Strong Chomsky normal formd. Greibach normal form
60. The following CFG is in
S aBB
B bAA
-
8/13/2019 Flat It Gate 2
27/33
IT DEPARTMENT GATE MATERIAL
A a
B b
a. Chomsky normal form but not strong Chomsky normal formb.
Weak Chomsky normal form but not Chomsky normal formc. Strong Chomsky normal form
d. Greibach normal form61. Which of the following CF language is inherently ambiguous?
a. {anbncmdm|n, m 1}b. {anbmcpdq|n = p or m = q, n, m, p, q 1}c. {anbmcpdq|n m p q}d. {anbmcpdq|n m p q}
62. Which string is not accepted by the following FSA?
a. 00111b. 01010c. 00110d. 11010
63. Which string is accepted by the following FSA?
-
8/13/2019 Flat It Gate 2
28/33
IT DEPARTMENT GATE MATERIAL
a. 00111b. 11011c. 01101d. 0101
64. Can a DFSA simulate a NFSA
a. Nob. Yesc. sometimesd. depends on NFA
65. Which of the following is true for an arbitrary language L.
a.b. L*= L+{}c. L*= L+d. L*= L+ {}
66. The concept of FSA is much used in this part of the compiler
a. lexical analysisb. parserc. code generationd. code optimization
67. The concept of grammar is much used in this part of the compiler
a. lexical analysisb. parserc. code generationd. code optimization
68. (a + b)(cd)*(a + b) denotes the following set
a. {a(cd)nb|n 1}b. {a(cd)na|n 1} {b(cd)nb/n 1}c. {a(cd)na|n 0} {a(cd)nb/n 0} {b(cd)na/n 0} {b(cd)nb/n 0}d. {acndnb|n 1}
69. baa*c denotes the set
-
8/13/2019 Flat It Gate 2
29/33
IT DEPARTMENT GATE MATERIAL
a. {bnamcp|n, m, p 1}b. {banc|n 0}c. {banc|n 1}
70. The set of all strings over the alphabet = {a, b} (including ) is denoted by
a. (a + b)*b. (a + b)+c. a+b+d. a*b*
71. Palindromes cant be recognized by any FSA because
a. FSA cannot remember arbitrarily large amount of informationb. FSA cannot deterministically fix the midpointc. Even if the mid point is known an FSA cannot find whether the second half of the string
matches the first halfd. all of the above72. Let = {a, b, c, d, e}. The number of strings in * of length 4 such that no symbol is used
more than once in a string is
a. 360b. 120c. 35d. 36
73. Which of the following denotes Chomskian hiearchy?
a. REG CFL CSL type0b. CFL REG type0 CSLc. CSL type0 REG CFLd. CSL CFL REG type0
74. A language L is accepted by a FSA iff it is
a. CFLb. CSLc.
recursived. regular
75. Which of the following regular expressions denotes a language comprising of all possible
strings over = {a, b} of length n where n is a multiple of 3.
-
8/13/2019 Flat It Gate 2
30/33
IT DEPARTMENT GATE MATERIAL
a. (a + b + aa + bb + aba + bba)*b. (aaa + bbb)*c. ((a + b)(a + b)(a + b))*d. (aaa + ab + a) + (bbb + bb + a)
76. A language is represented by a regular expression (a)*(a + ba). Which of the following stringdoes not belong to the regular set represented by the above expression.
a. aaab. abac. ababad. aa
77. Which of the following is not primitive recursive but partially recursive?
a. McCarthys functionb.
Riemann functionc. Ackermanns function
d. Bounded function78. Consider the following right-linear grammar G = (N, T, P, S) N = {S}
P : S aS|aA T = {a, b}
A bA|b
Which of the following regular expression denotes L(G)?
a. (a + b)*b. a(ab)*bc. aa*bb*d. a*b*
79. Which of the following strings is not generated by the following grammar? S SaSbS|
a. aabbb. ababc. aababbd.
aaabb
80. Consider the following NFSA
-
8/13/2019 Flat It Gate 2
31/33
IT DEPARTMENT GATE MATERIAL
The automaton accepts
a. all words of the form {(ab)na|n 1}b. all words that end with a and c. all words that end with a and not d. all words containing substring ba
81. Consider a language L for which there exists a Turing machine (TM), T, that accepts every
word in L and either rejects or loops for every word that is not in L. The language L is
a. NP hardb. NP completec. recursived. recursively enumerable
82.Consider the following statements
I. Recursive languages are closed under complementationII. Recursively enumerable languages are closed under union
III. Recursively enumerable languages are closed under complementationWhich of the above statement are TRUE?
a. I onlyb. I and IIc. I and IIId. II and III
83.Which of the following statement is wrong?
a. Any regular language can be generated by a context-free grammarb. Some non-regular languages cannot be generated by any CFGc. the intersection of a CFL and regular set is a CFLd. All non-regular languages can be generated by CFGs.
84.Recursively enumerable languages are not closed under
a. unionb. homomorphism
-
8/13/2019 Flat It Gate 2
32/33
IT DEPARTMENT GATE MATERIAL
c. complementationd. concatenation
85.Which of the following problem is undecidable?
a.
membership problem for CFLb. membership problem for regular setsc. membership problem for CSLd. membership problem for type 0 languages
86.Recursive languages are
a. a proper superset of CFLb. always recognized by PDAc. are also called type 0 languagesd. always recognized by FSA
87. R1and R2are regular sets. Which of the following is not true?
a. R1 R2neet not be regularb. * R1is regularc. R1R2is regulard. is regular
88. Which of the following regular expression identity is true?
a. r(*) = r*b. (r*s*)* = (r + s)*c. (r + s)* = r* + s*d. r*s* = r* + s*
89. Which one of the following statement is FALSE?
a. context-free languages are closed under unionb. context-free languages are closed under concatenationc. context-free languages are closed under intersectiond. context-free languages are closed under Kleene closure
90. Which of the following conversion is not possible (algorithmically)?
a. regular grammar to context-free grammarb. nondeterministic FSA to deterministic FSAc. nondeterministic PDA to deterministic PDA
http://my.safaribooksonline.com/9788131723562/app01lev1sec1#app01qa2a36http://my.safaribooksonline.com/9788131723562/app01lev1sec1#app01qa2a36http://my.safaribooksonline.com/9788131723562/app01lev1sec1#app01qa2a36 -
8/13/2019 Flat It Gate 2
33/33
IT DEPARTMENT GATE MATERIAL
d. nondeterministic TM to deterministic TM