Beruflich Dokumente
Kultur Dokumente
Q4. which o f the following regular expression denotes a language comprising all
possible strings over the alphabet{a,b}?
(a) a*b* (b) (a | b)* (c) (ab)+ (d) (a | b)+
Q18 Which of the following instances of the post correspondence Problem have a
viable
Sequence ?
(a) {(b, bb),(bb, bab),(bab, abb),(abb, babb)}(b){(ab, aba),(baa, aa)(aba, baa)}
(c) {(ab, abb),(ba, aaa)(aa, a)} (d) none of the above
S xY
S yX
X xZ
X x
Y y
Z z
The language L generated by G most accurately said to be:
(a) Chomsky type 0 (b) Chomsky type 1
(c) Chomsky type 2 (d) Chomsky type 3
Q22. Given a grammar G, a production of G with a dot at some position of the right
side
is called
(a) LR(0) item of G (b)LR(1) item of G
(c) both (a) & (b) above (d)none of the above.
Which of the following grammars is equivalent to the grammar given above when
the left-recursion is removed ?
(a) S Aa | b (b) S Aa| b
A bd A’ Aad |bd | ca
A’ cA’|adA’|є
(c) S Aa | b (d) none of the above
AAc | Aad | bd
Q.28) The context free grammar (CFG) defined by the regular expression ab* is:
a) S →Sb l a b) S →XY
X →aX
Y →bY
Q.6) If a source language supports some macro preprocessor function then these
functions can be implemented in
a) lexical analysis phase b) parsing
c) code generation d) syntax analysis phase
Q.8) Regular expression (a l b) (a l b) denotes the set
a) {a, b, ab, aa} b) {a, b, ba, bb} c) {a, b} d) {aa, ab,
ba, bb}
Q.9) Which of the following regular expressions denote zero or more instances of an
a or b ?
a) a l b b) (a b)* c) (a l b)* d) a* l b
Q.10) Which of the following regular expressions denote a language comprising all
possible strings of even length over the alphabet (0, 1)
a) (0 l 1) * b) (0 l 1) (0 l 1)* c) (00 l 01 | 11 l 10)* d) (0 l 1)
(0 l 1) (0 l 1)*
Q.11) Which of the following has a hamming distance of exactly 2 for the bit pattern
01010001 ?
a) 01110001 b) 01010110 c) 01010010 d) 01010000
Q.14) Turning machine (TM) is more powerful than FMS (finite state machine
because)
a) tape moment is confined to one direction
b) it is no finite state
c) it has the capability to remember arbitrarily long sequences of input
symbols
d) none of the above
Q.16) Let ∑ = {a, b, c, d, e f}. The number of strings in ∑* of length 4 such that no
symbol is used more than once in a string is
a) 35 b) 360 c) 49 d) 720
Q.17) which of the following gives the correct hierarchical relationship among
context-free, right linear, and context sensitive language
a) context-sensitive right-linear context free b) context-free context-
sensitive right-linear
c) right-linear context-free context- sensitive d) context-free right-linear
context- sensitive
Q.19) Which of the following regular expressions denote a language comprising all
possible strings over the alphabet {a, b} excluding those of length 3 ?
a) (εl 0 l 1 l 00 l 01 l 11 l 10) ((0 l 1)(0 l 1))* b) (εl 0 l 1 l 1(00 l 01 l 11 l 10)+(0 l
1))*
c) εl 0 l 1 l (00 l 01 l 11 l 10)* d) none of the above
Q.20) A language is denoted by a regular expression L = (x)* (x l yx) which is the
following is not a legal string within L?
a)yx b) yxx c) x d) xxxyx
Q.26) The number of auxiliary memory required for a push down machine (PDM) to
behave like a finite state machine (FSM) is
a) 2 b) 1 c) 0 d) 4
Q.36) Which of the following is not primitive recursive but partially recursive?
a) carnot’s function b) Riemann function c) bounded function d)
ackermann’s function
Q.40) For which of the following applications, regular expressions cannot be used?
a) designing computers b) designing compilers
c) both A and B d) developing texteditors
Q.41) Which of the following is not accepted by deterministic push down machine
(DPDM) but accepted by non deterministic push down machine (NDPDM)?
a) strings ending with a particular alphabet
b) all strings in which a given symbol is present atleast twice
c) even palindromes
d) none of the above
Q.43) Consider a language L for which there exits a turning 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-hard b) NP-complete c) recursive d) recursively
enumerable
Q.17) The regular expression {a/b}* denotes the set of all strings
c) cognitive, acceptor
Q.20) Every context – free grammar (CFG) can be transferred into an equivalent
d) A and C d) B and C
Q.25) Given the following language get a phrase structure grammar for each.
Q.26) Let V ={S,A,B,a,b} and T {a,b}. find out whether G = (V,T,S,P) is a type 0
grammar but not a type 1 grammar, a type 1 grammar but not a type 2 grammar or
a type 2 grammar but not a type 3 grammar, if P the set of production is
c) S → bA , A → b , S → λ d) S → aA, A → bB , B → b , B→λ
Q.27) Use top-down parsing to determine whether each of the following strings
belongs to the language generated by the grammar G={V,T,S,P} where
V={A,B,C,S}, T={a,b,c}, S is the staring symbol and the productions are
S → AB
A →Ca
B → BA
B →b
C →cb
C →b