Vous êtes sur la page 1sur 9

# Q1.

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

## Q2 Which of the following statement is wrong?

(a) the languages accepted by finite automata are the languages denoted by
regular expressions.
(b) for every DFA there is a regular expression denoting its language.
(c) for a regular expression r, there does not exit any NFA with transit that
accepts L (r)
(d) none of the above.

## Q3.Regular expression a\b denotes the set

(a) {a} (b){Є, a, b} (c) {a,b} (d) {ad}

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)+

## Q.5 Palindromes can’t be recognized by any FMS because

a) an FMS can’t remember arbitrarily large amount of information.
b) an FMS can’t deterministically fix the mid- point.
c) Even if the mid-point is known, an FMS can’t find whether the second half of the
string matches the first half.
d) all the above.

## Q6. A language L is accepted by a finite automation if and only if it is

(a)context-free (b)context-sensitive
(c) recursive (d)right-linear.

## Q7. The grammars G=<{s},{0,1},P,S>

Where P={S  0S1, S  0S, S  S1, S  0} is a
(a) recursively enumerable language (b)regular language
(c)context-sensitive language (d)context-free language

## Q8 The logic of pumping lemma is a good example of

(a) the pigeon-hole principle (b)the divide-and-conquer technique.
(c) recursion (d) iteration

## Q9.Any given Transition graph has an equivalent

(a) regular expression (b) DFSM (c) NDFSM (d) all the
above.

## Q10 The intersection of a CFL and a regular language

(a) is always regular (b) is always context free
(c) both (a) & (b) (d) need not be regular

## Q12 Context Sensitive Grammer can be recognized by a

(a)Deterministic Push Down Machine(DPDM)
(b)Non Deterministic Push Down Machine(NDPDM)
(c)Finite State Machine(FSM)
(d)Linearly bounded memory machine.

## Q13. The class of contex free language is not closed under

(a) concatenation (b) union
(c) intersection (d) repeated concatenation.

## Q14. The language L={an bn an where n = 1, 2, 3…} is a

(a) regular language (b)context free language
(c) no context free language (d)none of the above

## Q15.The language L={0n 1n 2k 3k where n, k, > 0} is a

(a) context sensitive language (b) context-free language
(c) regular language (d) recursively enumerable language

## Q16. 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) Determinig of a universal Turing maching can be written if fewer than k
instructions for some k
d) Determining if a universal Turing machine and some input will halt

## Q17.Consider the production grammer.

S AB / AS
Aa / aA
Bb
Which of the following regular expressions corresponds to the production grammar?
(a) (ab)* (b) a(ab)*b (c) aa*b+ (d)aa*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

## Q19. The number of symbols necessary to stimulate a Turning Machine with m

symbols
and n states is
(a) mn (b)2m (n + m) (c) 4mn + m (d) 8mn +
4m

## Q20.Recursively enumerable languages are not closed under

(a)union (b)intersection (c)complementation (d)concatenation

## Q21.Consider a grammer G=({x,y},{S,X,Y},P,S) where the elements of pare:

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.

## Q23.The ‘1” in a LR(1) item is called

(a) the look ahead of the item (b)associativity of the item
(c) both (a) & (b) above (d) none of the above

## Q24. let a and b be two regular expression then (a* ∪ b* )* is equivalent to

(a) (a ∪ b)* (b) ( b* ∪ a* )* (c) ( b ∪ a )* (d) a ∪ b

## Q27. Consider the left-recursive grammar:

SAa | b
AAc | Sd

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’ Aad |bd | ca
A’ cA’|adA’|є
(c) S  Aa | b (d) none of the above
AAc | 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.3) can a DFA simulate NFA ?

a) No b) Yes c) Some times d) Depends on NFA

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.13) An FSM(finite state machine) can be considered to be a TM (turning machine)

a) of finite tape length, without rewriting capability and unidirectional tape moment
b) of finite tape length, rewriting capability, and unidirectional tape moment
c) of finite tape length, without rewriting capability and bidirectional tape moment
d) of finite tape length, rewriting capability and bi –directional tape
moment

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.21) Let L be a language recognizable by a finite automaton. The language

REVERSE (L) = {W such that W is the reverse of V where V ε L } is a :
a) regular language b) context-free language
c) context-sensitive language d) recursively cnumcrable language

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.30) Consider two regular language L1 = (a+b)*a and L2 = b(a+b)*. The

intersection of L1 and L2 is given by
a) (a + b)* ab b) ab (a + b)* c) a(a + b)*b d) b(a + b)*a

## Q.32) Let L be a language recognizable by a finite automaton. The language front

(L)={W such that W is the prefix of V where V ε L} is a
a) context-sensitive language b) context-free language
c) regular language d) recursively enumcrable
language

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.38) Which of the following sentences is generated by the production grammar

S→ aS / bA
A→ d /ccA
a) abbbd b) aabccd c) aadb d) ababccd

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

## 46) Which of the following statement(s) is (are) correct ?

a) recursive language are closed under complementation
b) if a language and its complement are both regular, the language is recursive
c) set of recursively enumerable language is closed under union
d) all of the above

## Q.49) Which of the following statement is wrong

a) any regular language has an equivalent context- free grammar
b) some non-regular languages can’t be generated by any context-free grammar
c) the intersection of a context-free language and a regular language is always
context-free
d) all language can be generated by context-free grammar

## Q.52) consider a grammar G=({S,X,Y), {x,y), P,S) where elements of pare:

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

## Q.62) Dynamic errors can be detected

a) only at compile time b) only at run time
c) both at compile time and at run time d) none of the above

## Q.16) If e1 and e2 are regular expressions denoting the languages L1 and L2

respectively, then which is false?

## d) None of the above

Q.17) The regular expression {a/b}* denotes the set of all strings

of a or b

## e) Both (b) and (c)

Q.18) The string (a)/(b)*(c) is equivalent to

## b) acceptor, cognitive d) cognitive, generative

c) cognitive, acceptor

Q.20) Every context – free grammar (CFG) can be transferred into an equivalent

languages

## a) can b) can’t c) may d) may not

Q.24) The language L = {an bm cn bn / n ≥ 1, m ≥ 1}

## c) abstracts the problem of checking number of formal and actual parameters

d) A and C d) B and C

## d) recursive – descent parser d) none of the above

Q.25) Given the following language get a phrase structure grammar for each.

## d) the ste of all strings made up of a 1 followed by an odd number of 0s.

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

## a) S → aAB , A → Bb , B → λ b) S → ABA , A → aB , B →ab

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