Coding | Mcqs | Multiple choice questions | Informative | Computer Science | Engineering | Aptitude | Quants | Verbal

INFEED

TOC Part-3

 Theory Of Computation MCQ - Context free languages 


1) Correct hierarchical relationship among context- free, right-linear, and context-sensitive language is

A. 

context-free   right-linear   context-sensitive

B. 

context-free   context-sensitive   right-linear

C. 

context-sensitive   right-inear  context-free

D. 

right-linear  context-free  context-sensitive

Option: D  

2)In the following grammar :

x : : = x   y |  4
y : : = z * y I 2
z : : = id

which of the folowing is true ?

A. 

 is left associative while * is right associative

B. 

Both  and * are left associative

C. 

is right associative while * is left associative

D. 

None of these

Option: A

3) Which of the following CFG's can't be simulated by an FSM ?

A. 

S --> Sa | b

B. 

S  --> aSb | ab

C. 

S --> abX,  X --> cY,  Y --> d | aX 

D. 

None of these

Option: B

4) ADG is said to be in Chomsky Form (CNF), if all the productions are of the form A --> BC or
A --> a. Let G be a CFG in CNF. To derive a string of terminals of length x , the number of productions to be used is

A. 

2x - 1

B. 

2x

C. 

2x + I

D. 

None of these

Option: A

5) Which of the following statements is correct?

A. 

A = { If an bn  | n = 0,1, 2, 3 ..} is regular language

B. 

Set B of all strings of equal number of a's and b's deines a regular language

C. 

L (A* B*)∩ B gives the set A

D. 

None of these

Option: C

6) P, Q, R are three languages, if P and R are regular and if PQ = R, then

A. 

Q has to be regular

B. 

Q cannot be regular

C. 

Q need not be regular

D. 

Q cannot be a CFL

Option: C

7) A class of language that is closed under

A. 

union and complementation has to be closed under intersection

B. 

intersection and complement has to be closed under union

C. 

union and intersection has to be closed under complementation 

D. 

both (A) and (B)

Option: D

8) The productions
E—>E+E
E—>E—E
E-->E*E
E —> E / E
E —> id

A. 

generate an inherently ambiguous language

B. 

generate an ambiguous language but not inherently so 

C. 

are unambiguous

D. 

can generate all possible fixed length valid computation for carrying out addition, subtraction, multipication and division, which can be expressed in one expression 

Option: B

9)  Which of the folowing definitions below generates the same language as L, where
L = {xn yn such that n > = 1} ?

I. E —> xEy | xy

II. xy | (x+ xyy+)

III .x+y+

A. 

I only

B. 

I and II

C. 

II and III

D. 

II only 

Option: A

10) Following context free grammar
S —> aB | bA 
A —>b | aS | bAA
B —> b | bS | aBB 
generates strings of terminals that have

A. 

equal number of a's and b's

B. 

odd number of a's and odd number b's

C. 

even number of a's and even number of b's

D. 

odd number of a's and even number of a's

Option: A

11) Define for the context free language
L< {0;1} init (L) =  { u | u v   ε  L for some v in {0, 1}}

If L { w | w is nonempty and has an equal number of 0's and 1's}, then init (L) is set of all binary strings

A. 

with unequal numbers of 0's and 1's.

B. 

including the null string.

C. 

Both (a) and (b)

D. 

None of these

Option: B

12)  Which of the following CFG's can't be simulated by an FSM ?

A. 

s ---> sa | a

B. 

s ---> abX , X --> cY, Y --> a | axY

C. 

s ---> a sb | ab

D. 

none of these

Option: C

13)  Basic limitation of FSM is that it

A. 

cannot remember arbitrary large amount of information 

B. 

sometimes fails to recognize grammars that are regular 

C. 

sometimes recognizes grammars are not regular 

D. 

None of these

Option: A

14)   

Which of the following is not possible algorithmically ?

A. 

Regular grammar to context free grammar

B. 

Non-deterministic FSA to deterministic FSA

C. 

Non-deterministic PDA to deterministic PDA

D. 

None of these

Option: C

15) The set {anbn | n = 1, 2, 3 ...} can be generated by the CFG

A. 

S >ab | aSb

B. 

S >aaSbb + abS

C. 

S> ab | aSb | E

D. 

S >aaSbb | ab | aabb

Option: D

16) The CFG 
s---> as | bs |  a |  b 

is equivalent to regular expression

A. 

(a + b)

B. 

(a + b) (a + b)*

C. 

(a + b) (a + b)

D. 

None of these

Option: B

17) Consider the grammar :

S —> ABCc | Abc
BA —> AB
Bb —> bb
Ab —> ab
Aa —> aa 

Which of the following sentences can be derived by this grammar 

A. 

abc

B. 

aab

C. 

abcc

D. 

abbb

Option: A

18)   

Pumping lemma is generally used for proving that

A. 

given grammar is regular

B. 

given grammar is not regular

C. 

whether two given regular expressions are equivalent or not 

D. 

None of these

Option: B

19) The language of all words with at least 2 a's can be described by the regular expression

A. 

(ab)*a and a (ba)*

B. 

(a + b)* ab* a (a + b)*

C. 

b* ab* a (a + b)*

D. 

all of these

Option: D

20) Any string of terminals that can be generated by the following CFG is
S-> XY
X--> aX | bX | a 
Y-> Ya  | Yb | a

A. 

has atleast one 'b'

B. 

should end in a 'a'

C. 

has no consecutive a's or b's

D. 

has atleast two a's

Option: D

21) L = (an bn an | n = 1,2,3)  is an example of a language that is

A. 

context free

B. 

not context free

C. 

not context free but whose complement is CF

D. 

both (b) and (c)

Option: D

22) If Σ = (0, 1), L = Σ* and R = (0n 1nsuch that  n >  0 )

then languages L  R and R respectively are

A. 

Regular, Regular

B. 

Regular, Not regular

C. 

Not regular, Not regular

D. 

None of these

Option: B

23)  FSM can recognize

A. 

any grammar

B. 

only CG

C. 

Both (a) and ( b )

D. 

only regular grammar 

Option: D

24) Set of regular languages over a given alphabet set is  closed under

A. 

union

B. 

complementation

C. 

intersection

D. 

All of these

Option: D

25) Which of the following statement is correct?

A. 

All languages can not be generated by CFG

B. 

Any regular language has an equivalent CFG

C. 

Some non regular languages can't be generated by CFG

D. 

both (b) and (c)

Option: D

26) Given A = (0,1) and L = A*. If R = (0n 1n, n > 0) , then language L  R and R are respectively

A. 

regular, regular

B. 

not regular, regular

C. 

regular, not regular

D. 

context free, not regular

Option: D

27) Define for a context free language

L ≤ {0 ; 1} init (L) = {u/uv  Îµ L for some v in {0,1}}

(in other words, init (L) is the set of prefixes of L)

Let L {w/w is noempty and has an equal number of 0’s and 1’s)

Then init (L) is

A. 

set of all binary strings with unequal number of 0’s and 1’s

B. 

set of all binary strings including the null string

C. 

set of all binary strings with exactly one more 0’s than the number of 1’s or 1 more  than the number of 0’s

D. 

none of these

Option: B

28) If L1 and L2 are context free language and R a regular set, then which one of the languages below is not necessarily a context free language?

A. 

LL2

B. 

L1  ∩ L2

C. 

L1 ∩ R

D. 

L1  L2

Option: B

29) Consider a grammar with the following productions

                                     S-->   aab | bac | aB
                                     S -->  Î± S | b
                                     S -->  Î± b b | ab
                                     Sα --> bdb | b

               The above grammar is 

A. 

Context free

B. 

regular

C. 

context sensitive

D. 

LR ( k )

Option: C

30) What can be said about a regular language L over {a} whose minimal finite state automation has two states?

A. 

L must be { an | n is odd}

B. 

L must be { an | n is even}

C. 

 L must be {an | > 0}

D. 

Either L must be {an | n is odd}, or L must be {an | n is even}

Option: B

31)  In a context-sensitive grammar, number of grammar symbols on the left hand side of a production can't be greater than the number of

A. 

grammar symbols on the right hand side

B. 

terminals on the right hand side

C. 

non-terminals on the right hand side

D. 

 all of these

Option: C

32) In a context-free grammar

A. 

ε can't be the right hand side of any production

B. 

terminal symbols can't be present in the left hand side of any production

C. 

number of grammar symbols in the left hand side is not greater than the number of grammar symbols in the right hand side

D. 

all of these

Option: D

33) CFG can be recognized by a

A. 

push-down automata

B. 

2-way linear bounded automata

C. 

 both (a) and (b)

D. 

none of these

Option: C

34)  Which of the following statements are true?
I.    The set of all odd integers is a monoid under multiplication.
II.   The set of all complex number is a group under multiplication
III.  The set of all integers under the operation * given by a * b = a+b-ab is a monoid
IV.   Zs under symmetric difference   defined by
                     A B = (A-B)  (B-A) is an abelian group

A. 

I and II

B. 

I, III and IV

C. 

I, II and III

D. 

I, II and IV

Option: B

35)   A given grammar is called ambiguous if

A. 

two or more productions have the same non-terminal on the left hand side

B. 

a derivation tree has more than one associated sentence

C. 

there is a sentence with more than one derivation tree corresponding to it

D. 

brackets are not present in the grammar

Option: C

36)  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 enumerable language

Option: A

37) The grammars G = ( { s }, { 0, 1 }, p , s)
where p = (s —> 0S1, S —> OS, S —> S1, S —>0} is a

A. 

recursively enumerable language

B. 

regular language

C. 

context-sensitive language

D. 

context-free language

Option: B

38) The logic of pumping lemma is a good example of

A. 

pigeon-hole principle

B. 

divide-and-conquer technique

C. 

recursion

D. 

iteration

Option: A

39) The intersection of CFL and regular language

A. 

is always regular

B. 

is always context free

C. 

 both (a) and (b)

D. 

need not be regular

Option: B

40)  For two regular languages

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

Option: D

41) Context free grammar is not closed under

A. 

product

B. 

union

C. 

complementation 

D. 

kleen star

Option: C

42) If L be a language recognizable by a finite automaton, then language front

{L} = { w such that w is prefix of v where v  L },  is a

A. 

regular language

B. 

context-free language

C. 

context-sensitive language

D. 

recursive enumeration language

Option: A

43) For which of the following application, regular expressions can not be used ?

A. 

Designing computers

B. 

Designing compilers 

C. 

Both (a) and (b)

D. 

Developing computers

Option: C

44)  Consider the following grammar

                                   S --> Ax / By
                                   A --> By/Cw
                                    B --> x / Bw
                                    C--> y

Which of the regular expressions describe the same set of strings as the grammar ?

A. 

xw * y + xw * yx + ywx

B. 

xwy + xw * xy + ywx

C. 

xw * y + xw x yx + ywx

D. 

xw xy + xww * y + ywx

Option: A

45) Which of the following statements is (are) correct ?

A. 

Recursive languages 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 these

Option: D

46) 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. 

Intersection of context free language and a regular language is always context-free

D. 

All languages can be generated by context- free grammar

Option: D

47)  Consider a grammar :

                            G = ( { x , y ) , { s , x , y } , p ,  s)

where elements of parse :

                                   S--> x y
                                   S -->y x
                                   x--> x z
                                   x--> x
                                   y--> y
                                   z--> z

The language L generated by G most accurately is called

A. 

Chomsky type 0 

B. 

Chomsky type 1

C. 

 Chomsky type 2

D. 

Chomsky type 3

Option: D

48) Consider a grammar :

                      G = { { S } , { 0 , 1 } , p , s } 

where elements of p are:

                     S --> ss
                     S--> 0S1
                     S--> 1S0
                     S--> empty

The grammer will generate

A. 

regular language

B. 

 context-free language

C. 

context-sensitive language

D. 

 recursive enumerable language

Option: A

49) A grammar that produces more than one parse tree for some sentence is called

A. 

ambiguos

B. 

unambigous

C. 

regular

D. 

none of these

Option: A

50)  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) and (b)

D. 

none of these


Option: A

51) If a language is denoted by a regular expression
L = ( x )* (x | y x ) ,
 then which of the following is not a legal string within L ?

A. 

yx

B. 

xyx

C. 

x

D. 

x y x y x

 

Option: D



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

Option: A

53)  The defining language for developing a formalism in which language definitions can be stated, is called

A. 

syntactic meta language

B. 

decidable language

C. 

 intermediate language

D. 

high level language

Option: A

54)  If L be set of strings from alphabet, then kleen closure of L is given as

A. 

B. 

C. 

D. 

 


Option: B

55) If e1 and e2 are the regular expressions denoting the languages L1 and L2 respectively, then which of the following is wrong ?

A. 

(e1) | (e2) is a regular expression denoting L  L2

B. 

(e1) .(e2) is a regular expression denoting L1​. L2

C. 

φ is not a regular expression

D. 

 {ex} is a regular expression denoting L1*

Option: C

56)   

Context-free grammar can be recognized by

A. 

finite state automation

B. 

2-way linear bounded automata

C. 

push down automata 

D. 

both (b) and (c)

Option: D

57) he language L = (0n 1n 2n where n > 0) is a

A. 

context free language

B. 

context-sensitive language

C. 

regular language

D. 

recursive enumerable language

Option: B

58)  Context free language are closed under

A. 

union, intersection

B. 

union, kleene closure

C. 

intersection, complement

D. 

complement, kleene closure

Option: B

59)  If G = ({S}, {a}, {S -> SS), S),

then language generated by G is

A. 

L (G) =  Ï†

B. 

L(G) = an

C. 

L (G) =  a*

D. 

L (G) = anban

Option: A

60)   Grammar
S —> a,
S —> A3A,
 A3 —> A1, A3, A2 ,
A3 —> A1 A2, A1
A2—> aA2A1 ,
 A1a —> a A1
A2a —> aA2
A1A4 —> A4a,
A2A4 —> A5a, 
A2A5 —> A5a,
A5 —> a
                         generates

A. 

an^2

B. 

n2a

C. 

2an

D. 

none of these

Option: A

61)  If L1 = {x  | x is a palindrome in (0 + 1)*}
                 L2 = {letter (letter + digit)* };
                 L3 = (0n 1n 2n | n > 1}
                 L4 = {ambnam+n | m, n > 1}

then which of the following statement is correct ?

A. 

L1 is context free language and L3 is context sensitive language

B. 

L2 is a regular set and L4 is not a context free language

C. 

Both L1 and L2 are regular sets

D. 

Both L3 and L4 are context-sensitive languages

Option: A

62) A grammar to generate
{ (ab)n I n ≥ 1 }    { (ba)n I n ≥ 1 }
is constructed as

A. 

S ---> S1, S1 ---> abS1,  S1 ---> ab,  S ---> S2, S2 —> baS2, S2 —> ba

B. 

S ---> S, Sl ---> aS1, S1 ---> ab, S ---> S2, S2 ---> bS2, S2 —> bc

C. 

S —> S1,  S1—>S2, S2 —> S1a, S1 —> ab, S2 —> ba

D. 

none of these

Option: C

63) Consider the grammar
                             S ---> PQ | SQ | PS
                             P ---> x
                             Q-->   y
To get a string of n terminals, the number of productions to be used is

A. 

n2

B. 

n + 1

C. 

2n

D. 

2n - 1

Option: D

64) What is the highest type number which can be applied to the following grammar ?
S —> Aa, A —> Ba, B —> abc

A. 

Type 0

B. 

Type 1

C. 

Type 2

D. 

Type 3

Option: C

65)  Following syntax-directed translation scheme is used with a shift reduction (bottom up) parser that perform the action in braces immediately after a reduction by the corresponding production

A  —> aB  {print “(1)” A —> c {print “1”),
B —> Ab  {print *2”}.

When parser is aaacbbb, then string printed

A. 

0202021

B. 

1202020

C. 

1020202

D. 

none of these

Option: A

Theory Of Computation MCQ - Regular languages and finite automata 


1) Number of states of the FSM required to simulate behaviour of a computer with a memory capable of storing "m" words, each of length 'n'

A. 

m x 2n

B. 

2mn

C. 

2m+n

D. 

all of these

Option: B

2)   

An FSM with

A. 

1 stack is more powerful than an FSM with no stack 

B. 

2 stacks is more powerful than a FSM with 1 stack 

C. 

both (a) and (b)

D. 

None of these

Option: C

3) If two finite states machine M and N are isomorphic, then

A. 

M can be transformed to N, merely re-labelling its states 

B. 

M can be transformed to N, merely re-labelling its edges 

C. 

Both (a) and (b)

D. 

None of these

Option: A

4)   

Power of

A. 

DFSM and NDFSM are same

B. 

DFSM and NDFSM are different

C. 

DPDM and NDPDM are diferent

D. 

Both (A) and (C)

Option: D

5) Which of the folowing pairs of regular expressions are equivalent ?

A. 

1 (01)* and (10)* 1

B. 

x (xx) * and (xx) * x

C. 

x+ and x+x*+

D. 

All of these

Option: D

6)   

A finite state machine with the following state table has a single input x and a single output z. If initial state is unknown, then shortest input sequence to reach the inal state C is

 

 

Present state

Next state, z

 

X = 1

X =0

A

D, 0

B, 0

B

B, 1

C, 1

C

B, 0

D, 1

D

B, 1

C, 0

 

 

A. 

01

B. 

10

C. 

110

D. 

110

Option: B

7)  An FSM can be used to add how many given integers ?

A. 

1

B. 

3

C. 

4

D. 

2

Option: D

8)   

If two finite state machines are equivalent, they should have the same number of

A. 

states

B. 

edges

C. 

states and edges

D. 

none of these

Option: D

9) For which of the following applications regular expressions can be used ?

A. 

Designing compilers

B. 

Developing text editors

C. 

Simulating sequential circuits

D. 

All of these

Option: D

10)  L = {aP | p ; }  is prime is

A. 

regular

B. 

not regular

C. 

accepted by DFA

D. 

accepted by PDA

Option: B

11) In an incompletely specified automata

A. 

no edge should be labelled epsilon

B. 

from any given state, there can't be any token leading to two different states 

C. 

both (a) and (b)

D. 

start state may not be there

Option: D

12)   

If  f : {a, b}* —> (a, b}* be given by f (n) = ax for every value of n   (a, b}, then f is

A. 

one to one not onto

B. 

one to one and onto

C. 

not one to one and not onto

D. 

not one to one and onto

Option: A

13) The word 'formal' in formal languages means

A. 

the symbols used have well-defined meaning

B. 

they are unnecessary, in reality

C. 

only form of the string of symbols is significant

D. 

Both (a) and (b)

Option: C

14)  Running time of NFA to DFA conversion including the case where NFA has e-transition is

A. 

0 (n3)

B. 

0 (n332)

C. 

0 (n32n)

D. 

0 (n22n)

Option: C

15)   

Which of the following statements is/are false ?

A. 

The task of lexical analyzer is to translate the input source language text into tokens and determine the groups of tokens are inter-related. 

B. 

Two basic approaches to translation are generation and interpretation.

C. 

A load-and-go compiler is capable o translating the source language text on a host machine A that can be later run on any target machine B. 

D. 

None of these

Option: D

16) Which of the following are not regular ?

A. 

String of 0's whose length is a perfect square

B. 

Set of all palindromes made up of 0's and 1's

C. 

Strings of 0's, whose length is a prime number

D. 

All of these

Option: D

17) The main difference between a DFSA and an NDFSA is

A. 

in DFSA,  Îµ transition may be present

B. 

in NDFSA, ε transitions may be present

C. 

in DFSA, from any given state, there can't be any alphabet leading to two diferent states

D. 

in NDFSA, from any given state, there can't be any alphabet leading to two diferent states

Option: C

18) If w   (a, b)* satisfy abw = wab, then (w) is

A. 

even

B. 

odd

C. 

null

D. 

none of these

Option: A

19)  A PDM behaves like an FSM wnen the number of auxiliary memory it has, is

A. 

0

B. 

1

C. 

2

D. 

None of these

Option: A

20) Finite state machine can recognize

A. 

any grammar

B. 

only context-free grammar

C. 

Both (a) and (b)

D. 

only regular grammar 

Option: D

21) The major difference between a moore and mealy machine is that

A. 

 output of the former depends on the present state and present input

B. 

output of the former depends only on the present state

C. 

output of former depends only on the present input

D. 

all of these

Option: B

22)  Any given transition graph has an equivalent

 

A. 

 regular expression

B. 

DFSM 

 

C. 

NDFSM

 

D. 

all of these

Option: D

23) For which of the following application, regular expressions cannot be used ?

A. 

Designing computers

B. 

Designing compilers

C. 

Both (a) and (b)

 

D. 

Developing computers

Option: D

24) If S be an infinite set and be sets such that S S  ..... S= S, then

A. 

atleast one of the set Si is a finite set

 

 

B. 

not more than one of the sets Scan be finite

C. 

atleast one of the sets Si is an infinite set

 

D. 

not more than one of the sets Si can be infinite

Option: C

25) Vienna Definition Language is an example of language definition facility based on 

A. 

Mathematical semantics 

 

B. 

Interpretative semantics 

 

C. 

Translational semantics 

 

D. 

Axiomatic semantics

Option: A

26) Which of the following regular expressions denotes a language comprising all possible strings over the alphabet {a, b } ? 

A. 

 a* b*

 

B. 

(a | b)*

C. 

 (ab)+

D. 

 (a  | b*)

Option: B

27)   

An FSM (Finite State Machine) can be considered to be a TM (Turing Machine) of finite tape length

A. 

without rewinding capability and unidirectional tape movement.

B. 

rewinding capacity, and unidirectional tape movement

C. 

without rewinding capability and bidirectional tape movement

D. 

rewinding capability and bidirectional tape movement

Option: A

28) Palindromes can't be recognized by any FSM because

A. 

FSM can't remember arbitrarily large of information

B. 

FSM can't deterministically fix the mid-point

C. 

even if mid-point is known, FSM be can't be found  whether, second half of the string matches the first half 

D. 

all of these 


Option: D


29) If ∑ =  {a, b, c, d, e, f } then 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

Option: B

30) A language L is accepted by a finite automaton if and only if it is 

A. 

context - free

B. 

context-sensitive

C. 

recursive 

D. 

Right-linear

Option: D

31) Can a DFA simulate NFA?

 

A. 

NO

B. 

YES

C. 

SOMETIMES

D. 

Depends on NFA

Option: B

32) Which of the following statements is wrong ?

 

A. 

The language 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 exist NFA with L(r) any transit that accept

D. 

None of these 

Option: C

33) Regular expression a / b denotes the set 

A. 

 {a}

B. 

{ , a, b }

C. 

{a, b}

D. 

{ ab }

Option: C

34) Regular expression (a | b ) (a | b) denotes the set

A. 

{ a, b, ab, aa }

B. 

{ a, b, ba, bb }

C. 

{ a, b }

D. 

{ aa, ab, ba, bb }

Option: D

35)  Which of the following regular expressions denotes zero or more instances of an a or b ? 

A. 

a |  b

B. 

(ab)*

C. 

 (a | b)*

D. 

a* I b

Option: C

36) Which of the following regular expressions denotes a language comprising all possible strings of even length over the alphabet ( 0 , 1 ) ?

 

A. 

(0 | 1) *

B. 

(0 | 1) (0 | 1)* 

C. 

(00   01   10  11 )*

D. 

(0 | 1 ) (0 | 1)(0  | 1 ) * 

Option: C

37)  The regular expression (a | b)* denotes the set of all strings 

A. 

with zero or more instances of a or b

 

B. 

with one or more instances of a or b

 

C. 

equal to regular expression (a* b*)* 

D. 

both (a) and (c)

Option: D

38) The string (a) | ((b) * (c)) is equivalent to

 

A. 

set of strings with either a or zero or more b's and one c

 

B. 

set of strings with either a or one or more b's and one c 

C. 

b* c l a 

D. 

both (a) and (c) 

Option: C

39)  An automation is a __________ device and a grammar is a __________ device.

A. 

generative, cognitive

B. 

generative, acceptor

C. 

acceptor, cognitive 

D. 

cognitive, generative 

Option: D

40) In the figure given below, a deterministic finite automation M has start state A and accepting state D. Which of the following regular expression denoted the set of all words accepted by M ?    Theory of Computation Online Test

A. 

 001 

B. 

10 * 1 * 0

C. 

( 0 | 1) * 011

D. 

1* 0 * 001

Option: C

41) The regular sets are closed under

A. 

union

B. 

concatenation 

C. 

Kleene's closure

D. 

 all of these

Option: D

42) Dynamic errors can be detected at

A. 

compile time

 

B. 

Run time

 

C. 

both (a) and (b)

D. 

none of these

Option: B

43)   

If a and b be the regular expressions, then ( a*   b* ) *  is equivalent to 

A. 

(a b) *

B. 

 (b*  a*)* 

C. 

 (b a)*

D. 

All of above

Option: D

44) Finite state machines _________ recognize palindromes

A. 

can

B. 

can't

C. 

may 

D. 

may not

Option: B

45) If S and T be language over Σ = {a, b } represented by regular expression (a + b * ) *  and (a + b) * , respectively, then

 

A. 

S T

B. 

T S

C. 

 S = T 

D. 

S ∩  T= φ 

Option: C

46) Consider regular expression (0 + 1) (0 + 1) ....... n times. Minimum state finite automaton that recognizes the language represented by this regular expression contains 

A. 

n states

B. 

 n + 1 states

C. 

 n + 2 states

D. 

 none of these

Option: B

47) If regular set A is represented by A = (01 + 1)* and the regular set 'B' is represented by B = ((01)*1*)*, then 

A. 

A   B

B. 

 B  A

C. 

A and B are uncomparable 

D. 

 A=B 

Option: D

48) Which of the following can be recognized by a Deterministic Finite-state Automaton ? 

A. 

 Numbers, 1,2,4, ....... zN ..... written in binary. 

B. 

 

Numbers 1, 2, 4, ........, zN ...... written in unbinary.

C. 

Set of binary string in which number of zeros is same as the number of ones. 

D. 

 Set (1,101,11011,1110111, ......}

Option: A

49) Which of the following are not regular ?

A. 

String of 0’s whose length is a perfect square

B. 

Set of all palindromes made up of 0’s and 1's 

C. 

Strings of 0’s, whose length is a prime number 

D. 

All of these

Option: D

50)  An FSM with

A. 

1 stack is more powerful than an FSM with no stack

B. 

2 stacks is more powerful than a FSM with 1 stack

C. 

both (a) and (b)

D. 

none of these

Option: C

51) If w  (a, b)* satisfy abw = wab, then (w) is

A. 

even

B. 

odd 

C. 

null

D. 

none of these

Option: A

52) A PDM behaves like an FSM wnen the number of auxiliary memory it has, is

A. 

0

B. 

1

C. 

2

D. 

none of these

Option: A

53)   

A finite state machine with the following state table has a single input x and a single output z

 

 

Present state

Next state, z

 

       x = 1

      x = 0

A

     D, 0

     B, 0

B

      B,1

      C,1

C

      B, 0

     D, 1

D

      B, 1

     C, 0

 

             
               














If the initial state is unknown, then shortest input sequence to reach the final state C is

A. 

01

B. 

10

C. 

10

D. 

110

Option: B


54) FSM shown in the figure fsm

A. 

all strings

B. 

no string

C. 

 Îµ- alone

D. 

none of these

Option: C


55)   

If f : {a, b}* ---> {a , b } * be given by f(n) = ax for every value of n  {a, b}, then f is

A. 

one to one not onto

B. 

one to one and onto

C. 

not one to one and not onto

D. 

not one to one and onto

Option: A

56) If two finite states machine M and N are isomorphic, then

A. 

M can be transformed to N, merely re-labelling its states

B. 

M can be transformed to N, merely re-labelling its edges

C. 

M can be transformed to N, merely re-labelling its edges

D. 

none of these

Option: A


57)  Regular expression corresponding to the state diagram given in the figure isregular-expression

A. 

(0+1(1 + 01)* 00)*

B. 

(1 + 0 (0 + 10) 00)*

C. 

(0 + 1 (1 + 10) 00)*

D. 

(1 + 0(1 + 00) 11)*

Option: A


58)   

Two finite state machines are said to be equivalent if they

A. 

have same number of states

B. 

have same number of edges

C. 

have same number of states and edges

D. 

recognize same set of tokens

Option: C 




  

1)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 or recursively enumerable

D. 

None of these

 


 


2)  If nL can be recognized by a multitape TM with time complexity f, then L can be recognized by a one-tape machine with time complexity  DSD

A. 

O( 2)

B. 

o( f 2)

C. 

o(h)

D. 

O(h2)


3) If T is a TM recognizing L, and T reads every symbol in the input string, Ï„T(n) ≥  2n + 2, then any language that can be accepted by a TM T with Ï„T(n) = 2n + 2 is

A. 

regular

B. 

not regular

C. 

uncertain

D. 

none of these


4) Consider an alternate Turing machine model, in which there is an input tape on which the tape head can move in both directions but cannot write, and one or more work tapes, one of which serves as an output tape. For a function f, denoted by DSpace ( f ) , the set of languages that can be recognized by a Turning machine of this type which uses no more than f(n) squares on any work tape for any input string of length n. The only restriction we need to make on f is that f(n) > 0 for every n. The language of balanced strings of parentheses are in

A. 

DSpace (1+  log2 (n + 1 ). ( x  ) means the smallest integer greater than or equal to x.

B. 

DSpace (1+ logn)

C. 

DSpace ( 1+  log2 n2)

D. 

none of these


5)  Which of the following problems is solvable ?

A. 

Writing a universal Turing machine

B. 

Determining of an arbitrary turing machine is an 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


6) Which of the following is not primitive recursive but partially recursive ?

A. 

Carnot's function 

B. 

Ricmann function

C. 

Bounded function

D. 

Ackermann's function


7)Turing machine (TM) is more powerful than FMS (Finite State Machine) because

A. 

tape movement is confined to one direction

B. 

it has no finite state

C. 

it has the capability to remember arbitrarily long sequences of input symbols

D. 

none of these


8)   If f : N--> N. If L can be recoognized by a TM T, so that Ï„T(n) ≤ f (n) for all but finitely many n, then ( Time (f) means Time ( max ( f, 2n +2))). 

A. 

L  Time (f)

B. 

L    Time(cf)

C. 

L   Time (h)

D. 

none of these


9) Let s is a step-counting function satisfying s(n) ≥ n, and L be a language accepted by a (multitape) TM T. If tape heads of T do not move past square s(n) on any of the tapes for an input string of length n, then T 

A. 

Space(s)

B. 

F(n)

C. 

Time(f)

D. 

Time(h)


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


11) Bounded minimalization is a technique for

A. 

proving whether a promotive recursive function is turning 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


12) 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, is called

A. 

recursive

B. 

recursively enumerable

C. 

NP-HARD

D. 

none of these


13) Which of the following statement(s) is/are correct?

A. 

L = {an bn an | n = 1, 2, 3...} is recursively enumerable

B. 

Recursive languages are closed under union

C. 

Every recursive is closed under union

D. 

All of these


14) Universal TM influenced the concept of

A. 

stored program computers

B. 

interpretative implementation of programming language

C. 

computability

D. 

all of these


15)  Number of external states of a UTM should be atleast

A. 

1

B. 

2

C. 

3

D. 

4

16) The statement, “A TM can’t solve halting problem” is

A. 

true

B. 

false

C. 

still an open question

D. 

all of these


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


18)Given a Turing machine T and a step-counting function f, is the language accepted by T in Time(f) ? This decision problem is

A. 

solvable

B. 

unsolvable

C. 

uncertain

D. 

none of these


19) A total recursive function is a 

A. 

partial recursive function

B. 

premitive recursive function

C. 

both (a) and (b)

D. 

none of these


20) 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. 

n2

B. 

n

C. 

n3

D. 

nn

21) 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}


22)  If L can be recognized by a TM T with a doubly infinite tape, and Ï„t = f, then L can be recognized by an ordinary TM with time complexity

A. 

O(f)

B. 

o(f)

C. 

O(h)

D. 

o(h)



Thank you


Post a Comment

Previous Post Next Post