0% found this document useful (0 votes)
234 views475 pages

Toc

This document contains a series of multiple choice questions related to finite state machines and regular languages. Some key points covered include: 1. The components of a finite automaton include the state set Q, input alphabet Σ, transition function δ, initial state q0, and set of final/accepting states F. 2. DFAs and NFAs accept the same class of languages known as regular languages. NFAs are more powerful than DFAs in that they allow multiple transitions on a single input. 3. Finite state machines have limitations like an inability to perform operations like multiplication or recognize palindromes due to their finite memory. 4. In a Mealy machine, the

Uploaded by

Shekhar Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
234 views475 pages

Toc

This document contains a series of multiple choice questions related to finite state machines and regular languages. Some key points covered include: 1. The components of a finite automaton include the state set Q, input alphabet Σ, transition function δ, initial state q0, and set of final/accepting states F. 2. DFAs and NFAs accept the same class of languages known as regular languages. NFAs are more powerful than DFAs in that they allow multiple transitions on a single input. 3. Finite state machines have limitations like an inability to perform operations like multiplication or recognize palindromes due to their finite memory. 4. In a Mealy machine, the

Uploaded by

Shekhar Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 475

UNIT I

Which of the following is a not a part of 5-tuple finite automata?


A. Input alphabet
B. Transition function
C. Output Alphabet
D. Initial State

As per the formal definition of finite automata, it contains the tuples as:
A. (Q, ∑, q0, F)
B. (Q, q0, F)
C. (Q, ∑, δ , q0, F)
D. (Q, ∑, δ , F)

Which of the following is TRUE ?


A. DFA and NFA have same power
B. DFA is more powerful than NFA
C. NFA is more powerful than DFA
D. All of these

The language accepted by DFA is known as:


A. Context free language
B. Regular language
C. Context sensitive language
D. Recursive language

What are the limitations of finite state machine?


A. Impossibility of multiplication
B. Impossibility of palindrome recognition
C. Limited memory
D. All of these
E. None of these
F. (A) and (B) only

In case of Mealy machine, the output of finite state machine depends on what?
A. Current input state
B. Current state and current input symbol
C. Output symbol of previous state
D. Current input symbol and previous output symbol

Mealy and Moore machine are equivalent with each other or not?
A. Yes
B. No
C. Cant say
As per the formal definition of Mealy machine, it contains the tuples as:
A. (Q, ∑, Δ, δ , λ, q0)
B. (Q, Δ, q0, F)
C. (Q, ∑, δ , q0, F)
D. (Q, ∑, δ , F)

With non-deterministic finite automata having Q input states, then how many possible states can be
there for any transition?
A. Q
B. 2Q
C. (2Q – 1)
D. (Q - 1)

Which of the following is transition function for NFA ?


A. ∑ X Q --> ∑
B. Q X ∑ --> ∑
C. Q X ∑ --> Q
D. Q X ∑ --> 2^Q

Finite state machine ________ recognize well formed parenthesis expression.


A. can
B. cannot
C. may
D. maynot

In the Mealy machine , outputs are the function of


A. Both current state Q and input I
B. Independent of current Input
C. Dependent of current Input only.
D. None of these

For a given Moore Machine, Given Input=’101010’, thus the output would be of length:
A. |Input|+1
B. |Input|
C. |Input-1|
D. Cannot be predicted

Which of the following is not a correct statement?


a) Moore machine has no accepting states
b) Mealy machine has no accepting states
c) We can convert Mealy to Moore but not vice versa
d) All of the mentioned

Moore machine is an application of


A. Finite automata with Input
B. Finite automata with Output
C. Non Finite automata with output
D. None of these
In Moore machine output is produced over the change of
A. Transitions
B. States
C. Both
D. None of these

I. Null string is accepted in Moore machine


II. There are more than 5 tuples in moore machine
A. Statement I is true & II is false
B. Statement I & II are false
C. Statement I & II are true
D. Statement I is false & II is True.

FSM can recognize only


A. Regular language
B. Formal language
C. Context free language
D. All of these

Automata that includes transitions on empty input symbol is called ______


A. DFA
B. NFA
C. NFA with epsilon
D. None of these

NFA is also known as possibilistic machine.


A. True
B. False

Limitations of finite state machine (FA) can overcome by:


A. Push down automata
B. Turing machine
C. Both A and B
D. None of these

If ∑ = a then ∑* = ?
A. {^, a, aa,…..}
B. {^ , a , aa}
C. {^}
D. {a, aa,…..}

FA is called NFA when there exists _____ for a specific input from current state to next state.
A. Single path
B. Only two paths
C. Multiple paths
D. None
Two states are said to be equivalent states if ____
A. They undergo the same transitions on same input symbol
B. They are of same type i.e. either final or non final state
C. Both
D. None

In DFA minimization we can replace initial state by any other state.


A. True
B. False

In DFA minimization we can replace one non final state by


A. Initial State
B. Final State
C. Non final state
D. None of these

A state is said to be __________ state if it can not be reached from initial state on reading any input
symbol
A. reachable
B. Dead
C. Trap
D. Unreachable

The major difference between Mealy and Moore machine is about:


A. Output Variations
B. Input Variations
C. Both
D. None of the mentioned

The output alphabet can be represented as:


A. δ
B. ∆
C. ∑
D. None of the mentioned

The smallest finite automata which accepts the language { x | length of x is divisible by 3} has how
many states?
A. two
B. four
C. three
D. five

Which of the following statement 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 lanuguage.
C. for a regular expression r , there does not exist any NFA with transit that accepts L(r).
D. None of these
Palindromes cant be recognized by any FSM because
A. FSM cant remenber arbitrarily large amount of information.
B. FSM cant deterministicaly fix the mid point.
C. Even of the mid point is known, FSM cant find whether the second half of the string matches the
first half.
D. All of the above

The NFA and DFA are _________


A. Equivalent but there power is different
B. Not equivalent but not powerful
C. having different power
D. Equivalent and have equal power.

What is the output for the given language?


Language: A set of strings over ∑= {a, b} is taken as input and it prints 1 as an output “for every
occurrence of a, b as its substring. (INPUT: abaaab)
A. 0010000
B. 0101010
C. 0111010
D. 0010001

Under which of the following operation, NFA is not closed?


A. Negation
B. Kleene
C. Concatenation
D. None of the mentioned

If given DFA accepts the language containing strings which ends either with consecutive two 0’s or two
1’s , then the minimum number of states in DFA will be:
A. two
B. three
C. four
D. five
UNIT II

The languages accepted by finite automata are represented by what type of expression?
A. Regular Expression
B. Finite Expression
C. Automata Expression
D. Arithmetic Expression

The languages represented by regular expression are known as:


A. Finite Langauge
B. Regular Language
C. Automata Language
D. Numeric Language
What does ‘.’ operator indicate in case of regular expressions?
A. Concatenation
B. Alteration
C. Iteration with zero or more occurrences
D. Iteration with one or more occurrences

What does ‘*’ operator indicate in case of regular expressions?


A. Concatenation
B. Alteration
C. Iteration with zero or more occurrences
D. Iteration with one or more occurrences

Whether (a . b)* is equivalent to (a*.b*) ?


A. TRUE
B. FALSE

If regular expression is r = ab*a, then is string abbbbbba valid or invalid string belonging to the
language represented by given regular expression?
A. Valid string
B. Invalid string

+
If regular expression is r = ab aa, then does string aaa belong to the language represented by given
regular expression?
A. TRUE
B. FALSE

If regular expression is r = a*b*a, then what will be the length of minimum acceptable string?
A. 2
B. 3
C. 1
D. 0

Select the regular expression to represent set of all words over {0,1} containing at least one ‘0’
A. 0+1
B. 0*1*
C. (0+1)* 0 (0+1)*
D. (0*1*)*

Is the given statement correct? Statement as “For every regular expression there exists an equivalent
finite automata”
A. TRUE
B. FALSE
Consider the regular expression as (0+1) . How many states will be created to convert given regular
expression into non-deterministic finite automata with empty moves (As per Kleen’s theorem)?
A. 3
B. 5
C. 4
D. 6

Consider the regular expression as (0.1) . How many states will be created to convert given regular
expression into non-deterministic finite automata with empty moves (As per Kleen’s theorem)?
A. 3
B. 5
C. 4
D. 6

Consider the regular expression as (0*) . How many states will be created to convert given regular
expression into non-deterministic finite automata with empty moves (As per Kleen’s theorem)?
A. 3
B. 5
C. 4
D. 6

What will be the equivalent regular expression for self-loop transition on symbol a in any given finite
automata?
A. a*
B. a
C. a+
D. epsilon

Arden’s theorem is used for what?


A. To convert regular expression to DFA
B. To convert DFA to regular expression
C. To convert regular expression to NFA
C. To convert regular expression to NFA with empty moves

Regular sets are closed under union operation. TRUE or FALSE?


A. FALSE
B. TRUE

Regular language is closed under which operation?


A. Concatenation
B. Addition
C. Multiplication
D. Division

If L is a regular language, then will be the kleen closure of L also a regular language?
A. Yes. IT will be a regular language
B. No. It will not be a regular language.
The given statement is - If any sufficiently long string accepted by FSM is given, then we can find a
sub-string near the beginning of the string that may be repeated as many times as we like, and the
resulting string will still be accepted by the same FSM. Such property of regular languages is known as
A. Kleen closure
B. Arden’s theorem
C. Pumping Lemma
D. None of these

What is the use of pumping lemma?


A. To check the regularity of certain languages
B. To convert regular expression into DFA
C. To check the closure properties of regular sets
D. To convert DFA into regular expression

As per Arden’s theorem, if P, Q, R are regular expressions and if R = P+RQ or R = RQ + P; then R can
be simplified as
A. R=PQ*
B. R=P*Q*
C. R=P*Q
D. R=Q*P*

As per Arden’s theorem, if P, Q, R are regular expressions and if R = P+QR or R = QR + P; then R can
be simplified as
A. R=Q*P
B. R=Q*P*
C. R=PQ*
D. R=QP*

What is the significance of regular expression in the implementation of text editors?


A. For find and replace facility
B. For cut, copy, paste facility
C. For insert table facility
D. For create or delete a file facility

For UNIX/Linux operating system, which command is used as a command-line text search utility?
A. find
B. pwd
C. search
D. grep
Regular languages are closed under
A. Union, intersection
B. Kleen closure, union
C. Concatenation, complement
D. Complement, positive closure
What are the different algorithmic solutions to obtain regular expression from given finite automata?
A. iterative solution
B. Arden’s theorem with equation solving
C. All these options
D. None of these options

If regular expression is RE = 01*0*, then will be an empty string accepted by the language represented
by given regular expression?
A. Yes
B. No

If regular expression is r = (0+1*), then which of the string belong to the language represented by given
regular expression?
A. 100
B. 101
C. 011
D. 11111

If regular expression is r = a* (b+a) b*, then what will be the length of minimum acceptable string?
A. 2
B. 3
C. 1
D. 0

What does ‘+’ operator indicate in case of regular expressions?


A. Concatenation and positive closure
B. Alteration and concatenation
C. Iteration with zero or more occurrences
D. Alteration and positive closure

Select the option to describe language represented by regular expression as (0+1)*. 1.1
A. Language represents - strings ending with 11 and these contains minimum two consecutive 1’s
B. Language represents strings ending with 11
C. Language represents strings, which contains minimum two consecutive 1’s
D. Language represents strings containing empty strings

What will be the regular expression to describe language over {a,b} containing exactly two a’s ?
A. RE = (aa+bb)*
B. RE = (a+b)*
C. RE = aa+bb
D. RE = (b* a b* a b*)
Whether (a + b)* is equivalent to (a + b)* + (a + b)* ?
A. TRUE
B. FALSE
Consider the regular expression as (0+1)* . How many states will be created to convert given regular
expression into non-deterministic finite automata with empty moves (As per Kleen’s theorem)?
A. 8
B. 5
C. 4
D. 6

Consider the regular expression as (a + b) . (a + b)* . How many minimum number of states will be
created to convert given regular expression into deterministic finite automata?
A. 1
B. 2
C. 4
D. 3

Select the regular expression for valid identifiers of ‘C’ programming language.
A. (letter).(letter + digit)*
B. (letter).(letter + digit + _)*
C. (letter + _).(letter + digit + _)*
D. (letter + digit)*

Which of the following regular expression over {a,b} represent the set of words , that do not contain
‘baa’ as a sub-string?
A. a* (a+b)*
B. a*bab
C. a*baba*
D. b*a*

Which of the following regular expression is equivalent with the language represented by CFG given as
below:
S → ABA
A→ 0 A | 1 A | ε
B → 111

A. (0*+ 1*) .111 . (0* + 1*)


B. (0+1)* . 111. (0+1)*
C. (111)
D. ε

Find out whether the following context free grammar is ambiguous or not?
S → aAb | aBA
A →Sab|a
B →bB|b

A. Yes
B. No
What is the category of regular grammar in Chomsky hierarchy?
A. TYPE 0
B. TYPE 1
C. TYPE 2
D. TYPE 3

The production rules belonging to any context free grammar will have which of the following
syntactical and generic form?
A. α → β , where α and β belongs to (V U T)* and β ≠ ε
B. Aα → β , where A is any non-terminal, α and β belongs to (V U T)* and α ≠ ε
C. α → β , where α and β belongs to (V U T)* and α and/or β can be ε
D. A → β , where A is any non-terminal and β belongs to (V U T)* and β can be ε

If context free language L(G) = {ab, aabb, aaabbb, aaaabbbb, ...} = {anbn | n >=1}, then its equivalent
context free grammar will be:
A. S→aAb, A→ ab
B. S→aSb, S→ ε, S->ab
C. S→aSb, S→ ε
D. S→aAb, A→ aSb, S→ ε

UNIT III

A context free grammar is denoted by quadruple of the form (V, T, P, S) where


A. V is set of terminals, T is set of non-terminals, P is set of production rules and S is starting non-
terminal symbol
B. V is set of non-terminals, T is set of terminals, P is set of production rules and S is starting non-
terminal symbol
C. V is set of non-terminals, T is set of terminals, P is set of production rules and S is starting terminal
symbol
D. V is set of variables, T is set of non-terminals, P is a production rule and S is starting terminal
symbol

Context free grammar contains the production rules of the form: (where A is a non-terminal and α is a
sentential form)
A. A → α
B. α → A
C. A α → A
D. α → A α

If a production rule is applied to leftmost variable at each step of derivation, then such derivation is
called as
A. Leftmost derivation
B. Derivation tree
C. Rightmost derivation
D. None of these
If a production rule is applied to rightmost non-terminal at each step of derivation, then such derivation
is called as
A. Leftmost derivation
B. Derivation tree
C. Rightmost derivation
D. None of these

In which fashion does leftmost derivation generate any string belonging to the language represented by
any given CFG?
A. From right to left fashion
B. from left to right fashion
C. from top to bottom fashion
D. from bottom to top fashion

In which fashion does rightmost derivation generate any string belonging to the language represented
by any given CFG?
A. From right to left fashion
B. from left to right fashion
C. from top to bottom fashion
D. from bottom to top fashion

Are leftmost derivation, rightmost derivation and derivation tree equivalent or not?
A. TRUE
B. FALSE

Which symbol of CFG will be the root of derivation tree to parse any valid string belonging to given
CFG?
A. Ending non-terminal symbol
B. Starting terminal symbol
C. Ending terminal symbol
D. Starting non-terminal symbol

How many nodes will be created/drawn in derivation tree to derive the string ‘aabbaa’ from following
context free grammar (CFG)?
S → aAS | a
A → SbA | SS | ba
where S is a starting symbol
A. 10
B. 13
C. 11
D. 8
How many terminal symbols, non-terminal symbols and production rules are mentioned in the
following CFG?
S → aAS | a
A → SbA | SS | ba

A. 2, 1, 5
B. 1, 2, 2
C. 2, 5, 5
D. 2, 2, 5

Assume regular expression over {a, b} as (ab*). Does the context free grammar for this regular
expression contain empty production rule?
A. Yes, it contains empty production rule for starting non-terminal symbol
B. No, it does not contain empty production rule for any non-terminal
C. Yes, it contains empty production rule for non-starting (intermediate) non-terminal symbol
D. None of the options

A context free grammar is said to be ambiguous grammar, if


A. There exists more than one leftmost derivations for at least one string
B. There exists more than one rightmost derivations for at least one string
C. There exists more than one derivation tree for at least one string
D. All of the options

What are the possible solutions to remove ambiguity from CFG of arithmetic expression grammar?
A. Consider the information of arithmetic operator’s precedence while writing CFG rules
B. Consider the information of arithmetic operator’s left asscociativity while writing CFG rules
C. Consider the information of arithmetic operator’s right asscociativity while writing CFG rules
D. All the options

If there does not exist any derivation for non-terminal symbol ‘X’ for given CFG, then such symbol ‘X’
is known as
A. Useful symbol
B. Useless symbol
C. Ambiguous symbol
D. Unambiguous symbol

Unit production rule is of the form


A. A → B ε
B. A → B C α
C. AB → C
D. A → α AB, where α belongs to (V U T)*

What are the possible solutions to simplify the given context free grammar
A. Removal of useless symbol
B. Removal of unit production
C. Elimination of ε-production (empty production)
D. All the options
Consider the Context free grammar (with starting symbol ‘S’) as:
S → AB | a
A→a
How many production rules will be there after simplifying the above grammar?
A. 2
B. 3
C. 1
D. 0

Consider the Context free grammar (with starting symbol ‘A’) as:
A→B
B→a|b
How many production rules will be there after simplifying the above grammar?
A. 2
B. 3
C. 1
D. 0

Chomsky normal form impose which of the following constraints on production rules of CFG
A. either have two non-terminal or a single terminal symbol on right hand side of every production
B. either have single non-terminal or two terminal symbols on right hand side of every production
C. Only non-terminal symbols or only terminal symbols in any number on right hand side of every
production
D. have a single terminal symbol followed by string containing only non-terminals (zero or more)

Gribach normal form impose which of the following constraints on production rules of CFG
A. either have two non-terminal or a single terminal symbol on right hand side of every production
B. have a single terminal symbol followed by string containing only non-terminals (zero or more)
C. have a single terminal symbol
D. have multiple terminal symbol followed by string containing only non-terminals (zero or more)

As per Chomsky hierarchy, how many types of grammar does exist?


A. 3
B. 2
C. 5
D. 4

As per Chomsky hierarchy, Context free grammar is known as


A. Type-0 grammar
B. Type-1 grammar
C. Type-2 grammar
D. Type-3 grammar

As per Chomsky hierarchy, Type-1 grammar is known as


A. Regular grammar
B. Context free grammar
C. Unrestricted grammar
D. Context sensitive grammar
Which machines are used to recognize the languages generated by Type-0 and Type-1 grammar
A. Finite automata
B. Push down automata
C. Turing machines
D. Post machies

Regular languages are generated and recognized by:


A. Finite State Machine
B. Push down automata
C. Turing machines
D. Post machies

Regular grammar contains


A. at most one non-terminal symbol on right hand side of every production
B. at most one terminal symbol on right hand side of every production
C. any number of non-terminal symbols on right hand side of every production
D. Exactly one non-terminal symbol on right hand side of every production

A left linear regular grammar contains:


A. at most one non-terminal symbol as leftmost symbol on right hand side of every production
B. at most one non-terminal symbol as rightmost symbol on right hand side of every production
C. Exactly one non-terminal symbol as leftmost symbol on right hand side of every production
D. Exactly one non-terminal symbol as rightmost symbol on right hand side of every production

A right linear regular grammar contains:


A. at most one non-terminal symbol as leftmost symbol on right hand side of every production
B. at most one non-terminal symbol as rightmost symbol on right hand side of every production
C. Exactly one non-terminal symbol as leftmost symbol on right hand side of every production
D. Exactly one non-terminal symbol as rightmost symbol on right hand side of every production

The statement is : A left linear and right linear regular grammar can be converted into each other
equivalently. Is it TRUE or FALSE?
A. TRUE
B. FASLE

Context free grammar is used in which the phase of compiler?


A. Lexical analyzer
B. Syntax analyzer
C. Semantic analyzer
D. Code optimization
Which of the following regular expression is equivalent with the language represented by CFG given as
below:
S → ABA
A→ 0 A | 1 A | ε
B → 111

A. (0*+ 1*) .111 . (0* + 1*)


B. (0+1)* . 111. (0+1)*
C. (111)
D. ε

Find out whether the following context free grammar is ambiguous or not?
S → aAb | aBA
A →Sab|a
B →bB|b

A. Yes
B. No

What is the category of regular grammar in Chomsky hierarchy?


A. TYPE 0
B. TYPE 1
C. TYPE 2
D. TYPE 3

The production rules belonging to any context free grammar will have which of the following
syntactical and generic form?
A. α → β , where α and β belongs to (V U T)* and β ≠ ε
B. Aα → β , where A is any non-terminal, α and β belongs to (V U T)* and α ≠ ε
C. α → β , where α and β belongs to (V U T)* and α and/or β can be ε
D. A → β , where A is any non-terminal and β belongs to (V U T)* and β can be ε

If context free language L(G) = {ab, aabb, aaabbb, aaaabbbb, ...} = {anbn | n >=1}, then its equivalent
context free grammar will be:
A. S→aAb, A→ ab
B. S→aSb, S→ ε, S->ab
C. S→aSb, S→ ε
D. S→aAb, A→ aSb, S→ ε

The set of productions for the grammar G is P = { A → ab | aA ; aAb → aBCb }. Hence G is:
A. Type-0 grammar
B. Type-1 grammar
C. Type-2 grammar
D. Type-3 grammar
k k
The language L = { a b | k>= 1} is:
A. Type-0 language
B. Type-1 language
C. Type-2 language
D. Type-3 language
Theory of Computation (TOC)
The respondent's email ([email protected]) was recorded on submission of
this form.

Unit Test-II AY-2021-2022 Sem-I

Instructions to Students
1. Attempt all 30 MCQ's.
2. Total time for exam is 30minutes.
3. Submit test on time.
4. No second Attempt is Allowed.

Personal Information

Enter Mobile Number *

9172604237

Enter Roll No. *


Write full roll number e.g. BECOA101

TECOC382

Enter Your Name *


Write your full name e g F name M name L Name
Write your full name e.g. F_name M_name L_Name

Pratik Kumar Patil

Class and Division *

TE A

TE B

TE C

TE D

Theory of Computation (TOC)

Find out whether the following context free grammar is ambiguous or not? *

YES

NO

Context free languages are closed under ___________ *

Union

Concatenation
Intersection

Kleen closure

Consider the transition diagram of a PDA given below with input alphabet Σ=
{a,b} and stack alphabet Γ={X, Z} where Z is the initial stack symbol. Which one of
the following is TRUE? *

L={a^2n b^n |n≥0}

L={a^n b^n |n≥0}

L={a^n|n≥0} ∪{ a^n b^n|n≥0}

L={a^n b^2n |n≥0}

Acceptance of Context free language in PDA is shown by __________ *

both

only final state

Empty Stack
py

Final State

The restrictions on the form of production rules in Chomsky normal form allows
how many non-terminal and terminal symbols on right hand side of the rule: *

One non-terminal and two terminal symbols

One non-terminal and one terminal symbols

Two non-terminal and two terminal symbols

Two non-terminal and one terminal symbols

Select the correct grammar for language over {0,1} consisting of palindrome
strings of odd length *

P -> ε | 0 | 1 | 0P0 | 1P1

P -> 0 | 1 | 0P0 | 1P1

P -> ε | 0P0 | 1P1

None of the mentioned

PDA can be represented by *

both transtion table & graph

Transition table
Transition Graph

All of these

ID (Instantaneous Description)

Describe the context free language represented by following CFG. S -> aSb | ab *

language contains same number of a's and b's

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

language contains single occurrence of a and b

language contains same number of a's , b's and a's are strictly followed by b's

A Deterministic pushdown automata is having transition to each configuration *

more than one

exactly one

any number

at most one

In which phase of compiler construction, context free grammar can be used? *

Lexical analysis

Syntax analysis

Semantic analysis

Intermediate code generation


_______is an external storage in PDA *

Oueue

COntrol Unit

Stack

FSM

The problem of creating the generic solution to remove ambiguity of any


ambiguous grammar is: *

Unsolvable problem

Semi-solvable problem

Solvable problem

Halting problem

The production rules belonging to any context free grammar will have which of
the following syntactical and generic form? *

α → β , where α and β belongs to (V U T)* and β ≠ ε

Aα → β , where A is any non-terminal, α and β belongs to (V U T)* and α ≠ ε

β h dβb l t (V U T)* d d/ β b
α → β , where α and β belongs to (V U T)* and α and/or β can be ε

A → β , where A is any non-terminal and β belongs to (V U T)* and β can be ε

Which of the following statement is false? *

CFG can be converted into PDA

PDA can not converted into context free language

CFG and PDA are equivalent

None of these

Difference in FSM and PDA is *

No. of states

Its Memory

Control unit

None of these

Puhdown automata are abstract device that recognize *

None of the above.

Unrestricted Grammar

Context sensitive Grammar

Context free grammar


A PDA machine configuration δ(q, a, X) can be correctly represented as: *

(current state, unprocessed input, stack content)

none of the mentioned

(current state, stack content, unprocessed input)

(unprocessed input, stack content, current state)

Select the suitable and valid production rule format that belongs to Chomsky
Normal Form. (Note: 'A , 'B', 'C' are non-terminals and 'a', 'b' are terminal symbols)
*

A -> B

A -> BC

A -> a

A -> ab

Whether left linear grammar, right linear grammar, regular expression, finite state
machines are equivalent to each other? *

TRUE

FALSE
Any empty production or ε-production of form A → ε, is a unit production or
not? *

YES

NO

A push down automata accepts the language if it is *

Both

CFL

Regular

None

A pushdown automata can be defined as: (Q, ∑, Γ, δ, q0, z0, F ) What does the
symbol z0 represents? *

all of the mentioned

an element of Γ

initial stack symbol

initial top stack alphabet


What is the category of regular grammar in Chomsky hierarchy? *

TYPE 0 grammar

TYPE 1 grammar

TYPE 2 grammar

TYPE 3 grammar

If given grammar contains rules as A → B, B → a, B → b where A and B are not-


terminals and a and b are terminal symbols, then the simplified grammar would
be: *

A→a

B→b

A→a|b

B→a|b

To construct CFG from PDA , we include production rules for _______ *

Each move erasing the pushdown symbol

All of these

Start Symbol
Sta t Sy bo

Each move not erasing the pushdown symbol

Pushdown Automata can accept ________Language *

Context Free

Context Sensitive

Recursively Enumerable

Regular

The given context free grammar contains how many useless symbols: *

One

Two

Zero

Three

"No restriction on formation of production rules of grammar" is a feature of what


kind of grammar? *

TYPE 1 grammar

TYPE 0 grammar
TYPE 0 grammar

TYPE 3 grammar

TYPE 2 grammar

Context free languages are closed under which of the following *

Complement, Kleen Closure

Union , Kleen Closure

Union , Intersection

Intersection, Complement

The class of the language accepted by the PDA is ________ as compared to FSM.
*

larger

Same

Smaller

Cant say

This form was created inside of Pimpri Chinchwad College of Engineering.

 Forms
Marks: 10

What is Computation?

Select one:
a. Computation is graphical representation.
b. None of the above.
c. Both A and B.
d. Computation is the step by step solution of the given problem.

Which of the following is correct about Machine?

Select one:
a. Machine is an Electronic device.
b. Machine is an Mechanical device.
c. All of the above.
d. Machine is an Electrical device

Which of the following language is invented to serve the purpose with well defined
syntax and semantics?

Select one:
a. None of the above.
b. Formal Language.
c. Recursive Language.
d. Natural Language.

What is the formula for state function in Finite State Machine?

Select one:
a. I x S -> O
b. I x S -> S
c. I x S -> I'
d. I X S -> S'

How many possible states are there in divisibility by 3-tester?

Select one:
a. 2
b. 3
c. 5
d. 4

What is Language?

Select one:
a. It is a finite set of strings over an alphabet.
b. None of the above.
c. It is a finite set of symbols.
d. It is an infinite set of strings over an alphabet.

Which of the following symbol is used to represent the Alphabet?

Select one:
a. W
b. None of the above
c. Θ
d. Σ

What is the formula for machine function in Finite State Machine?

Select one:
a. I x S -> O
b. I X S -> S'
c. I x S -> S
d. I x S -> I'

What is Alphabet?

Select one:
a. It is finite empty set of symbol.
b. It is infinite empty set of symbols.
c. It is infinite non empty set of symbol.
d. It is finite non empty set of symbol.
What is the length of the given string w=101101

Select one:
a. |w|=5
b. w=5
c. |w|=6
d. w=6
Marks: 09

NFA, in its name has 'non-deterministic' because of :

Select one:
a. The result is undetermined
b. All of the mentioned
c. The state to be transited next is non-deterministic
d. The choice of path is non-deterministic

What language does the following DFA compute?

Select one:
a.
b.
c.
d.

What language does the following DFA compute?


Statement 1: Initial State of NFA is Initial State of DFA.
Statement 2: The final state of DFA will be every combination of final state of NFA.
Select one:
a. Statement 1 can be true and Statement 2 is true
b. Statement 1 is true and Statement 2 is false
c. Statement 1 is true and Statement 2 is true
d. Statement 1 is false and Statement 2 is also false

What language does the following DFA compute?

Select one:
a.

b.
c.

d.

If NFA of 6 states excluding the initial state is converted into DFA, maximum possible
number of states for the DFA is ?

Select one:
a. 128
b. 64
c. 32
d. 127

Which of the following option is correct?

Select one:
a. DFA is slower to process and its representation uses less memory than NFA
b. NFA is slower to process and its representation uses more memory than DFA
c. DFA is faster to process and its representation uses less memory than NFA
d. NFA is slower to process and its representation uses less memory than DFA
Which of the following is correct proposition? Statement 1: Non determinism is a
generalization of Determinism. Statement 2: Every DFA is automatically an NFA

Select one:
a. Statement 1 is correct because Statement 2 is correct
b. Statement 2 is false and Statement 1 is false
c. Statement 2 is correct because Statement 1 is correct
d. Statement 1 is false because Statement 2 is false

Which of the string does the following DFA accepts

Select one:
a. 00110
b. 00111

What is the DFA for the language { w | w start with b and has at most one a}

Select one:

a.
b.

c.

d.

There are ________ tuples in DFA.

Select one:
a. 3
b. 5
c. 6
d. 4
Marks: 09

Which of the following is a correct statement?

Select one:
a. We can convert Mealy to Moore but not vice versa
b. Mealy machine has accepting states
c. Moore machine has no accepting states
d. All of the mentioned

Which of the given are correct?

Select one:
a. Moore machine has 6-tuples
b. Mealy machine has 6-tuples
c. Both Mealy and Moore has 6-tuples
d. None of the mentioned

Which of the following is true about Moore Machine.

Select one:
a. Output is depends on present state only.
b. Output is depends on previous state.
c. Output is depends on present state and present input.
d. None of the above.

There are ____ Tuples in the definition of Moore Machine.

Select one:
a. 4
b. 5
c. 7
d. 6
The following mealy machine outputs which of the following?

Select one:
a. 2’s Complement
b. 9’s Complement
c. 1’s Complement
d. 10’s Complement

Which of the following does the given Mealy machine represents?

Select one:
a. 3’s Complement
b. 2’s Complement
c. 4’s Complement
d. 1’s Complement

The output alphabet can be represented as:

Select one:
a. δ
b. ∑
c. None of the mentioned
d. ∆
In Moore machine, output is produced over the change of:

Select one:
a. None of the mentioned
b. transitions
c. states
d. Both

Which of the following is true about Mealy Machine.

Select one:
a. Output is depends on present state and present input.
b. Output is depends on present state only.
c. Output is depends on previous state.
d. None of the above.

Moore Machine is an application of:

Select one:
a. None of the mentioned
b. Finite automata without input
c. Finite automata with output
d. Non- Finite automata with output
Marks: 10

Remove all the epsilon transitions in the given diagram and compute the number of a-
transitions in the result?

Select one:
a. 9
b. 6
c. 5
d. 7

"Finite Automata is the mathematical model of Finite State Machine".

Select one:
a. None of the above
b. Cannot be said
c. False
d. True

Predict the number of transitions required to automate the following language using
only 3 states:L= {w | w ends with 00}

Select one:
a. 4
b. 2
c. 3
d. Cannot be said

The number of elements present in the e-closure(f2) in the given diagram:

Select one:
a. 3
b. 1
c. 0
d. 2

Which among the following can be an example of application of finite state


machine(FSM)?

Select one:
a. Stack
b. None of the mentioned
c. Adder
d. Communication Link

Which among the following NFA’s is correct corresponding to the given Language? L=
{xϵ {0, 1} | 3rd bit from right is 0}

Select one:
a.

Which of the following belongs to the epsilon closure set of a?

Select one:
a. {f1, f2}
b. {f1, f2, f3}
c. {a, f1, f2, f3}
d. none of the mentioned

Which of the following is an application of Finite Automaton?

Select one:
a. Compiler Design
b. All of the mentioned
c. Text Search
d. Grammar Parsers

Which among the following is not an application of FSM?

Select one:
a. None of the mentioned
b. Lexical Analyser
c. State charts
d. BOT

A binary string is divisible by 4 if and only if it ends with:

Select one:
a. 100
b. 1000
c. 0011
d. 1100
Marks: 10

(a+b)* is equivalent to

Select one:
a. b*a*
b. (a*b*)*
c. a*b*
d. none of the mentioned

A language is regular if and only if

Select one:
a. accepted by PDA
b. accepted by DFA
c. accepted by Turing machine
d. accepted by LBA

A regular language over an alphabet a is one that can be obtained from

Select one:
a. concatenation
b. All of the mentioned
c. union
d. kleene

How many strings of length less than 4 contains the language described by the regular
expression (x+y)*y(a+ab)*?

Select one:
a. 11
b. 7
c. 12
d. 10

Precedence of regular expression in decreasing order is


Select one:
a. * , . , +
b. + , a , *
c. . , * , +
d. . , + , *

Regular expression {0,1} is equivalent to

Select one:
a. 0 U 1
b. 0 / 1
c. All of the mentioned
d. 0 + 1

Regular expression Φ* is equivalent to

Select one:
a. 1
b. ϵ
c. Φ
d. 0

Regular expressions are closed under

Select one:
a. Intersection
b. All of the mentioned
c. Union
d. Kleen star

Which of the following are not operators in Regular Expression?

Select one:
a. Concatination .
b. Alteration +
c. Kleene star *
d. Question mark ?
Which of the following is not a regular expression?

Select one:
a. (01+11+10)*
b. (1+2+0)*(1+2)*
c. [(a+b)*-(aa+bb)]*
d. [(0+1)-(0b+a1)*(a+b)]*
Marks: 09

As per the statement of pumping lemma, which of the following is true?

Select one:
a. |v|>=1
b. |v|<=1
c. |v|<1
d. |v|>1

Find the Regular Expression for the given DFA using Arden's theorem.

Select one:
a. a*.b.b*
b. a*+b*
c. a*.b*
d. a*+b+b*

Following language is non regular using pumping lemma, True or False? L={ww | w ∈
(0,1)*}

Select one:
a. Insufficient Data
b. True
c. False
d. None of the above

Generate a regular expression for the following problem statement:Password Validation:


String should be 6-14 characters long. String must contain a number, an Uppercase
letter and a Lower case letter.

Select one:
a. ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,15}$
b. None of the mentioned
c. ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{6,14}$
d. ^(?=.[a-z])(?=.[A-Z])(?=.\d).{8,15}$

if L(r)={aa,aba,abba,abbba,....}, What is r?

Select one:
a. a.b.a
b. a.b*.a*
c. a.b*.a
d. (a.b*.a)*

if L(r)={aaa,aab,aba,abb,baa,bab,bba,bbb}, What is r?

Select one:
a. (a+b).(a+b)*
b. (a+b)*
c. (a+b).(a+b).(a+b)
d. a*.b*

Pumping Lemma is used to check whether a given language is regular language or not.
True or False?

Select one:
a. Insufficient Data
b. True
c. None of the above
d. False

The minimum number of transitions to pass to reach the final state as per the following
regular expression is:(a+b)*(baaa)

Select one:
a. 5
b. 4
c. 6
d. 3

What the Regular Expression for the given DFA using Arden's theorem.

Select one:
a. (0+1(1+01)*.00)
b. (0+1(1+0)*.000)*
c. (0+1(1+01)*.00)*
d. (0+1(1+1)*.0)*

Which of the following equation satisfy the Arden's Theorem

Select one:
a. if R=P+RQ then R=PQ
b. if R=P+RQ then R=P*Q
c. if R=P+RQ then R=PQ*
d. None of the above
Marks: 10

If L1 and L2 are Regular Languages then L1.L2 is also Regular Satisfies which of the
Following:

Select one:
a. Closure under Union
b. Closure under Concatination
c. Closure under Kleene Star
d. Closure under Intersection

Which of the Following are the Application of Regular Expression:

Select one:
a. Lexical Analyzer
b. None of the above
c. Text Editor
d. Both Lexical Analyzer

A program that performs lexical analysis is termed as:

Select one:
a. all of the mentioned
b. scanner
c. lexer
d. tokenizer

If L={a} is Regular the L* is also Regular: True or False?

Select one:
a. Cannot determined
b. False
c. Insuffient Data
d. True

Which of the following is not the application of Regular Expression?


Select one:
a. Lexical Analyzer
b. Validatios
c. Parenthesis Checking
d. Text Editors

Which of the technique can be used to prove that a language is non regular?

Select one:
a. None of the mentioned
b. Ardens theorem
c. Ogden’s Lemma
d. Pumping Lemma

If L1={0,000,00000} and L2={00,0000,000000} then L1UL2 is which of the following?

Select one:
a. {0,000,00000}
b. {00,0000,00000,000000}
c. {0,00,000,0000,00000,000000}
d. {0,000,0000}

State true or false:Statement: A lexical analyzer reads the source code line by line.

Select one:
a. True
b. Can not determined
c. Insuffient Data
d. False

Which of the following is the regular expression for Integer Literals in "C' language

Select one:
a. (digit)+(digit)*
b. (digit).(digit)*
c. (digit)*
d. (digit)
The output of the lexical and syntax analyzer can stated as:

Select one:
a. token stream, parse tree
b. all of the mentioned
c. parse stream, parse tree
d. token tree, parse tree
10/6/21, 5:00 PM Unit 2: Quiz No. 2 Date:06/10/2021 Time:4.00 pm to 05.00 pm: Attempt review

Dashboard / My courses /
TYTOC [2021-22] /
Unit 2: Regular Expressions /
Unit 2: Quiz No. 2 Date:06/10/2021 Time:4.00 pm to 05.00 pm

Started on Wednesday, 6 October 2021, 4:40 PM


State Finished
Completed on Wednesday, 6 October 2021, 5:00 PM
Time taken 19 mins 18 secs
Grade 6.00 out of 10.00 (60%)

Question 1 How many strings of length less than 4 contains the language described by the regular expression (x+y)*y(a+ab)*?
Correct

Mark 1.00 out of Select one:


1.00
a. 11

b. 10

c. 7

d. 12 

The correct answer is: 12

Question 2 if L(r)={a,c,ab,cb,abb,cbb,abbb,......}, What is r?


Correct

Mark 1.00 out of Select one:


1.00
a. a.b*+c.b*

b. (a+c).b* 

c. (a+c)+b*

d. a.b*.c.b*

The correct answer is: (a+c).b*

Question 3 How many states will be required to represent a* in NFA with epsilon moves?
Incorrect

Mark 0.00 out of Select one:


1.00
a. 2

b. 5 

c. 3

d. 4

The correct answer is: 4

54.147.11.221/it/mod/quiz/review.php?attempt=60930&cmid=7781#question-62681-3 1/3
10/6/21, 5:00 PM Unit 2: Quiz No. 2 Date:06/10/2021 Time:4.00 pm to 05.00 pm: Attempt review

Question 4 Let S and T be language over ={a,b} represented by the regular expressions (a+b*)* and (a+b)*, respectively. Which of the
Correct following is true?
Mark 1.00 out of
1.00 Select one:
a. TcS (T is a subset of S)

b. S=T 

c. ScT (S is a subset of T)

d. SnT=Ø

The correct answer is: S=T

Question 5 (a.b)*=a*.b* is true or false


Correct

Mark 1.00 out of Select one:


1.00
a. False 

b. Insufficient data

c. cannot determine

d. True

The correct answer is: False

Question 6 if L(r)={x,xx,xxx,xxxx,xxxxx,......}, then what is r?


Incorrect

Mark 0.00 out of Select one:


1.00
a. ε*

b. x* 

c. ε+r

d. x+ (positive clusure)

The correct answer is: x+ (positive clusure)

Question 7 In NFA with epsilon moves a+b is represented with how many number of states?
Incorrect

Mark 0.00 out of Select one:


1.00
a. 7

b. 5 

c. 6

d. 8

The correct answer is: 6

54.147.11.221/it/mod/quiz/review.php?attempt=60930&cmid=7781#question-62681-3 2/3
10/6/21, 5:00 PM Unit 2: Quiz No. 2 Date:06/10/2021 Time:4.00 pm to 05.00 pm: Attempt review

Question 8 Represent the language over Σ={a,b} containing atleat one a and at least one b, using a regular expression.
Incorrect

Mark 0.00 out of Select one:


1.00
a. a.(a+b)*.b

b. (a+b)*.a.b.(a+b)*

c. (a+b)*.a.(a+b)*.b.(a+b)*

d. a.b 

The correct answer is: (a+b)*.a.(a+b)*.b.(a+b)*

Question 9 To represent (a+b) using DFA how many states will be required?
Correct

Mark 1.00 out of Select one:


1.00
a. 3

b. 5

c. 1

d. 2 

The correct answer is: 2

Question 10 (a*b*)*= (a+b)* is true or false?


Correct

Mark 1.00 out of Select one:


1.00
a. True 

b. Insufficient data

c. False

d. cannot determine

The correct answer is: True

◄ Unit 2 Quiz No 1 06/10/2021 Time 4.00


Jump to... Unit No.2 PDF and PPT ►
PM to 05.00 PM

54.147.11.221/it/mod/quiz/review.php?attempt=60930&cmid=7781#question-62681-3 3/3
Marks: 10

The entity which generate Language is termed as:

Select one:
a. Automata
b. Data
c. Grammar
d. Tokens

Which of the following is correct about Leftmost Derivation?

Select one:
a. In each step of derivation production is applied to rightmost variable.
b. None of the mention.
c. In each step of derivation production is applied to either leftmost or rightmost
variable.
d. In each step of derivation production is applied to leftmost variable.

Which Symbol is used to denote the derivation process

Select one:
a. ->
b. %
c. =>
d. ?

Are ambiguous grammar context free?

Select one:
a. No
b. Can not determined
c. Insuffient Data
d. Yes

Which Symbol is used for production rule


Select one:
a. %
b. ?
c. ->
d. =>

The Grammar can be defined as: G=(V, T, P, S) In the given definition, what does S
represents?

Select one:
a. None of these
b. Sensitive Grammar
c. Accepting State
d. Starting Variable

Derivation Tree is also called as

Select one:
a. Syntax Tree
b. Parse Tree
c. All of the above
d. Rule Tree

Which of the following is the correct formal definition of Grammar

Select one:
a. G=(q0,V,P,S)
b. G=(V,T,P,S)
c. G=(V,q0,P,S)
d. G=(V,M,P,S)

For S->0S1|ε for ∑={0,1}*, which of the following is correct for the language produced?

Select one:
a. Same number of o's followed by same number of 1's
b. Equal number of 0's and 1's
c. Even number of o's followed by odd number of 1's
d. Even number of 0's followed by even number of 1's

In Context Free Grammar Terminal are represented by

Select one:
a. Uppercase Letters
b. None of these
c. Lowercase Letters
d. Both Uppercase and Lowercase
Marks: 10

Find the CFG for the given regular expression r=ab*

Select one:
a. None of the above
b. S->BB, B->ab|ε
c. S->bB, B->aB|ε
d. S->aB, B->bB|ε

If G = ({S}, {a}, {S -> SS), S),then language generated by G is

Select one:
a. L (G) = a*
b. L (G) = a^n
c. L (G) = a^nba^n
d. L (G) = φ

Find the CFG for the given regular expression r=a*b*

Select one:
a. None of the Above
b. S->AB, A->aA|ε, B->bB|ε
c. S->AB, A->aA|a, B->bB|b
d. S->AB, A->a|ε, B->b|ε

True or False: Grammar G=(E,{z},P,E) where P consist of E->E+E | E*E | z is Ambiguous


Grammar

Select one:
a. Insuffient Data
b. False
c. True
d. Canot Determined

Which of the following is correct about Ambiguous Grammar?


Select one:
a. If there are more than one Production rules for the given string.
b. If there is one Production rules for the given string.
c. If there are more than one leftmost derivation, rightmost derivation and derivation
tree for given string.
d. If there is one leftmost derivation, rightmost derivation and derivation tree for given
string.

Which of the following is correct about Removal of Ambiguity?

Select one:
a. We can rewrite the existing production rules
b. We can add some extra Variables in the existing grammar
c. Resultant grammar is eqivalent to the original grammar
d. All of the above

A context free language is called ambiguous if

Select one:
a. It has two or more leftmost derivations for some terminal string ѡ є L (G)
b. It has two or more rightmost derivations for some terminal string ѡ є L (G)
c. Both
d. None of these

The context free grammar S → SS | 0S1 | 1S0 | ɛ generates

Select one:
a. Any number of 0’s followed by any number of 1’s
b. None of these
c. Equal number of 0’s and 1’s
d. Unequal number of 0’s and 1’s

Which of the following statement is false?

Select one:
a. In derivation tree, the label of all nodes except leaf nodes is a variable
b. None of these
c. In derivation tree, if the root of a sub tree is X then it is called –tree
d. In derivation tree, the label of each leaf node is terminal

Describe the CFL generated by the following grammar G=({S},{a,b,c},P,S) where P consist
of S->aSa|bSb|a|b|ε

Select one:
a. The CFL is a language consisting even number of a's and b's string over Σ={a,b}
b. The CFL is a language consisting of all Palindrome string over Σ={a,b}
c. The CFL is a language consisting of same number of a's and b's string over Σ={a,b}
d. None of the above
Marks: 10

The format: A->aB refers to which of the following?

Select one:
a. Chomsky Normal Form
b. None of the mentioned
c. Backus Naur Form
d. Greibach Normal Form

Given grammar:S->aS|A, A->a, B->aa Find the number of variables reachable from the
Starting Variable?

Select one:
a. None of the mentioned
b. 0
c. 1
d. 2

Simplify the given grammar:A-> a| aaA| abBc, B-> abba| b

Select one:
a. A-> a| aaA| ababbac| abbc, B->abba|b
b. A->a| aaA| ababbac| abbc
c. None of the mentioned
d. A->a| aaA| abbc, B->abba

Which of the following grammars are in Chomsky Normal Form:

Select one:
a. S->AB|BC|CD, A->0, B->1, C->2, D->3
b. S->AB, S->BCA|0|1|2|3
c. All of the mentioned
d. S->ABa, A->aab, B->Ac

Suppose A->xBz and B->y, then the simplified grammar would be:
Select one:
a. A->xBz|B|y
b. A->xyz
c. none of the mentioned
d. A->xBz|xyz

Inorder to simplify a context free grammar, we can skip the following operation:

Select one:
a. Removal of unit productions
b. None of the mentioned
c. Removal of useless symbols
d. Removal of null production

In context to the process of removing useless symbols, which of the following is correct?

Select one:
a. We remove the Nullable variables
b. We eliminate products which yield no terminals
c. All of the mentioned
d. We eliminate the unit productions

Let G be a grammar: S->AB|e, A->a, B->b, Is the given grammar in CNF?

Select one:
a. Yes
b. Insuffient data
c. No
d. Cannot determined

Which of the production rule can be accepted by Chomsky Normal Form?

Select one:
a. All of the mentioned
b. A->a
c. None of the mentioned
d. A->BC
Given Grammar: S->A, A->aA, A->e, B->bA, Which among the following productions are
Useless productions?

Select one:
a. B->bA
b. A->aA
c. A->e
d. S->A
Marks: 10

Which of the Following is wrong while converting LLG to RLG

Select one:
a. Find the NFA with ε moves
b. Reverse all the directions
c. Interchange the position of initial state and final state
d. Represent the given grammar in transition diagram

Identify the given grammar A->ε, A->aA, A->a

Select one:
a. Context Free Grammar
b. Context Sensitive Grammar
c. Left Linear Grammar
d. Right Linear Grammar

A grammar G = (V, T, P, S) in which T is

Select one:
a. Set of variables and terminals
b. Set of variables
c. None of these
d. Set of terminals

Which of the following statement is wrong?

Select one:
a. Type 0 is recognized by turing machine
b. Chomsky hierarchy originally define only two types of grammars
c. Type 0 grammar is called unrestricted grammar
d. All of these

Unrestricted grammar is also known as

Select one:
a. Type 0
b. All of these
c. Phrase structure grammar
d. Semi-thue grammar

Type 3 grammar is called as ?

Select one:
a. Unrestricted Grammar
b. Context Sensitive Grammar
c. Context Free Grammar
d. Regular Grammar

Left Linear Grammar is converted to Right Linear Grammar and Vice versa. True or False?

Select one:
a. True
b. False
c. Insufficient Data
d. Cannot determined

To construct the DFA from Right Linear Grammar which of the following is correct?

Select one:
a. Interchange the position of initial state and final state
b. Reverse all the directions
c. First find the NFA with ε moves
d. None of the these

A grammar G = (V, T, P, S) in which V is

Select one:
a. None of these
b. Set of terminals
c. Set of variables
d. Set of variables and terminals
A Context Free Grammar is which type of grammar?

Select one:
a. Type 2
b. Type 3
c. Type 0
d. Type 1
TOC Unit I MCQ

1.Number of states of FSM required to simulate behaviour of a computer with a memory capable of
storing “m” words, each of length ‘n’
a.m x 2^n
b.2^mn
c.2^(m+n)
d.All of the mentioned
Answer: (b). 2^mn

2.An FSM with


a.M can be transformed to Numeral relabeling its states
b.M can be transformed to N, merely relabeling its edges
c.Both of the mentioned
d.None of the mentioned
Answer: (c).Both of the mentioned

3.The transitional function of a DFA is


a.Q X Σ→Q
b.Q X Σ→2Q
c.Q X Σ→2n
d.Q X Σ→Qn
Answer: (a).Q X Σ→Q

4.The transitional function of a NFA is


a.Q X Σ→Q
b.Q X Σ→2Q
c.Q X Σ→2n
d.Q X Σ→Qn
Answer: (b).Q X Σ→2Q

5.Maximum number of states of a DFA converted from a NFA with n states is


a.n
b.n^2
c.2n
d.None of these
Answer: (c).2n

6.Basic limitations of finite state machine is


a.It cannot remember arbitrarily large amount of information
b.It cannot remember state transitions
c.It cannot remember grammar for a language
d.It cannot remember language generated from a grammar

Answer: (b). It cannot remember state transitions

7.A finite automata recognizes


a.Any Language
b.Context Sensitive Language
c.Context Free Language
d.Regular Language
Answer: (d). Regular Language

8.Which is true for Moore Machine?


a.Output depends on present state
b.Output depends on present input
c.Output depends on present state and present input
d.Output depends on present state and past input
Answer: (a). Output depends on present state

9.Which is true for Mealy Machine?


a.Output depends on present state
b.Output depends on present input
c.Output depends on present state and present input
d.Output depends on present state and past input
Answer: (c).Output depends on present state and present input

10.Which is true for in accessible state?


a.It cannot be reached anytime
b.There is no necessity of the state
c.If control enters no way to come out from the state
d.If control enters FA deads
Answer: (a).It cannot be reached anytime

11.In Moore Machine O/P is associated with


a.Present state
b.Next state
c.Input
d.None of the above
Answer: (a).Present state

12.The regular languages are not closed under


a.Concatenation
b.Union
c.Kleene star
d.Complement
Answer: (d).Complement

13.NFAs are ___ DFAs.


a.Larger than
b.More expressive than
c.Less expressive than
d.Equally expressive as
Answer: (a).Larger than

14.Conversion of a DFA to an NFA


a.Is impossible
b.Requires the subset construction
c.Is Chancy
d.Is nondeterministic
Answer: (b).Requires the subset construction

15.The subset construction shows that every NFA accepts a


a.String
b.Function
c.Regular language
d.Context-free language
Answer: (c).Regular language

16.Can a DFA simulate NDFA


a.No
b.Yes
c.Sometimes
d.Depends on NDFA
Answer: (b).Yes

17.Find the wrong statement?


a.The language accepted by finite automata are the languages denoted by regular expression
b.Every DFA has 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
Answer: (c).For a regular expression r, there does not exist NFA with L(r) any transit that accept

18.The relation between NFA-accepted languages and DFA accepted languages is


a.>
b.<
c.=
d.<=

Answer: (c).=

19.The lexical analysis for a modern language such as Java needs the power of which one of the
following machine models in a necessary and sufficient sense?
a.Finite state automata
b.Deterministic pushdown automata
c.Non-deterministic pushdown automata
d.Turing machine
Answer: (a).Finite state automata

20.The classes of languages P and NP are closed under certain operations, and not closed under
others. Decide whether P and NP are closed under each of the following operations.
1. Union
2. Intersection
3. Intersection with a regular language
4. Kleene closure (star)
5. Homomorphism
6. Inverse homomorphism
a.P is not closed under union
b.NP is not closed under intersection
c.None of the mentioned
d.Both of the mentioned
Answer: (d).Both of the mentioned

21.The reorganizing capability of NDFA and DFA


a.May be different
b.Must be different
c.Must be same
d.None of the above
Answer: (c).Must be same
TOC Unit II MCQ

1.Which of the following 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 the mentioned
Answer: (d).All of the mentioned

2.Which of the following are not regular?


a.String of )’s which has length that is a perfect square
b.Palindromes Consisting of 0’s 1’s
c.String of 0’s whose length is a prime number
d.All of the mentioned
Answer: (d).All of the mentioned

3.Regular expression (x/y)(x/y) denotes the set


a.{xy,xy}
b.{xx,xy,yx,yy}
c.{x,y}
d.{x,y,xy}
Answer: (b).{xx,xy,yx,yy}

4.Regular expression x/y denotes the set


a.{x,y}
b.{xy}
c.{x}
d.{y}
Answer: (a). {x,y}

5.The regular expressions denote zero or more instances of an x or y is


a.(x+y)
b.(x+y)*
c.(x* + y)
d.(xy)*

Answer: (b).(x+y)*

6.The regular expression denote a language comprising all possible strings of even length over the
alphabet (0, 1)
a.1 + 0(1+0)*
b.(0+1) (1+0)*
c.(1+0)
d.(00+0111+10)*

Answer: (d).(00+0111+10)*

7.The RE gives none or many instances of an x or y is


a.(x+y)
b.(x+y)*
c.(x* + y)
d.(xy)*
Answer: (b).(x+y)*

8.The RE in which any number of 0′s is followed by any number of 1′s followed by any number of 2′s is
a.(0+1+2)*
b.0*1*2*
c.0* + 1 + 2
d.(0+1)*2*
Answer: (b). 0*1*2*

9.Which of the following pairs of regular expression are equivalent?


a.1(01)* and (10)*1
b.X(xx)* and (xx)*x
c.None of the mentioned
d.Both of the mentioned
Answer: (d).Both of the mentioned

10.Which of the following identity is true?


a.Ɛ +RR* = R* = ɛ + R*R
b.(R1R2)*R1 = R1 (R2R1)*
c.R*R* = R*
d.All of the mentioned
Answer: (d).All of the mentioned

11.The set of all strings over ∑ ={a,b} in which a single a is followed by any number of b’s a single b
followed by any number of a’s is
a.ab* + ba*
b.ab*ba*
c.a*b + b*a
d.None of the mentioned
Answer: (a). ab* + ba*

12.The set of all strings over ∑ = {a,b} in which strings consisting a’s and b’s and ending with in bb is
a.ab
b.a*bbb
c.(a+b)* bb
d.All of the mentioned
Answer: (c). (a+b)* bb

13. If P, Q, R are three regular expressions and if P does not contain a then the equation R = R + RP has
a unique solution given by
a.R = QP*
b.R = P*Q
c.R = RP
d.None of the mentioned
Answer: (a).R = QP*

14.Which of the following is true ?


a.(01)*0 = 0(10)*
b.(0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*
c.(0+1)*01(0+1)*+1*0* = (0+1)*
d.All of the mentioned
Answer: (d).All of the mentioned

15.Let the class of language accepted by finite state machine be L1 and the class of languages
represented by regular expressions be L2 then
a.L1=L2
b.L1 U L2 = .*
c.L1=L2
d.None of the above
Answer: (c). L1=L2

16.Which of the following is not a regular expression?


a.[(a+b)*-(aa+bb)]*
b.[(0+1)-(0b+a1)*(a+b)]*
c.(01+11+10)*
d.(1+2+0)*(1+2)*
Answer: (b).[(0+1)-(0b+a1)*(a+b)]*
17.According to the given language, which among the following expressions does it corresponds to?
Language L={xϵ{0,1}|x is of length 4 or less}
a.(0+1+0+1+0+1+0+1)^4
b.(0+1)^4
c.(01)^4
d.(0+1+ε)^4
Answer: (d). (0+1+ε)^4

18.Which among the following looks similar to the given expression?


((0+1). (0+1)) *
a.{xϵ {0,1} *|x is all binary number with even length}
b.{xϵ {0,1} |x is all binary number with even length}
c.{xϵ {0,1} *|x is all binary number with odd length}
d.{xϵ {0,1} |x is all binary number with odd length}
Answer: (a). {xϵ {0,1} *|x is all binary number with even length}

19.A finite automaton accepts which type of language:


a.Type 0
b.Type 1
c.Type 2
d.Type 3

Answer: (d). Type 3

20. Simplify the following regular expression:


ε+1*(011) *(1*(011) *) *
a.(1+011) *
b.(1*(011) *)
c.(1+(011) *) *
d.(1011) *
Answer: (a). (1+011) *
TOC unit III MCQ

1. Grammars that can be translated to DFAs:


a.Left linear grammar
b.Right linear grammar
c.Generic grammar
d.All of these
Answer: (b).Right linear grammar

2. The language accepted by a Push down Automata:


a.Type0
b.Type1
c.Type2
d.Type3
Answer: (c).Type2

3.Recursive Descent Parsers are a type of:


a.LL parsers
b.LR parsers
c.LALR parsers
d.SLR parsers
Answer: (a).LL parsers

4. If language L={0,1}*, then the reversed language L^R =


a.{0,1}*
b.{}
c. {0}*
d.{1}*
Answer: (a).{0,1}*

5. Consider the following two languages:

L1 = {x ∣ for some y with ∣y∣ = 2^∣x∣,xy ∈ L and L is regular language}


L2 = {x ∣ for some y such that ∣x∣ = ∣y∣, xy ∈ L and L is regular language}

Which one of the following is correct?


a.Only L1 is regular language
b.Only L2 is regular language
c.Both L1 and L2 are regular languages
d.Both L1 and L2 are not regular languages
Answer: (c).Both L1 and L2 are regular languages
6. Consider R to be any regular language and L1, L2 be any two context-free languages. Which of the
following is correct?
a.L1’ is context free
b.(L1 ∪ L2)’ – R is context free
c.L1 ∩ L2 is context free
d.L1 – R is context free
Answer: (d).L1 – R is context free

7. Consider the following problems:

(i) Whether a finite state automaton halts on all inputs?


(ii) Whether a given context free language is regular?
(iii) Whether a Turing machine computes the product of two numbers?

Which one of the following is correct?


a.Only (i) and (iii) are undecidable problems
b.Only (ii) and (iii) are undecidable problems
c.Only (i) and (ii) are undecidable problems
d.(i), (ii) and (iii) are undecidable problems
Answer: (b). Only (ii) and (iii) are undecidable problems

8. Which of the following problems is decidable for recursive languages (L)?


a.Is L = ϕ?
b.Is w ∈ L, where w is a string?
c.Is L = Σ*?
d.Is L = R, where R is a given regular set?
Answer: (b). Is w ∈ L, where w is a string?

9. Consider the following grammar G:

S→A∣B
A→a∣c
B→b∣c
where {S, A, B} is the set of non-terminals, {a, b, c,} is the set of terminals.

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


S1: LR(1) can parse all strings that are generated using grammar G.
S2: LL(1) can parse all strings that are generated using grammar G.

a.Only S1
b.Only S2
c.Both S1 and S2
d.Neither S1 nor S2
Answer: (d). Neither S1 nor S2

10. The grammar S → (S) ∣ SS ∣ ϵ is not suitable for predictive parsing because the grammar is
a.Right recursive
b.Left recursive
c.Ambiguous
d.An operator grammar
Answer: (c). Ambiguous

11. To obtain a string of n Terminals from a given Chomsky normal form grammar, the number of
productions to be used is:
a.2n−1
b.2n
c.n+1
d.n^2

Answer: (a).2n−1

12. Consider the following two Grammars:

G1 : S → SbS | a
G2 : S → aB | ab, A→GAB | a, B→ABb | b

Which of the following option is correct?


a.Only G1 is ambiguous
b.Only G2 is ambiguous
c.Both G1 and G2 are ambiguous
d.Both G1 and G2 are not ambiguous
Answer: (c). Both G1 and G2 are ambiguous

13.The set A={ 0^n 1^n 2^n | n=1, 2, 3, ......... } is an example of a grammar that is:
a.Context sensitive
b.Context free
c.Regular
d.None of the above
Answer: (a). Context sensitive

14. A bottom-up parser generates:


a.Left-most derivation in reverse
b.Right-most derivation in reverse
c.Left-most derivation
d.Right-most derivation
Answer: (b). Right-most derivation in reverse

15.Consider the following statements:

S1 : There exists no algorithm for deciding if any two Turing machines M1 and M2 accept the same
language.
S2 : The problem of determining whether a Turing machine halts on any input is undecidable.

Which of the following options is correct?


a. Both S1 and S2 are correct
b. Both S1 and S2 are not correct
c. Only S1 is correct
d. Only S2 is correct
Answer: (a). Both S1 and S2 are correct

16.Which of the following statements is/ are TRUE?

(a) The grammar S → SS a is ambiguous. (Where S is the start symbol)


(b) The grammar S → 0S1 | 01S | ϵ is ambiguous. (The special symbol ϵ represents the empty string)
(Where S is the start symbol)
(c) The grammar (Where S is the start symbol)
S → T/U
T → x S y | xy | ϵ
U → yT
generates a language consisting of the string yxxyy.
a.Only (a) and (b) are TRUE.
b.Only (a) and (c) are TRUE.
c.Only (b) and (c) are TRUE.
d.All of (a), (b) and (c) are TRUE.
Answer: (d). All of (a), (b) and (c) are TRUE.

17. Pumping lemma for regular language is generally used for proving:
a.whether two given regular expressions are equivalent
b.a given grammar is ambiguous
c.a given grammar is regular
d.a given grammar is not regular
Answer: (a). whether two given regular expressions are equivalent
18.Which of the following problems is undecidable?
a.To determine if two finite automata are equivalent
b.Membership problem for context free grammar
c.Finiteness problem for finite automata
d.Ambiguity problem for context free grammar
Answer: (d). Ambiguity problem for context free grammar

19.The language L = {a^i b c^i | i ≥ 0} over the alphabet {a, b, c} is:


a.a regular language.
b.not a deterministic context free language but a context free language.
c.recursive and is a deterministic context free language.
d.not recursive.
Answer: (c). recursive and is a deterministic context free language.

20.Context free grammar is not closed under :


a.Concatenation
b.Complementation
c.Kleene Star
d.Union
Answer: (b).Complementation

21. Consider the following languages :

L1 = {a^m b^n | m ≠ n}
L2 = {a^m b^n | m = 2n+1}
L3 = {a^m b^n | m ≠ 2n}

Which one of the following statement is correct?


a.Only L1 and L2 are context free languages
b.Only L1 and L3 are context free languages
c.Only L2 and L3 are context free languages
d.L1, L2 and L3 are context free languages
Answer: (d). L1, L2 and L3 are context free languages
Seat No -
Total number of questions : 60

10270_THEORY OF COMPUTATION
Time : 1hr
Max Marks : 50
N.B

1) All questions are Multiple Choice Questions having single correct option.

2) Attempt any 50 questions out of 60.

3) Use of calculator is allowed.

4) Each question carries 1 Mark.

5) Specially abled students are allowed 20 minutes extra for examination.

6) Do not use pencils to darken answer.

7) Use only black/blue ball point pen to darken the appropriate circle.

8) No change will be allowed once the answer is marked on OMR Sheet.

9) Rough work shall not be done on OMR sheet or on question paper.

10) Darken ONLY ONE CIRCLE for each answer.

Q.no 1. Which of the following does not belong to the language if input alphabet set is
a,b

A:a

B:b

C : epsilon

D:c

Q.no 2. Which of the following regular expressions represents the set of strings which
do not contain a substring ‘rt’ if alphabet = {r, t}

A : (rt)*

B : (tr)*

C : (r*t*)
D : (t*r*)

Q.no 3. 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 : NP Complete

Q.no 4. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 5. Which of the production rule can be accepted by Chomsky grammar. (i) A->BC,
(ii) A->a

A : only i

B : only ii

C : both i and ii

D : neither i nor ii

Q.no 6. Which of the following is true?

A : Every subset of a regular set is regular

B : Every finite subset of non-regular set is regular

C : The union of two non regular set is not regular

D : Infinite union of finite set is regular

Q.no 7. A push down automata is different than finite automata by

A : Its memory

B : number of states
C : start state

D : input symbols

Q.no 8. Turing machine is more powerful than (a) Finite automata, (b) Push down
automata

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Neither (a) nor (b)

Q.no 9. Turing machine was invented by

A : Alan Turing

B : Turing man

C : Turing taring

D : Turling Bake

Q.no 10. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.

A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 11. Why Palindromes cannot be recognized by any FSM ?

A : an FSM cannot deterministically fix the mid-point

B : an FSM can remember arbitrarily large amount of information

C : FSM has finite memory

D : FSM has only 5 tuples

Q.no 12. _________ is the class of decision problems that can be solved by non-
deterministic polynomial algorithms?
A : NP

B:P

C : Hard

D : Complete

Q.no 13. NPDA stands for

A : non deterministic pushup automata

B : null pushdown automata

C : nested pushdown automata

D : non deterministic pushdown automata

Q.no 14. A Turing machine with several tapes in known as

A : Multi-tape Turing machine

B : Poly-tape Turing maching

C : Universal Turing machine

D : Complete Turing machine

Q.no 15. If P, Q, R are three regular expressions and if P does not contain epsilon, then
the equation R = Q + RP has a unique solution given by

A : R = QP*

B : R = P*Q

C : R = RP

D : R = QP

Q.no 16. Which among the following are incorrect regular identities?

A:

B:
C:

D:

Q.no 17. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop

D : push, pop and replace

Q.no 18. A deterministic Turing machine is

A : Ambiguous Turing Machine

B : Unambiguous Turing Machine

C : Non-Deterministic Finite Automata

D : Deterministic Finite Automata

Q.no 19. Bottom-up parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 20. A language L is said to be ____________ if there is a turing machine M such that
L(M)=L and M halts at every point.

A : Turing acceptable

B : Decidable

C : Undecidable

D : NP-HARD

Q.no 21. Which of the given problems are NP-complete?


A : (a) Traveling Salesman Problem

B : (b) Satisfiability Problem

C : Both (a) and (b)

D : Turing Machine

Q.no 22. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 23. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which the total number of a’s is divisible by 2.

A : ((a+b)(a+b))*

B : (a + ab)*

C : ( b* a b*ab*)* + b*

D : a* b (aa)*b a*

Q.no 24. Which of the following statement(s) are correct? (a) All languages can be
generated by CFG, (b) Any regular language has an equivalent CFG, (c) Some non
regular languages cannot be generated by CFG.

A : only (a)

B : Only (b)

C : Only (c)

D : Both (b) and (c)

Q.no 25. A grammar G=(V,T,P,S) in which V represents

A : Set of Nonterminals

B : Start symbol

C : Set of terminals
D : Production

Q.no 26. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input

C : current state and stack

D : current state

Q.no 27. In multi head Turing machine there are

A : More than one heads of the Turing machine

B : More than one input tapes of Turing machine

C : Similar to the basic model of Turing machine

D : More than one input symbols of Turing machine

Q.no 28. Construct a regular expression for the language that contains strings having
no pair of consecutive zeros over {0, 1}.

A : (1+0)*

B:

C : ((0+1)(0+1))*

D : (01 + 10)*

Q.no 29. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2

C:3

D:0

Q.no 30. Which of the following statement is false?

A : Context free language is the subset of context sensitive language


B : Regular language is the subset of context sensitive language

C : Recursively ennumerable language is the super set of regular language

D : Context sensitive language is a subset of context free language

Q.no 31. Which among the following is the LEAF of the parse tree?

A : Production P

B : Nonterminal V

C : Terminal T

D : Starting symbol S

Q.no 32. The ability for a system of instructions to simulate a Turing Machine is called
_________

A : Turing Completeness

B : Simulation

C : Turing Halting

D : Computability

Q.no 33. Which of the following statement is false?

A : Every language that is defined by regular expression can also be defined by finite
automata

B : Every language defined by finite automata can also be defined by regular expression

C : We can convert regular expressions into finite automata

D : There exists a unique DFA for every regular language

Q.no 34. Which of the following statements is false?

A : For every non-deterministic Turing machine, there exists an equivalent deterministic


Turing machine.

B : Turing recognizable languages are closed under union and complement.

C : Turing decidable languages are closed under intersection


and complement.

D : Turing recognizable languages are closed under union and intersection.


Q.no 35. How many strings of length less than 4 contain the language described by the
regular expression (x+y)*y(a+ab)*

A:7

B : 10

C : 12

D : 11

Q.no 36. An instantaneous description of Turing machine consists of

A : Present state and input to be processed

B : Present state and entire input to be processed

C : Present input only

D : Present state only

Q.no 37. According to the given language, which among the following expressions does
it corresponds to Language L={xϵ{0,1}|x is of length 4 or less}

A : (0+1+0+1+0+1+0+1)^4

B : (0+1)^4

C : (01)^4

D : (0+1+ε)^4

Q.no 38. Identify the following problem: If G=(V, E) and V' is subset of V, then V' is an
independent set iff no two nodes in V' are connected by an edge in E.

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 39. Which of the following is analogous to the NFA and NPDA ?

A : Regular language and Context Free language

B : Regular language and Context Sensitive language


C : Context free language and Context Sensitive language

D : Unrestricted language

Q.no 40. Given grammar G:


(1)S->AS (2)S->AAS (3)A->SA (4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?

A : 2,4

B : 1,3

C : 1, 2, 3, 4

D : 2, 3, 4

Q.no 41.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 42.

A:A
B:B

C:C

D:D

Q.no 43. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 44. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 45. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's


Q.no 46. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 47. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 48. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 49. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS
B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 50. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 51. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 52. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?
A:

B:

C:

D:

Q.no 53. Which of the following statement is false.


A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 54. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 55. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.

A:
B:

C:

D:

Q.no 56. 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

Q.no 57. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 58. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:
D:

Q.no 59.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 60. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 1. If the PDA does not stop on an accepting state and the stack is not empty, the
string is

A : rejected

B : goes into loop forever

C : rejected and goes into loop forever

D : accepted

Q.no 2. Number of states required to accept strings ending with 101


A:3

B:4

C:2

D : cannot be represented.

Q.no 3. What is the Regular Expression Matching Zero or More Specific Characters

A:x

B:#

C:*

D:&

Q.no 4. What is the value of n if Turing machine is defined using n-tuples?

A:6

B:7

C:8

D:5

Q.no 5. 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)*

A : The set of all strings containing the substring 00

B : The set of all strings containing at most two 0’s

C : The set of all strings containing at least two 0’s

D : The set of all strings that begin and end with either 0 or 1

Q.no 6. Which of the following is not a part of 5-tuple finite automata?

A : Input alphabet

B : Transition function

C : Initial State

D : Output alphabet
Q.no 7. Pushdown automata accepts

A : regular language

B : context free language

C : context sensitive language

D : unrestricted language

Q.no 8. What is the pumping length of string of length x?

A : x+1

B:x

C : x-1

D : x2

Q.no 9. In CFG, notation of VARIABLE representation is

A : Captal Letters

B : Small Letters

C : Italic Letters

D : Roman Letters

Q.no 10. PDA is more powerful than

A : Turing Machine

B : Finite Automata

C : Linear Bounded Automata

D : Non Deterministic Turing Machine

Q.no 11. Turing Machine can update symbols on its tape, whereas the FA cannot update
symbols on tape.

A : true

B : false

C : Cannot say
D : May be

Q.no 12. An algorithm is called efficient if it runs in ____________ time on a serial


computer.

A : Polynomial

B : Non polynomial

C : Logarithmic

D : Non Logarithmic

Q.no 13. Which of the following is false for a grammar G in Chomsky Normal Form:

A : G has no useless symbols

B : G has no unit productions

C : G has no epsilon productions

D : G must have useless symbols

Q.no 14. Top-down parsers use the grammar

A : LL(K)

B : LR(K)

C : SLR(K)

D : CLR(K)

Q.no 15. A Turing machine operates over

A : Finite memory tape

B : Infinite memory tape

C : Depends on the algorithm

D : Depends on the input

Q.no 16. PDA accepts languages generated by which grammar

A : type 0

B : type 1
C : type 2

D : type 3

Q.no 17. If T1 and T2 are two Turing machines, the composite can be represented using
the expression

A : T1 T2

B : T2 T1

C : T1 X T2

D : T2 X T1

Q.no 18. Which of the following are not quantifiers?

A : Kleene plus +

B : Kleene star *

C : Question mark ?

D : Union

Q.no 19. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 20. Which of these does not belong to CFG?

A : Terminal Symbol

B : Non Terminal Symbol

C : Start symbol

D : End symbol
Q.no 21.

A : {w | w is a string of odd length}

B : {w | w is a string of length multiple of 3}

C : {w | w is a string of length 3}

D : {w | w is an empty string}

Q.no 22. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which any occurrence of the symbol b, is in
groups of odd numbers.

A : (abbb)*

B : a* b (bb)* a*

C : ((a+b)(a+b)(a+b))*

D : a* b* (bb)* a*

Q.no 23. The worst-case efficiency of solving a problem in polynomial time is?

A : O(p(n))

B : O(p( n log n))

C:

D : O(p(m log n))

Q.no 24. According to Chomsky hierarchy, which of the following is recognized by


Recursively Enumerable language?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 25. Every CFG can be transformed into equivalent NPDA.


A : false

B : true

C : may be

D : cannot say

Q.no 26. Which of the following is a regular language?

A : String whose length is a sequence of prime numbers

B : String with substring wwr in between

C : Palindrome string

D : String with even number of Zeroes

Q.no 27. Which of the following statements is incorrect?

A : A Turing Machine cannot solve Halting problem

B : Set of recursively enumerated languages is closed under union

C : A FSM with 3 stacks is more powerful than FSM with 2 stacks

D : Context sensitive grammar can be recognized by a linearly bounded memory machine.

Q.no 28. The instantaneous description is PDA shows

A : present state, string to be processed and stack symbol

B : present state and stack symbol

C : present state and string to be processed

D : stack symbol and string to be processed

Q.no 29. It is less complex to prove the closure properties over regular languages using

A : NFA

B : DFA

C : PDA

D : Canot be said
Q.no 30. Which of the following represents a language which has no pair of consecutive
1’s if alphabet = {0,1}?

A:

B:

C:

D:

Q.no 31. The minimum number of productions required to produce a language


consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6

Q.no 32. A PDA machine configuration (p, w, y) can be correctly represented as

A : unprocessed input, stack content, current state

B : current state, unprocessed input, stack content

C : current state, stack content, unprocessed input

D : stack content, current state, unprocessed input

Q.no 33. Which among the following is not true for 2-way infinte TM?

A : Tape in both directions

B : Leftmost square not distinguished

C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.

D : Tape is only in one direction.


Q.no 34. Which of the following statement is false?

A : For non deterministic PDA, equivalence is undecidable.

B : For deterministic PDA, equivalence is decidable.

C : For deterministic PDA, equivalence is undecidable.

D : For non deterministic PDA, equivalence is decidable.

Q.no 35. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine

A : Only (a)

B : Only (b) and (c)

C : Only (a) and (c)

D : (a), (b) and (c)

Q.no 36. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 37. The complexity class P consist of all the decision problems that can be solved
by ___________using polynomial amount of computation time.

A : Push Down automata

B : DFA

C : NDFA

D : Deterministic Turing machine

Q.no 38. The automaton which allows transformation to a new state without consuming
any input symbols:

A : NFA

B : DFA

C : Epsilon NFA
D : PDA

Q.no 39. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings without double a?

A:

B : ((a+b)(a+b))*

C : (a + bb)*

D:

Q.no 40.

A:

B:

C:

D : {0, 1}

Q.no 41. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 42. 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 : (a . b) (a . b)

Q.no 43. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 44. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 45. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 46. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011
Q.no 47. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 48. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 49. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:
Q.no 50. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 51. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 52. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 53. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal


Q.no 54. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 55. 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

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 56. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 57. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted


Q.no 58.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 59. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 60. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 1. The symbol Z0 in formal definition of PDA is used for

A : input symbol

B : stack symbol
C : output symbol

D : tape symbol

Q.no 2. Kruskal's algorithm is used to find

A : whether there is cycle in the graph

B : spanning tree of the graph

C : minimum spanning tree in the graph

D : whether there is spanning tree in the graph

Q.no 3. Which of the following is true?

A : (01)*0 = 0(10)0*

B : (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*

C : (0+1)*01(0+1)*+1*0* = (0+1)*0

D : (01)*01 = 0(10)0*1

Q.no 4. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop

D : push, pop and replace

Q.no 5. Finite state machine is ___________tuple machine.

A:4

B:5

C:6

D : unlimitted

Q.no 6.
A:R

B:

C : R*

D:

Q.no 7.

A:

B:

C:L

D : L*

Q.no 8. Bottom-up parsing is also known as

A : shift reduce parsing

B : predictive descent parsing

C : operator precedence parsing

D : LL1 Parsing

Q.no 9.

A:

B:

C:0

D:1

Q.no 10. Precedence of regular expression in decreasing order is

A:*,.,+
B:.,*,+

C:.,+,*

D:+,.,*

Q.no 11. Those problems that are solvable in polynomial time belong to __

A : NP

B:P

C : Hard

D : Complete

Q.no 12. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject

D : start and accept

Q.no 13. Which among the following is the format of unit production?

A : A->B

B : A->b

C : B->Aa

D : B->aA

Q.no 14. Which operation can be applied on stack

A : Push

B : Pop

C : Push and Pop

D : Read

Q.no 15.
A : Always starts with b

B : Can have any number of ba and ab

C : Can not have 2 b's together.

D : Starts and end with same symbol

Q.no 16. To simplify a grammar we can eliminate

A : Useful symbols

B : epsilon productions

C : Reachable symbols

D : Non Unit productions

Q.no 17. Halting problem is an example for

A : decidable problem

B : undecidable problem

C : complete problem

D : trackable problem

Q.no 18. The language accepted by a Turing machine is called ………. language.

A : Regular

B : Recursively Enumerable

C : Context free

D : Context sensitive

Q.no 19. Which among the following are incorrect regular identities?

A:

B:

C:
D:

Q.no 20. How many states a Turing machine has?

A : Finite

B : Infinite

C : May be finite

D : One

Q.no 21. If r1 = (aa + bb) and r2 = (a + b) then the language (aa + bb)(a + b) will be
generated by

A : (r1)(r2)

B : (r1 + r2)

C : (r2)(r1)

D : (r1)

Q.no 22. The variable which produces


epsilon is called

A : Empty variable

B : Nullable variable

C : Non-empty variable

D : Non-nullable variable

Q.no 23. Which of the following is in 2-CNF?

A : (e1 Ʌ e2) Ʌ (e1 Ʌ ~e2)

B : (e1 Ʌ e2) Ʌ (e1 V ~e2)

C : (e1 V e2) Ʌ (e1 V ~e2)

D : (e1 V e2) Ʌ (e1 Ʌ ~e2)

Q.no 24. Which of the following pairs have different expressive power

A : Deterministic Finite Automata (DFA) and Non-deterministic Finite Automata (NFA)


B : Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down Automata
(NPDA)

C : single tape turing machine and multi tape turing machine

D : deterministic single tape and nondeterministic single tape turing machine

Q.no 25. Language is accepted by PDA if it is

A : regular language

B : context free language

C : unrestricted

D : regular and context free

Q.no 26. Which of the following is a false statement?

A : Moore machine has no accepting states

B : Mealy machine has no accepting states

C : We can convert Mealy to Moore and vice versa

D : We can convert Mealy to Moore but not vice versa

Q.no 27. A non-deterministic pushdown automaton can be converted into an equivalent


deterministic pushdown automaton.

A : never

B : not always

C : always

D : maybe

Q.no 28. The power of non-deterministic pushdown automata and deterministic


pushdown automata is not same.

A : true

B : false

C : maybe

D : cannot say
Q.no 29. The travelling salesman problem can be solved using _________

A : A spanning tree

B : A minimum spanning tree

C : Bellman – Ford algorithm

D : DFS traversal

Q.no 30. The minimum number of 1’s to be used in a regular expression of the given
language of all strings containing exactly 2 zeroes.

A:2

B:3

C:0

D:1

Q.no 31. An Epsilon-NFA is ___________ in representation.

A : Quadruple

B : Quintuple

C : Triple

D : None of the mentioned

Q.no 32. In multi head Turing machine there are

A : More than one heads of the Turing machine

B : More than one input tapes of Turing machine

C : Similar to the basic model of Turing machine

D : More than one input symbols of Turing machine

Q.no 33. Choose the incorrect statement.

A : Moore and Mealy machines are FSM with output capabilities

B : Any given Moore machine has an equivalent Mealy machine

C : Any given Mealy machine has an equivalent Moore machine


D : Moore machine is not an FSM

Q.no 34. The difference between Turing Machine and Two Way FA is in:

A : Input Tape

B : Read Write Head

C : Finite Control

D : All of these

Q.no 35. The worst case complexity of a deterministic problem to find the satisfiability
of a given formula of n variables is

A : O(n)

B : O(n^2)

C : O(n^3)

D : O(2^n)

Q.no 36. The basic limitation of finite automata is that

A : It cannot remember arbitrary large amount of information.

B : It sometimes recognize grammar that are not regular.

C : It sometimes fails to recognize regular grammar.

D : It sometimes fails to recognize regular laguage

Q.no 37. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2

Q.no 38. The regular expression with all strings of 0′s and 1′s with at least two
consecutive 0′s is:

A : 1 + (10)*
B : (0+1)*00(0+1)*

C : (0+1)*011

D : 0*1*2*

Q.no 39. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2

C:3

D:0

Q.no 40. Which of the following pairs have DIFFERENT expressive power?

A : Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

B : Deterministic push down automata (DPDA) and Non-deterministic pushdown automata


(NPDA)

C : Deterministic single-tape Turing machine and Non-deterministic single-tape Turing


Machine

D : Single-tape Turing machine and multi-tape Turing machine

Q.no 41. The following Turing machine acts like


A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 42. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 43. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:

B:
C:

D:

Q.no 44. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 45. 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

Q.no 46. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 47.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 48. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard
Q.no 49. The minimum number of productions required to produce a language
consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 50.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 51. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.

A:
B:

C:

D:

Q.no 52. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a
D : (a+b)(a+b)*

Q.no 53. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 54. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:

D:
Q.no 55. Context free grammar having the following production
X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 56. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 57. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 58. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 59. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 60. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable

Q.no 1. Consider following regular expression


i) (a|b)* ii) (a*|b*)* iii) ((a)*b*)* Which of the following statements is correct?
A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : all are equal

Q.no 2. Regular expression x + y denotes the set

A : {x,y}

B : {xy}

C : {x}

D : {y}

Q.no 3. Universal TM influenced the concept of

A : Stored program computers

B : Interpretive implementation of programming languages

C : Computability

D : All of these

Q.no 4. Can we convert PDA to equivalent CFG?

A : yes

B : no

C : maybe

D : never

Q.no 5. The minimum number of states required to recognize an octal number divisible
by 3 is

A:1

B:3

C:5

D:7
Q.no 6. Identify the problem: Given a graph G = <V, E>, and a starting node a, does it
have a tour cost less than k?

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 7. Turing Machine also behaves like General purpose computer and that TM is
known as _______

A : Multi-tape Turing Machine

B : Poly-tape Turing Machine

C : Universal Turing Machine

D : Deterministic Finite Automata

Q.no 8. Which of the following pair of regular expressions are not equivalent?

A : 1(01)* and (10)*1

B : x(xx)* and (xx)*x

C : (ab)* and a*b*

D : x+ and x*x+

Q.no 9. Turing Machine can update symbols on its tape, whereas the FA cannot update
symbols on tape.

A : true

B : false

C : Cannot say

D : May be

Q.no 10. Epsilon-closure of a state is a combination of self state and ----

A : Epsilon-reachable states

B : initial state
C : Final state

D : Non-final states

Q.no 11. Top-down parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 12. Decidable can be taken as a synonym to:

A : Recursive

B : Non Recursive

C : Recognizable

D : Non Recognizable

Q.no 13. A two-way infinite tape Turing machine is ________ superior than the basic
model of the Turing machine in terms of power.

A : More

B : Less

C : No way

D : Very Much

Q.no 14. _________ is the class of decision problems that can be solved by non-
deterministic polynomial algorithms?

A : NP

B:P

C : Hard

D : Complete

Q.no 15. In Moore machine, if input is of length n, then length of output string will be

A:n
B : n+1

C : n+n

D : n-1

Q.no 16. Finite automata needs minimum _______ number of stacks

A:0

B:1

C:2

D:3

Q.no 17. Which of the following a Turing machine does not consist of?

A : Input tape

B : Head

C : State register

D : Stack

Q.no 18. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 19. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 20. NFA, in its name has Non-deterministic words because

A : The result is undetermined


B : The choice of path is non-deterministic

C : The state to be transited next is non-deterministic

D : More number of final states

Q.no 21. Which of the following is not a regular expression?

A : [(a+b)*(aa+bb)]*

B : [(0+1)-(0b+a1)*(a+]*

C : (01+11+10)*

D : (1+2+0)*(1+2)*

Q.no 22. 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)

Q.no 23. Which one of the following is FALSE?

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to an equivalent DFA.

C : Every Epsilon NFA can be converted to an equivalent DFA.

D : Every Mealy can be converted to an equivalent Moore machine.

Q.no 24. The RE in which any number of 0′s is followed by any number of 1′s followed
by any number of 2′s is

A : (0+1+2)*

B : 0*1*2*

C : 0* + 1 + 2

D : (0+1)*2*

Q.no 25. 3-SAT and 2-SAT problems are


A : NP-complete and in P respectively

B : Undecidable and NP-complete

C : Both NP-complete

D : Both in P

Q.no 26. Which regular language corresponds to 1+(1+0)*0+(0+1)*11

A : The language of all strings that end with 11 or 00

B : The language of all strings that end with 0 or 1

C : The language of all strings which does not end with 01

D : The language of all strings which does not end with 10

Q.no 27. Given a Grammar G:


S->aA
A->a | A
B->B
The number of productions to be removed immediately as Unit productions are

A:0

B:1

C:2

D:3

Q.no 28. Which of the following is true for the language?

A : It is not accepted by a Turing Machine

B : It is regular but not context-free

C : It is context-free but not regular

D : It is neither regular nor context-free, but accepted by a Turing machine

Q.no 29.

A:
B:

C:

D:

Q.no 30. For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.

A : true

B : false

C : maybe

D : probably

Q.no 31. Which productions will generate odd length palindromes for terminals 'a' and
'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 32. Which of the following is the restricted model of Turing machines (a) Turing
machine with semi-infinite tape, (b) Multi stack machine, (c) Offline Turing machine

A : Only (a)

B : Only (b)

C : Only (c)

D : Both (a) and (b)

Q.no 33. Which of the following statement is not true?

A : Type 0 grammar is called unrestricted grammar

B : Chomsky hierarchy define only one type of grammar

C : Type 3 grammar is recognized by FA

D : Type 2 grammar is CFG


Q.no 34. Every grammar in Chomsky Normal Form is:

A : Regular

B : Context free

C : Context sensitive

D :  Unrestricted

Q.no 35. Limitation of PDA can be overcome by

A : Mealy machine

B : Moore machine

C : Turing machine

D : Finite state machine

Q.no 36. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?

A : X will always be a better choice for small inputs

B : X will always be a better choice for large inputs

C : Y will always be a better choice for small inputs

D : X will always be a better choice for all inputs

Q.no 37. Construct a regular expression for the language that contains strings having
even number of 0’s followed by odd number of 1’s over {0, 1}.

A : (00)* 1 (11)*

B : ((0+1)(0+1))*

C : (0+1)*

D : (001)*

Q.no 38. Unrestricted grammar is also called_______ Grammar

A : Type 3

B : Type 2

C : Type 1
D : Type 0

Q.no 39. The subset construction shows that every NFA accepts a ……..

A : String

B : Function

C : Regular language

D : Context-free language

Q.no 40. Which of the following is true?

A : The complement of a recursive language is recursive.

B : The complement of a recursively enumerable language is recursively enumerable.

C : The complement of a recursive language is either recursive or recursively enumerable.

D : The complement of a context-free language is context-free.

Q.no 41. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 42. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 43. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?
A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 44. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 45. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 46. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 47. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?
A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 48. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 49. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 50. The language A-> tB|t generated by which of the following grammar?

A : Type 3
B : Type 2

C : Type 1

D : Type 0

Q.no 51.

A:A

B:B

C:C

D:D

Q.no 52. 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 : (a . b) (a . b)

Q.no 53. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.


Q.no 54. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 55. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 56. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 57. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?
A:

B:

C:

D:

Q.no 58. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab
A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 59. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 60. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 1. Minimal finite automata need _____________ no. of final states

A:1

B:2

C:3

D : Depends on problem

Q.no 2. Language of finite automata is generated by

A : Type 0 grammar

B : Type 1 grammar

C : Type 2 grammar
D : Type 3 grammar

Q.no 3. A problem which is both _______ and _________ is said to be NP complete.

A : P, NP

B : NP, NP hard

C : P, P complete

D : NP Hard,P

Q.no 4. The format: A->aB refers to which of the following?

A : Chomsky Normal Form

B : Greibach Normal Form

C : Backus Naur Form

D : Sentential form

Q.no 5. Which one of the following is the most powerful method?

A : LL(1)

B : SLR

C : CLR

D : LALR

Q.no 6. Linear Bounded Automaton is a

A : Finite Automaton

B : Turing Machine

C : Push down Automaton

D : Deterministic Finite Automata

Q.no 7. Which of the following statement is true?

A : Mealy machine has no terminating state

B : A Moore machine has terminating state

C : Converting from Mealy into Moore machine and vice versa is not possible
D : More machine is Moore powerful than Mealy machine

Q.no 8. Are the given two patterns equivalent?


(1) gray | grey (2) gr(a|e)y

A : yes

B : no

C : may be

D : cannot say

Q.no 9. Given the expression, is there some assignment of true and false values to the
variables that will make the entire expression true? This is termed as

A : Satisfiability problem

B : Independent set problem

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 10. Those problems that require large amount of computational resources that
are practically not feasible to solve, these problems are known as _________

A : Decidable

B : Undecidable

C : Tractable

D : Intractable

Q.no 11. In one move the Turing machine___

A : May change its state

B : Write a symbol on the cell being scanned.

C : Move the head one position left or right

D : All of the above

Q.no 12.
A : L*

B:

C:L

D:

Q.no 13. (a+b)* is equivalent to

A : b*a*

B : (a*b*)*

C : a*b*

D:

Q.no 14. Those problems that are solvable in polynomial time belong to __

A : NP

B:P

C : Hard

D : Complete

Q.no 15. Top-down parsers use the grammar

A : LL(K)

B : LR(K)

C : SLR(K)

D : CLR(K)

Q.no 16. Finite state machine can recognize

A : any grammar

B : only context-free grammar

C : context free grammar and regualr grammar


D : only regular grammar

Q.no 17. A formal language is recursive if :

A : A turing machine exists

B : A turing machine that halts for every input

C : Turing machine rejects if the input does not belong to the language

D : All of the mentioned

Q.no 18. If T1 and T2 are two Turing machines, the composite can be represented using
the expression

A : T1 T2

B : T2 T1

C : T1 X T2

D : T2 X T1

Q.no 19. RR* can be expressed in which of the forms:

A : R+

B : R-

C : R+ U R-

D:R

Q.no 20. In given Transition function of TM which head movement of tape is shown
(q0,a)->(q1,X,L)

A : Left Movement

B : Right Movement

C : Top Movement

D : Bottom Movement
Q.no 21.

A : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the right
movement.

B : Perform the transition from q0 to q1 by changing "X" symbol to "a" and perform the right
movement.

C : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the Left
movement.

D : Perform the transition from q0 to q1 by changing "q0" symbol to "q1" and perform the
right movement.

Q.no 22. Which of the following represents a language which has no pair of consecutive
1’s if alphabet = {0,1}?

A:

B:

C:

D:

Q.no 23. Which of the following does not obey pumping lemma for context free
languages ?

A : Finite languages

B : Context free Languages

C : Unrestricted languages

D : Restricted languages

Q.no 24. The problem of finding a path in a graph that visits every vertex exactly once
is called
A : Hamiltonian path problem

B : Hamiltonian cycle problem

C : Subset sum problem

D : Turnpike reconstruction problem

Q.no 25. How many strings of length less than 4 contain the language described by the
regular expression (x+y)*y(a+ab)*

A:7

B : 10

C : 12

D : 11

Q.no 26. Is the language preserved in all the steps while eliminating epsilon transitions
from a NFA?

A : yes

B : no

C : may be

D : cannot say

Q.no 27. Turing machine (TM) is more powerful than FSM (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 : It has tape symbols

Q.no 28. Can a DFA recognize a palindrome number?

A : Yes

B : No

C : May be
D : Cannot be determined

Q.no 29. For a give Moore Machine,


Statement 1: Null string is processed in Moore Machine.
Statement 2: There are more than 5-Tuples in the definition of Moore Machine.
Choose the correct option.

A : Statement 1 is true and Statement 2 is true

B : Statement 1 is true while Statement 2 is false

C : Statement 1 is false while Statement 2 is true

D : Statement 1 is false and Statement 2 is false

Q.no 30. Production Rule: aAb->agb belongs to which of the following category?

A : Regular Language

B : Context free Language

C : Context Sensitive Language

D : Recursively Ennumerable Language

Q.no 31. PDA works as Finite Automata when the number of auxiliary memory it has is

A:3

B:2

C:1

D:0

Q.no 32. The worst case complexity of a deterministic problem to find the satisfiability
of a given formula of n variables is

A : O(n)

B : O(n^2)

C : O(n^3)

D : O(2^n)

Q.no 33. Which of the following statements is false?


A : For every non-deterministic Turing machine, there exists an equivalent deterministic
Turing machine.

B : Turing recognizable languages are closed under union and complement.

C : Turing decidable languages are closed under intersection


and complement.

D : Turing recognizable languages are closed under union and intersection.

Q.no 34. Out of the three decision problems P1, P2 and P3, P1 is decidable and P2 is
undecidable. The statement that holds true is

A : P3 is decidable if P3 is reducible to compliment of P2

B : P3 is decidable if P1 is reducible to P3

C : P3 is undecidable if P1 is reducible to P3

D : P3 is undecidable if P2 is reducible to P3

Q.no 35. The set of all strings over {a,b} in which strings consisting a’s and b’s and
ending with bb is

A : ab

B : a*bbb

C : (a+b)* bb

D : (a+b)+ bb

Q.no 36. Which of the following statement is false?

A : Every language that is defined by regular expression can also be defined by finite
automata

B : Every language defined by finite automata can also be defined by regular expression

C : We can convert regular expressions into finite automata

D : There exists a unique DFA for every regular language

Q.no 37. The total number of states and transitions required to form a Moore machine
that processes a binary input string and will produce residue mod 3.

A : 3 and 6

B : 3 and 5
C : 2 and 4

D : 2 and 5

Q.no 38. The operations of PDA never work on elements other than top of the stack.

A : false

B : true

C : may be

D : cannot say

Q.no 39. For a DFA accepting binary numbers whose decimal equivalent is divisible by
4, what are all the possible remainders?

A:0

B:2

C : 0,2,4

D : 0,1,2,3

Q.no 40. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 41. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD
C:CD

D:DA

Q.no 42. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 43. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 44. 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

Q.no 45. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 46. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 47. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 48. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 49. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 50. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 51. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard
Q.no 52. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 53. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 54.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 55. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular


B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 56. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 57.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 58. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 59. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is
A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 60. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:

B:
C:

D:

Q.no 1. Which of the following can be used to simulate any Turing machine?

A : Finite State Automaton

B : Universal Turing Machine

C : Counter machines

D : Deterministic Finite Automata

Q.no 2. If the PDA does not stop on an accepting state and the stack is not empty, the
string is

A : rejected

B : goes into loop forever

C : rejected and goes into loop forever

D : accepted
Q.no 3. A boolean formula is said to be in Conjuctive Normal Form (CNF) if it can
represented as

A : e1 V e2 V e3

B : e1 Ʌ e2 V e3

C : e1 V e2 Ʌ e3

D : e1 Ʌ e2 Ʌ e3

Q.no 4. Transition function of Turing Machine is

A:

B:

C:

D:

Q.no 5. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?

A : moves

B : transition function

C : or symbol

D : not symbol

Q.no 6. Choose the correct option for the statement: Unambiguity is the ideal structure
of a language.

A : true

B : Partially True

C : false

D : Cannot be said

Q.no 7. What is the value of n if Turing machine is defined using n-tuples?

A:6
B:7

C:8

D:5

Q.no 8. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop

D : push, pop and replace

Q.no 9. 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 the former depends only on the present input

D : output of the former depends on the present input and next state

Q.no 10. Turing machine was invented by

A : Alan Turing

B : Turing man

C : Turing taring

D : Turling Bake

Q.no 11. Bottom-up parsing is also known as

A : shift reduce parsing

B : predictive descent parsing

C : operator precedence parsing

D : LL1 Parsing

Q.no 12. In Moore machine the output depends on

A : Only present state


B : Present state and present input

C : Nothing

D : Type of input

Q.no 13. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 14. Which of the following case does not exist in complexity theory?

A : Best case

B : Worst case

C : Average case

D : Null case

Q.no 15. PDA always works on top element of stack

A : true

B : false

C : maybe

D : cannot say

Q.no 16. A grammar that produces more than one parse tree for some sentence is
called

A : ambiguous

B : unambiguous

C : regular

D : context free grammar


Q.no 17. If two finite state machines are equivalent,

A : they should have the same number of states

B : they should have the same number of edges

C : they should have the same number of states and edges

D : they can have different number of states and edges

Q.no 18. There is a linear grammar that generates a context free grammar

A : Always

B : Never

C : Sometimes

D : Everytime

Q.no 19. In Parse Tree, Root represents

A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 20. A Turing machine with several tapes in known as

A : Multi-tape Turing machine

B : Poly-tape Turing maching

C : Universal Turing machine

D : Complete Turing machine

Q.no 21.

A:
B:

C:

D : {0, 1}

Q.no 22. Number of states required to accept strings ending with 10 are

A:3

B:2

C:1

D : can’t be represented.

Q.no 23. The complexity class P consist of all the decision problems that can be solved
by ___________using polynomial amount of computation time.

A : Push Down automata

B : DFA

C : NDFA

D : Deterministic Turing machine

Q.no 24. Given a Grammar G:


S->aA
A->a | A
B->B
The number of productions to be removed immediately as Unit productions are

A:0

B:1

C:2

D:3

Q.no 25. The shown language is recognized by (a) Turing machine, (b) Pushdown

automata, (c) Finite automata

A : Only (a)
B : Only (b)

C : Only (c)

D : Only (a) and (b)

Q.no 26. The power of non-deterministic pushdown automata and deterministic


pushdown automata is not same.

A : true

B : false

C : maybe

D : cannot say

Q.no 27. Which of the functions are not performed by the Turing machine after reading
a symbol?

A : Writes the symbol

B : Moves the tape one cell left/right

C : Proceeds with next instruction or halts

D : Push the input in stack

Q.no 28. The set of all strings over alphabet = {a,b} in which all strings having bbbb as
substring is

A : (a+b)* bbbb (a+b)*

B : (a+b)* bb (a+b)*bb

C : bbb(a+b)*

D : bb (a+b)*

Q.no 29. Which of the following is not a Non deterministic Turing machine?

A : Alternating Turing Machine

B : Probabalistic Turing Machine

C : Read-only Turing Machine

D : Unsolvable
Q.no 30. 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

Q.no 31. A context free language is called ambiguous if (a) It has two or more leftmost
derivations for the same string. (b) It has two or more rightmost derivations for the
same string. (c) It has Only single derivation tree.

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 32. Which of the following statements is incorrect?

A : A Turing Machine cannot solve Halting problem

B : Set of recursively enumerated languages is closed under union

C : A FSM with 3 stacks is more powerful than FSM with 2 stacks

D : Context sensitive grammar can be recognized by a linearly bounded memory machine.

Q.no 33. PDA is useful in

A : lexical analysis

B : syntax analysis

C : semantic analysis

D : code generation

Q.no 34. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings without double a?

A:
B : ((a+b)(a+b))*

C : (a + bb)*

D:

Q.no 35. The RE that gives none or many instances of an x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 36. The automaton which allows transformation to a new state without consuming
any input symbols:

A : NFA

B : DFA

C : Epsilon NFA

D : PDA

Q.no 37. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 38. In given Transition function of TM


(q1,b)->(q2,Y,R)
Which one is the correct statement?

A : "q1" symbol is changed to "q2"

B : "b" symbol is changed to "q2"

C : "Y" symbol is changed to "b"


D : "b" symbol is changed to "Y"

Q.no 39. An NFA’s transition function returns

A : Boolean value

B : A state

C : A set of states

D : An edge

Q.no 40. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2

Q.no 41. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?

A:

B:
C:

D:

Q.no 42.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 43. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 44. Which of the following grammars are in Chomsky Normal Form:
A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 45. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 46. 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 : (a . b) (a . b)

Q.no 47. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7
D:2

Q.no 48. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 49. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 50. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 51. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 52. The context free grammar


S->SS|0S1 |1S0|Є
generates :
A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 53. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 54. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 55. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 56. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12
D : 15

Q.no 57.

A:A

B:B

C:C

D:D

Q.no 58. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*
Q.no 59. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 60. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 1. A problem which is both _______ and _________ is said to be NP complete.

A : P, NP

B : NP, NP hard

C : P, P complete
D : NP Hard,P

Q.no 2. Turing machine is more powerful than (a) Finite automata, (b) Push down
automata

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Neither (a) nor (b)

Q.no 3. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 4. Which among the following cannot be accepted by a regular grammar?

A : L is a set of numbers divisible by 2

B : L is a set of binary complement

C : L is a set of strings with odd number of 0s

D : L is a set of 0^n1^n

Q.no 5. Every grammar in Chomsky Normal Form is:

A : regular

B : context sensitive

C : context free

D : Unrestricted

Q.no 6. A deterministic Turing machine is

A : Ambiguous Turing Machine

B : Unambiguous Turing Machine


C : Non-Deterministic Finite Automata

D : Deterministic Finite Automata

Q.no 7. To which of the following class does a CNF-satisfiability problem belong?

A : NP class

B : P class

C : NP complete

D : NP hard

Q.no 8. If P, Q, R are three regular expressions and if P does not contain epsilon, then
the equation R = Q + RP has a unique solution given by

A : R = QP*

B : R = P*Q

C : R = RP

D : R = QP

Q.no 9. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject

D : start and accept

Q.no 10. A grammar G=(V, T, P, S) is __________ if every production taken one of the two
forms: B->aC , B->a

A : Ambiguous

B : Regular

C : Non Regular

D : Context sensitive

Q.no 11. In regular expressions, the operator ‘*’ stands for

A : Concatenation
B : Selection

C : Iteration

D : Addition

Q.no 12. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.

A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 13.

A:

B:

C:0

D:1

Q.no 14. Epsilon-closure of a state is a combination of self state and ----

A : Epsilon-reachable states

B : initial state

C : Final state

D : Non-final states

Q.no 15. The recognizing capability of NDFAand DFA

A : must be the same

B : may be different

C : must be different

D : cannot say
Q.no 16. A problem is called __________ if it has an efficient algorithm for itself.

A : Tractable

B : Intractable

C : Computational

D : Computable

Q.no 17. PDA accepts languages generated by which grammar

A : type 0

B : type 1

C : type 2

D : type 3

Q.no 18. Why Palindromes cannot be recognized by any FSM ?

A : an FSM cannot deterministically fix the mid-point

B : an FSM can remember arbitrarily large amount of information

C : FSM has finite memory

D : FSM has only 5 tuples

Q.no 19. Halting problem is an example for

A : decidable problem

B : undecidable problem

C : complete problem

D : trackable problem

Q.no 20. A language is regular if and only if

A : accepted by DFA

B : accepted by PDA

C : accepted by LBA

D : accepted by Turing machine


Q.no 21. According to the given language, which among the following expressions does
it corresponds to Language L={xϵ{0,1}|x is of length 4 or less}

A : (0+1+0+1+0+1+0+1)^4

B : (0+1)^4

C : (01)^4

D : (0+1+ε)^4

Q.no 22. Recursively enumerable languages are …….. , whereas recursive languages are
…....

A : completely-solvable, semi solvable

B : semi-solvable, completely solvable

C : not solvable, completely solvable

D : semi-solvable, not solvable

Q.no 23. How many strings of length less than 4 contain the language described by the
regular expression (x+y)*y(a+ab)*

A:7

B : 10

C : 12

D : 11

Q.no 24. Which of the following is the restricted model of Turing machines (a) Turing
machine with semi-infinite tape, (b) Multi stack machine, (c) Offline Turing machine

A : Only (a)

B : Only (b)

C : Only (c)

D : Both (a) and (b)

Q.no 25. Complement of a DFA can be obtained by

A : making starting state as final state.


B : no trival method.

C : making final states non-final and non-final to final.

D : make final as a starting state.

Q.no 26. Which productions will generate even length palindromes for terminals 'a'
and 'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 27. X is a simple mathematical model of a computer. X has unrestricted and


unlimited memory. X is a FA with R/W head. X can have an infinite tape divided into
cells, each cell holding one symbol.
Name X?

A : Push Down Automata

B : Non deterministic Finite Automata

C : Turing machines

D : Deterministic Finite Automata

Q.no 28. The worst-case efficiency of solving a problem in polynomial time is?

A : O(p(n))

B : O(p( n log n))

C:

D : O(p(m log n))

Q.no 29. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2
C:3

D:0

Q.no 30. Which of the following pairs have DIFFERENT expressive power?

A : Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

B : Deterministic push down automata (DPDA) and Non-deterministic pushdown automata


(NPDA)

C : Deterministic single-tape Turing machine and Non-deterministic single-tape Turing


Machine

D : Single-tape Turing machine and multi-tape Turing machine

Q.no 31. Which of the following is true?

A : The complement of a recursive language is recursive.

B : The complement of a recursively enumerable language is recursively enumerable.

C : The complement of a recursive language is either recursive or recursively enumerable.

D : The complement of a context-free language is context-free.

Q.no 32. 3-SAT and 2-SAT problems are

A : NP-complete and in P respectively

B : Undecidable and NP-complete

C : Both NP-complete

D : Both in P

Q.no 33. The minimum number of productions required to produce a language


consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6

Q.no 34. Regular expression (x|y)(x|y) denotes the set


A : {xy,xy}

B : {xx,xy,yx,yy}

C : {x,y}

D : {x,y,xy}

Q.no 35. 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

Q.no 36. Which of the following statement is false?

A : Every language that is defined by regular expression can also be defined by finite
automata

B : Every language defined by finite automata can also be defined by regular expression

C : We can convert regular expressions into finite automata

D : There exists a unique DFA for every regular language

Q.no 37. Which among the following is equivalent to the given regular expression 01*+1

A : (01)*+1

B : 0((1)*+1)

C : (0(1)*)+1

D : ((0*1)1*)*

Q.no 38. Which of the following is not an application of Finite Automaton?

A : Compiler Design

B : Grammar Parsers

C : Text Search

D : Image processing
Q.no 39. Which of the regular expressions correspond to the given problem statement:
Express the identifiers in C Programming language where l=letters d=digits

A : (l+_)(d+_)*

B : (l+d+_)*

C : (l+_)(l+d+_)*

D : (_+d)(l+d+_)*

Q.no 40. PDA can be represented with the help of

A : Instantaneous description

B : input symbols

C : start state

D : final state

Q.no 41. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:
D:

Q.no 42. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 43. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 44. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 45. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II
B : Only III

C : Only I and II

D : Only I and III

Q.no 46. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 47. 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

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 48. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 49. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?
A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 50. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 51. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 52. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 53. Construct a Turing machine which accepts a string with ‘aba’ as its substring.
A:

B:

C:
D:

Q.no 54. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 55. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 56. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab
B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 57.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 58. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 59. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable
D : X1 – X3 is recursively enumerable

Q.no 60. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 1. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 2. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 3. Bottom-up parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 4. Finite state machine is ___________tuple machine.

A:4
B:5

C:6

D : unlimitted

Q.no 5. NPDA stands for

A : non deterministic pushup automata

B : null pushdown automata

C : nested pushdown automata

D : non deterministic pushdown automata

Q.no 6. Minimal finite automata need _____________ no. of final states

A:1

B:2

C:3

D : Depends on problem

Q.no 7. Which of these does not belong to CFG?

A : Terminal Symbol

B : Non Terminal Symbol

C : Start symbol

D : End symbol

Q.no 8. Language of finite automata is generated by

A : Type 0 grammar

B : Type 1 grammar

C : Type 2 grammar

D : Type 3 grammar

Q.no 9. A DPDA is a PDA in which:

A : No state p has two outgoing transitions


B : More than one state can have two or more outgoing transitions

C : At least one state has more than one transitions

D : At most one state has more than one transitions

Q.no 10. RR* can be expressed in which of the forms:

A : R+

B : R-

C : R+ U R-

D:R

Q.no 11. Which operation can be applied on stack

A : Push

B : Pop

C : Push and Pop

D : Read

Q.no 12. Problems that can be solved in polynomial time are known as

A : intractable

B : tractable

C : decision

D : complete

Q.no 13. In given Transition function of TM which head movement of tape is shown
(q0,a)->(q1,X,L)

A : Left Movement

B : Right Movement

C : Top Movement

D : Bottom Movement

Q.no 14. For alphabet = {a,b}, the regular expression r = (aa)*(bb)*b denotes
A : Set of strings with 2 a’s and 2 b’s

B : Set of strings with 2 a’s 2 b’s followed by b

C : Set of strings with 2 a’s followed by b’s which is a multiple of 3

D : Set of strings with even number of a’s followed by odd number of b’s

Q.no 15. Which of the following are not quantifiers?

A : Kleene plus +

B : Kleene star *

C : Question mark ?

D : Union

Q.no 16. Which of the following are the examples of finite state machine system? (a)
Control Mechanism of an elevator (b) Traffic Lights (c) Combinational Locks

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 17. The Grammar can be defined as: G= (V, T, P, S) In the given definition, what
does S represents?

A : Accepting State

B : Starting Variable

C : Sensitive Grammar

D : Final state

Q.no 18. A formal language is recursive if :

A : A turing machine exists

B : A turing machine that halts for every input

C : Turing machine rejects if the input does not belong to the language

D : All of the mentioned


Q.no 19. Identify the problem: Given a graph G = <V, E>, and a starting node a, does it
have a tour cost less than k?

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 20. Which of the following regular expressions represents the set of strings which
do not contain a substring ‘rt’ if alphabet = {r, t}

A : (rt)*

B : (tr)*

C : (r*t*)

D : (t*r*)

Q.no 21. The travelling salesman problem can be solved using _________

A : A spanning tree

B : A minimum spanning tree

C : Bellman – Ford algorithm

D : DFS traversal

Q.no 22. The ability for a system of instructions to simulate a Turing Machine is called
_________

A : Turing Completeness

B : Simulation

C : Turing Halting

D : Computability

Q.no 23.
A : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the right
movement.

B : Perform the transition from q0 to q1 by changing "X" symbol to "a" and perform the right
movement.

C : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the Left
movement.

D : Perform the transition from q0 to q1 by changing "q0" symbol to "q1" and perform the
right movement.

Q.no 24. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 25. 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

Q.no 26. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 27. Which of the following statement is correct?

A : All Regular grammars are context free but not vice versa

B : All context free grammars are regular grammars but not vice versa
C : Regular grammar and context free grammar are the same entity

D : All context sensitive grammar are regular grammar but not vice versa

Q.no 28. Which language is represented by the following grammar G:


G={{S},{0,1},P,S}
where elements of P are:
S --> SS
S--> 0S1
S--> 1S0
S--> Є

A : Regular language

B : Context-free language

C : Context-sensitive language

D : Recursively enumerable language

Q.no 29. Which among the following is the LEAF of the parse tree?

A : Production P

B : Nonterminal V

C : Terminal T

D : Starting symbol S

Q.no 30. Which among the following is not true for 2-way infinte TM?

A : Tape in both directions

B : Leftmost square not distinguished

C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.

D : Tape is only in one direction.

Q.no 31. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production
D : Chomsky Normal Form

Q.no 32. Every grammar in Chomsky Normal Form is:

A : Regular

B : Context free

C : Context sensitive

D :  Unrestricted

Q.no 33. A PDA machine configuration (p, w, y) can be correctly represented as

A : unprocessed input, stack content, current state

B : current state, unprocessed input, stack content

C : current state, stack content, unprocessed input

D : stack content, current state, unprocessed input

Q.no 34. The complement of a language will only be defined when and only when the
__________ over the language is defined.

A : String

B : Word

C : Alphabet

D : Grammar

Q.no 35. Out of the three decision problems P1, P2 and P3, P1 is decidable and P2 is
undecidable. The statement that holds true is

A : P3 is decidable if P3 is reducible to compliment of P2

B : P3 is decidable if P1 is reducible to P3

C : P3 is undecidable if P1 is reducible to P3

D : P3 is undecidable if P2 is reducible to P3

Q.no 36. Which is a wrong satatement?

A : A regular language is produced by union of two regular languages

B : The concatenation of two regular languages is regular


C : The Kleene closure of a regular language is regular

D : The complement of a regular language is also a regular language

Q.no 37. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which any occurrence of the symbol b, is in
groups of odd numbers.

A : (abbb)*

B : a* b (bb)* a*

C : ((a+b)(a+b)(a+b))*

D : a* b* (bb)* a*

Q.no 38. If r1 = (aa + bb) and r2 = (a + b) then the language (aa + bb)(a + b) will be
generated by

A : (r1)(r2)

B : (r1 + r2)

C : (r2)(r1)

D : (r1)

Q.no 39. The instantaneous description is PDA shows

A : present state, string to be processed and stack symbol

B : present state and stack symbol

C : present state and string to be processed

D : stack symbol and string to be processed

Q.no 40. Limitation of PDA can be overcome by

A : Mealy machine

B : Moore machine

C : Turing machine

D : Finite state machine


Q.no 41.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 42. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 43. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 44. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b
C : S->aS | bS |S

D : S->aS | bS |a

Q.no 45. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 46. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 47. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's


Q.no 48. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 49. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 50. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 51.

A:A

B:B

C:C

D:D

Q.no 52. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine
Q.no 53. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 54. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 55. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 56.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 57. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 58. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's


D : has atleast two a's

Q.no 59. 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 : (a . b) (a . b)

Q.no 60. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 1. Which of the following is true?

A : (01)*0 = 0(10)0*

B : (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*

C : (0+1)*01(0+1)*+1*0* = (0+1)*0

D : (01)*01 = 0(10)0*1

Q.no 2. If P, Q, R are three regular expressions and if P does not contain epsilon, then
the equation R = Q + RP has a unique solution given by

A : R = QP*

B : R = P*Q

C : R = RP

D : R = QP

Q.no 3.

A : L*
B:

C:L

D:

Q.no 4. Which of the following pair of regular expressions are not equivalent?

A : 1(01)* and (10)*1

B : x(xx)* and (xx)*x

C : (ab)* and a*b*

D : x+ and x*x+

Q.no 5. In Moore machine, if input is of length n, then length of output string will be

A:n

B : n+1

C : n+n

D : n-1

Q.no 6. In Parse Tree, Intermediate Node represents

A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 7. Are the given two patterns equivalent?


(1) gray | grey (2) gr(a|e)y

A : yes

B : no

C : may be

D : cannot say
Q.no 8. Finite automata needs minimum _______ number of stacks

A:0

B:1

C:2

D:3

Q.no 9. Those problems that require large amount of computational resources that are
practically not feasible to solve, these problems are known as _________

A : Decidable

B : Undecidable

C : Tractable

D : Intractable

Q.no 10. Which among the following is the format of unit production?

A : A->B

B : A->b

C : B->Aa

D : B->aA

Q.no 11. Can we convert PDA to equivalent CFG?

A : yes

B : no

C : maybe

D : never

Q.no 12. NFA, in its name has Non-deterministic words because

A : The result is undetermined

B : The choice of path is non-deterministic

C : The state to be transited next is non-deterministic


D : More number of final states

Q.no 13. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 14. The decision problem is the function from string to ______________

A : char

B :  int

C :  boolean

D : float

Q.no 15.

A : Always starts with b

B : Can have any number of ba and ab

C : Can not have 2 b's together.

D : Starts and end with same symbol

Q.no 16. Turing Machine can update symbols on its tape, whereas the FA cannot update
symbols on tape.

A : true

B : false

C : Cannot say

D : May be

Q.no 17. Those problems that are solvable in polynomial time belong to __

A : NP
B:P

C : Hard

D : Complete

Q.no 18. Which of the following statement is true? (a) Turing machine was developed
by Alan Turing, (b) PDA is less powerful than Turing machine, (c) FA is more powerful
than TM

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 19. A->aA| a| b


The number of steps to generate aab are

A:2

B:3

C:4

D:5

Q.no 20. In CFG, notation of VARIABLE representation is

A : Captal Letters

B : Small Letters

C : Italic Letters

D : Roman Letters

Q.no 21. Which of the following does not obey pumping lemma for context free
languages ?

A : Finite languages

B : Context free Languages

C : Unrestricted languages

D : Restricted languages
Q.no 22. Which of the regular expressions correspond to the given problem statement:
Express the identifiers in C Programming language where l=letters d=digits

A : (l+_)(d+_)*

B : (l+d+_)*

C : (l+_)(l+d+_)*

D : (_+d)(l+d+_)*

Q.no 23. Which of the following automata takes stack as auxiliary storage

A : finite automata

B : pushdown automata

C : Turing machine

D : finite state machine

Q.no 24. The string (a)|((b)*(c)) is equivalent to

A : Empty

B : abcabc

C : b*c|a

D : abc

Q.no 25. Which of the following statement is false?

A : Context free language is the subset of context sensitive language

B : Regular language is the subset of context sensitive language

C : Recursively ennumerable language is the super set of regular language

D : Context sensitive language is a subset of context free language

Q.no 26. Choose the incorrect statement.

A : Moore and Mealy machines are FSM with output capabilities

B : Any given Moore machine has an equivalent Mealy machine

C : Any given Mealy machine has an equivalent Moore machine


D : Moore machine is not an FSM

Q.no 27. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 28. Recursive languages are ………… of recursively enumerable languages.

A : subset

B : proper subset

C : not subset

D : not proper subset

Q.no 29. Construct a regular expression for the language that contains strings having
even number of 0’s followed by odd number of 1’s over {0, 1}.

A : (00)* 1 (11)*

B : ((0+1)(0+1))*

C : (0+1)*

D : (001)*

Q.no 30. 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)

Q.no 31.

A:
B:

C:

D:

Q.no 32. Which of the following pairs have different expressive power

A : Deterministic Finite Automata (DFA) and Non-deterministic Finite Automata (NFA)

B : Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down Automata
(NPDA)

C : single tape turing machine and multi tape turing machine

D : deterministic single tape and nondeterministic single tape turing machine

Q.no 33. Which of the following statement is false?

A : For non deterministic PDA, equivalence is undecidable.

B : For deterministic PDA, equivalence is decidable.

C : For deterministic PDA, equivalence is undecidable.

D : For non deterministic PDA, equivalence is decidable.

Q.no 34. Turing machine (TM) is more powerful than FSM (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 : It has tape symbols

Q.no 35. Is the language preserved in all the steps while eliminating epsilon transitions
from a NFA?

A : yes

B : no

C : may be
D : cannot say

Q.no 36. A grammar G=(V,T,P,S) in which V represents

A : Set of Nonterminals

B : Start symbol

C : Set of terminals

D : Production

Q.no 37. Which of the following is in 2-CNF?

A : (e1 Ʌ e2) Ʌ (e1 Ʌ ~e2)

B : (e1 Ʌ e2) Ʌ (e1 V ~e2)

C : (e1 V e2) Ʌ (e1 V ~e2)

D : (e1 V e2) Ʌ (e1 Ʌ ~e2)

Q.no 38. Can a DFA recognize a palindrome number?

A : Yes

B : No

C : May be

D : Cannot be determined

Q.no 39. The shown language is recognized by (a) Turing machine, (b) Pushdown

automata, (c) Finite automata

A : Only (a)

B : Only (b)

C : Only (c)

D : Only (a) and (b)

Q.no 40. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?

A : X will always be a better choice for small inputs


B : X will always be a better choice for large inputs

C : Y will always be a better choice for small inputs

D : X will always be a better choice for all inputs

Q.no 41.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 42. 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

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 43. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.


Q.no 44. 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

Q.no 45. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 46. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 47. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011
Q.no 48. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 49. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 50. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?

A:

B:
C:

D:

Q.no 51. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 52. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 53. Construct a Turing machine which accepts a string with ‘aba’ as its substring.
A:

B:

C:
D:

Q.no 54. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 55. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 56. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard
Q.no 57. Which of the following is NOT generated by regular expression
R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 58. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 59. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 60. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II
B : Only III

C : Only I and II

D : Only I and III

Q.no 1. Which operation can be applied on stack

A : Push

B : Pop

C : Push and Pop

D : Read

Q.no 2. An algorithm is called efficient if it runs in ____________ time on a serial


computer.

A : Polynomial

B : Non polynomial

C : Logarithmic

D : Non Logarithmic

Q.no 3. Choose the correct option for the statement: Unambiguity is the ideal structure
of a language.

A : true

B : Partially True

C : false

D : Cannot be said

Q.no 4. Pushdown automata accepts

A : regular language

B : context free language

C : context sensitive language

D : unrestricted language

Q.no 5. A DPDA is a PDA in which:


A : No state p has two outgoing transitions

B : More than one state can have two or more outgoing transitions

C : At least one state has more than one transitions

D : At most one state has more than one transitions

Q.no 6. Regular expression x + y denotes the set

A : {x,y}

B : {xy}

C : {x}

D : {y}

Q.no 7. Given the expression, is there some assignment of true and false values to the
variables that will make the entire expression true? This is termed as

A : Satisfiability problem

B : Independent set problem

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 8. What is the Regular Expression Matching Zero or More Specific Characters

A:x

B:#

C:*

D:&

Q.no 9. Transition function of Turing Machine is

A:

B:

C:
D:

Q.no 10. The regular expression to denote zero or more instances of x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 11.

A:

B:

C:L

D : L*

Q.no 12. A push down automata is different than finite automata by

A : Its memory

B : number of states

C : start state

D : input symbols

Q.no 13. Consider following regular expression


i) (a|b)* ii) (a*|b*)* iii) ((a)*b*)* Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : all are equal

Q.no 14. Linear Bounded Automaton is a


A : Finite Automaton

B : Turing Machine

C : Push down Automaton

D : Deterministic Finite Automata

Q.no 15. Which of the following statement is true?

A : Mealy machine has no terminating state

B : A Moore machine has terminating state

C : Converting from Mealy into Moore machine and vice versa is not possible

D : More machine is Moore powerful than Mealy machine

Q.no 16. Which of the production rule can be accepted by Chomsky grammar. (i) A->BC,
(ii) A->a

A : only i

B : only ii

C : both i and ii

D : neither i nor ii

Q.no 17. A two-way infinite tape Turing machine is ________ superior than the basic
model of the Turing machine in terms of power.

A : More

B : Less

C : No way

D : Very Much

Q.no 18. The language accepted by a Turing machine is called ………. language.

A : Regular

B : Recursively Enumerable

C : Context free

D : Context sensitive
Q.no 19. Which of the following does not belong to the language if input alphabet set is
a,b

A:a

B:b

C : epsilon

D:c

Q.no 20. In one move the Turing machine___

A : May change its state

B : Write a symbol on the cell being scanned.

C : Move the head one position left or right

D : All of the above

Q.no 21. Which of the following statement is correct?

A : All Regular grammars are context free but not vice versa

B : All context free grammars are regular grammars but not vice versa

C : Regular grammar and context free grammar are the same entity

D : All context sensitive grammar are regular grammar but not vice versa

Q.no 22. Which of the given problems are NP-complete?

A : (a) Traveling Salesman Problem

B : (b) Satisfiability Problem

C : Both (a) and (b)

D : Turing Machine

Q.no 23. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings without double a?

A:

B : ((a+b)(a+b))*
C : (a + bb)*

D:

Q.no 24.

A : {w | w is a string of odd length}

B : {w | w is a string of length multiple of 3}

C : {w | w is a string of length 3}

D : {w | w is an empty string}

Q.no 25. Which of the following statement is false?

A : Every language that is defined by regular expression can also be defined by finite
automata

B : Every language defined by finite automata can also be defined by regular expression

C : We can convert regular expressions into finite automata

D : There exists a unique DFA for every regular language

Q.no 26. An Epsilon-NFA is ___________ in representation.

A : Quadruple

B : Quintuple

C : Triple

D : None of the mentioned

Q.no 27.

A:

B:
C:

D : {0, 1}

Q.no 28. Which of the following statements is false?

A : For every non-deterministic Turing machine, there exists an equivalent deterministic


Turing machine.

B : Turing recognizable languages are closed under union and complement.

C : Turing decidable languages are closed under intersection


and complement.

D : Turing recognizable languages are closed under union and intersection.

Q.no 29. The worst-case efficiency of solving a problem in polynomial time is?

A : O(p(n))

B : O(p( n log n))

C:

D : O(p(m log n))

Q.no 30. It is less complex to prove the closure properties over regular languages using

A : NFA

B : DFA

C : PDA

D : Canot be said

Q.no 31. Which of the following is a regular language?

A : String whose length is a sequence of prime numbers

B : String with substring wwr in between

C : Palindrome string

D : String with even number of Zeroes


Q.no 32. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states

D : transition function

Q.no 33. The total number of states and transitions required to form a Moore machine
that processes a binary input string and will produce residue mod 3.

A : 3 and 6

B : 3 and 5

C : 2 and 4

D : 2 and 5

Q.no 34. 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

Q.no 35. Which of the following is true for the language?

A : It is not accepted by a Turing Machine

B : It is regular but not context-free

C : It is context-free but not regular

D : It is neither regular nor context-free, but accepted by a Turing machine

Q.no 36. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input


C : current state and stack

D : current state

Q.no 37. Which of the following is not a Non deterministic Turing machine?

A : Alternating Turing Machine

B : Probabalistic Turing Machine

C : Read-only Turing Machine

D : Unsolvable

Q.no 38. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which any occurrence of the symbol b, is in
groups of odd numbers.

A : (abbb)*

B : a* b (bb)* a*

C : ((a+b)(a+b)(a+b))*

D : a* b* (bb)* a*

Q.no 39. PDA is useful in

A : lexical analysis

B : syntax analysis

C : semantic analysis

D : code generation

Q.no 40. Every CFG can be transformed into equivalent NPDA.

A : false

B : true

C : may be

D : cannot say

Q.no 41. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.

A:

B:

C:
D:

Q.no 42. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 43. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 44. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:
Q.no 45. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 46. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 47. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".
A:

B:

C:

D:

Q.no 48.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 49. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?
A : 10

B : 11

C : 12

D : 15

Q.no 50. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 51. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 52. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable
Q.no 53. The minimum number of productions required to produce a language
consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 54. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 55.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 56. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar
Q.no 57. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 58. 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 : (a . b) (a . b)

Q.no 59. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 60. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 1. PDA accepts languages generated by which grammar


A : type 0

B : type 1

C : type 2

D : type 3

Q.no 2. A Turing machine with several tapes in known as

A : Multi-tape Turing machine

B : Poly-tape Turing maching

C : Universal Turing machine

D : Complete Turing machine

Q.no 3. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 4. The major difference between Mealy and Moore machine is about:

A : Output Variations

B : Input Variations

C : Both

D : Transitions

Q.no 5. Which of the following are the examples of finite state machine system? (a)
Control Mechanism of an elevator (b) Traffic Lights (c) Combinational Locks

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)


Q.no 6. The format: A->aB refers to which of the following?

A : Chomsky Normal Form

B : Greibach Normal Form

C : Backus Naur Form

D : Sentential form

Q.no 7. In Mealy machine the output depends on

A : Only present state

B : Present state and present input

C : Nothing

D : Type of input

Q.no 8. If two finite state machines are equivalent,

A : they should have the same number of states

B : they should have the same number of edges

C : they should have the same number of states and edges

D : they can have different number of states and edges

Q.no 9. Bottom-up parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 10. A push down automaton employs which data structure?

A : queue

B : linked list

C : hash table

D : stack
Q.no 11. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.

A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 12. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject

D : start and accept

Q.no 13. Universal TM influenced the concept of

A : Stored program computers

B : Interpretive implementation of programming languages

C : Computability

D : All of these

Q.no 14. If T1 and T2 are two Turing machines, the composite can be represented using
the expression

A : T1 T2

B : T2 T1

C : T1 X T2

D : T2 X T1

Q.no 15. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop


D : push, pop and replace

Q.no 16. Epsilon-closure of a state is a combination of self state and ----

A : Epsilon-reachable states

B : initial state

C : Final state

D : Non-final states

Q.no 17. Which one of the following is the most powerful method?

A : LL(1)

B : SLR

C : CLR

D : LALR

Q.no 18. There is a linear grammar that generates a context free grammar

A : Always

B : Never

C : Sometimes

D : Everytime

Q.no 19. The finite automata  is called NFA when there exists____________ for a specific
input from current state to next state

A : Single path

B : Multiple paths

C : Only two paths

D : Three paths

Q.no 20. 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 : NP Complete

Q.no 21. The RE in which any number of 0′s is followed by any number of 1′s followed
by any number of 2′s is

A : (0+1+2)*

B : 0*1*2*

C : 0* + 1 + 2

D : (0+1)*2*

Q.no 22. Which of the following statement is false?

A : For non deterministic PDA, equivalence is undecidable.

B : For deterministic PDA, equivalence is decidable.

C : For deterministic PDA, equivalence is undecidable.

D : For non deterministic PDA, equivalence is decidable.

Q.no 23. Which of the following does not obey pumping lemma for context free
languages ?

A : Finite languages

B : Context free Languages

C : Unrestricted languages

D : Restricted languages

Q.no 24. Is the language preserved in all the steps while eliminating epsilon transitions
from a NFA?

A : yes

B : no

C : may be

D : cannot say

Q.no 25. Which one of the following is FALSE?


A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to an equivalent DFA.

C : Every Epsilon NFA can be converted to an equivalent DFA.

D : Every Mealy can be converted to an equivalent Moore machine.

Q.no 26. The difference between Turing Machine and Two Way FA is in:

A : Input Tape

B : Read Write Head

C : Finite Control

D : All of these

Q.no 27. The regular expression with all strings of 0′s and 1′s with at least two
consecutive 0′s is:

A : 1 + (10)*

B : (0+1)*00(0+1)*

C : (0+1)*011

D : 0*1*2*

Q.no 28. Under which of the following operation, NFA is not closed?

A : Negation

B : Kleene

C : Concatenation

D : complement

Q.no 29. The minimum number of productions required to produce a language


consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6
Q.no 30. The operations of PDA never work on elements other than top of the stack.

A : false

B : true

C : may be

D : cannot say

Q.no 31. Which regular language corresponds to 1+(1+0)*0+(0+1)*11

A : The language of all strings that end with 11 or 00

B : The language of all strings that end with 0 or 1

C : The language of all strings which does not end with 01

D : The language of all strings which does not end with 10

Q.no 32. The minimum number of 1’s to be used in a regular expression of the given
language of all strings containing exactly 2 zeroes.

A:2

B:3

C:0

D:1

Q.no 33. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 34. For a DFA accepting binary numbers whose decimal equivalent is divisible by
4, what are all the possible remainders?

A:0

B:2

C : 0,2,4
D : 0,1,2,3

Q.no 35. Which among the following is equivalent to the given regular expression 01*+1

A : (01)*+1

B : 0((1)*+1)

C : (0(1)*)+1

D : ((0*1)1*)*

Q.no 36. Complement of a DFA can be obtained by

A : making starting state as final state.

B : no trival method.

C : making final states non-final and non-final to final.

D : make final as a starting state.

Q.no 37. The RE that gives none or many instances of an x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 38. Language is accepted by PDA if it is

A : regular language

B : context free language

C : unrestricted

D : regular and context free

Q.no 39. The complexity class P consist of all the decision problems that can be solved
by ___________using polynomial amount of computation time.

A : Push Down automata

B : DFA
C : NDFA

D : Deterministic Turing machine

Q.no 40. According to Chomsky hierarchy, which of the following is recognized by


Recursively Enumerable language?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 41. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 42. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome


B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 43. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 44. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 45. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 46. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)


Q.no 47. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 48. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 49. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 50. 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

Q.no 51. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 52.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 53. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete
C : Q is NP-hard

D : R is NP-hard

Q.no 54. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 55. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 56.

A:A

B:B
C:C

D:D

Q.no 57. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 58. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 59. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*
B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 60. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:

B:

C:
D:

Q.no 1. Decidable can be taken as a synonym to:

A : Recursive

B : Non Recursive

C : Recognizable

D : Non Recognizable

Q.no 2. Precedence of regular expression in decreasing order is

A:*,.,+

B:.,*,+

C:.,+,*

D:+,.,*

Q.no 3. A formal language is recursive if :

A : A turing machine exists

B : A turing machine that halts for every input

C : Turing machine rejects if the input does not belong to the language

D : All of the mentioned

Q.no 4. The recognizing capability of NDFAand DFA

A : must be the same

B : may be different
C : must be different

D : cannot say

Q.no 5. In Moore machine the output depends on

A : Only present state

B : Present state and present input

C : Nothing

D : Type of input

Q.no 6. Language of finite automata is generated by

A : Type 0 grammar

B : Type 1 grammar

C : Type 2 grammar

D : Type 3 grammar

Q.no 7. Kruskal's algorithm is used to find

A : whether there is cycle in the graph

B : spanning tree of the graph

C : minimum spanning tree in the graph

D : whether there is spanning tree in the graph

Q.no 8. The symbol Z0 in formal definition of PDA is used for

A : input symbol

B : stack symbol

C : output symbol

D : tape symbol

Q.no 9. If the PDA does not stop on an accepting state and the stack is not empty, the
string is

A : rejected
B : goes into loop forever

C : rejected and goes into loop forever

D : accepted

Q.no 10. Which of the following regular expressions represents the set of strings which
do not contain a substring ‘rt’ if alphabet = {r, t}

A : (rt)*

B : (tr)*

C : (r*t*)

D : (t*r*)

Q.no 11. A grammar G=(V, T, P, S) is __________ if every production taken one of the two
forms: B->aC , B->a

A : Ambiguous

B : Regular

C : Non Regular

D : Context sensitive

Q.no 12. (a+b)* is equivalent to

A : b*a*

B : (a*b*)*

C : a*b*

D:

Q.no 13. 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)*

A : The set of all strings containing the substring 00

B : The set of all strings containing at most two 0’s

C : The set of all strings containing at least two 0’s

D : The set of all strings that begin and end with either 0 or 1
Q.no 14.

A:R

B:

C : R*

D:

Q.no 15. Are the given two patterns equivalent?


(1) gray | grey (2) gr(a|e)y

A : yes

B : no

C : may be

D : cannot say

Q.no 16. What is the pumping length of string of length x?

A : x+1

B:x

C : x-1

D : x2

Q.no 17. The Grammar can be defined as: G= (V, T, P, S) In the given definition, what
does S represents?

A : Accepting State

B : Starting Variable

C : Sensitive Grammar

D : Final state

Q.no 18. Which of the following is not a part of 5-tuple finite automata?
A : Input alphabet

B : Transition function

C : Initial State

D : Output alphabet

Q.no 19. In Moore machine, if input is of length n, then length of output string will be

A:n

B : n+1

C : n+n

D : n-1

Q.no 20. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?

A : moves

B : transition function

C : or symbol

D : not symbol

Q.no 21. Which is a wrong satatement?

A : A regular language is produced by union of two regular languages

B : The concatenation of two regular languages is regular

C : The Kleene closure of a regular language is regular

D : The complement of a regular language is also a regular language

Q.no 22. The basic limitation of finite automata is that

A : It cannot remember arbitrary large amount of information.

B : It sometimes recognize grammar that are not regular.

C : It sometimes fails to recognize regular grammar.

D : It sometimes fails to recognize regular laguage


Q.no 23. Given grammar G:
(1)S->AS (2)S->AAS (3)A->SA (4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?

A : 2,4

B : 1,3

C : 1, 2, 3, 4

D : 2, 3, 4

Q.no 24. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2

C:3

D:0

Q.no 25. Which of the following represents a language which has no pair of consecutive
1’s if alphabet = {0,1}?

A:

B:

C:

D:

Q.no 26. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states


D : transition function

Q.no 27. A grammar G=(V,T,P,S) in which V represents

A : Set of Nonterminals

B : Start symbol

C : Set of terminals

D : Production

Q.no 28. Given a Grammar G:


S->aA
A->a | A
B->B
The number of productions to be removed immediately as Unit productions are

A:0

B:1

C:2

D:3

Q.no 29. A non-deterministic pushdown automaton can be converted into an equivalent


deterministic pushdown automaton.

A : never

B : not always

C : always

D : maybe

Q.no 30. Which productions will generate odd length palindromes for terminals 'a' and
'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 31. Which of the following statement is not true?


A : Type 0 grammar is called unrestricted grammar

B : Chomsky hierarchy define only one type of grammar

C : Type 3 grammar is recognized by FA

D : Type 2 grammar is CFG

Q.no 32. Which of the following automata takes stack as auxiliary storage

A : finite automata

B : pushdown automata

C : Turing machine

D : finite state machine

Q.no 33. 3-SAT and 2-SAT problems are

A : NP-complete and in P respectively

B : Undecidable and NP-complete

C : Both NP-complete

D : Both in P

Q.no 34. 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)

Q.no 35. Which of the following is not a regular expression?

A : [(a+b)*(aa+bb)]*

B : [(0+1)-(0b+a1)*(a+]*

C : (01+11+10)*

D : (1+2+0)*(1+2)*
Q.no 36. PDA works as Finite Automata when the number of auxiliary memory it has is

A:3

B:2

C:1

D:0

Q.no 37. 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

Q.no 38. A context free language is called ambiguous if (a) It has two or more leftmost
derivations for the same string. (b) It has two or more rightmost derivations for the
same string. (c) It has Only single derivation tree.

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 39. Regular expression (x|y)(x|y) denotes the set

A : {xy,xy}

B : {xx,xy,yx,yy}

C : {x,y}

D : {x,y,xy}

Q.no 40. Which of the following statement is correct?

A : All Regular grammars are context free but not vice versa

B : All context free grammars are regular grammars but not vice versa
C : Regular grammar and context free grammar are the same entity

D : All context sensitive grammar are regular grammar but not vice versa

Q.no 41. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable

Q.no 42. 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 : (a . b) (a . b)

Q.no 43. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 44. CFG is not closed under

A : Kleene closure

B : Concatenation
C : Complement

D : Union

Q.no 45. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard

Q.no 46.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 47. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 48. 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

A : I and II
B : I and IV

C : II and III

D : II and IV

Q.no 49. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 50. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 51. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 52. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted


Q.no 53. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 54. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2
Q.no 55. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 56. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 57. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 58. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.

A:

B:

C:
D:

Q.no 59. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 60. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 1. RR* can be expressed in which of the forms:

A : R+

B : R-

C : R+ U R-

D:R

Q.no 2. In Parse Tree, Root represents


A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 3. Transition function of Turing Machine is

A:

B:

C:

D:

Q.no 4. To which of the following class does a CNF-satisfiability problem belong?

A : NP class

B : P class

C : NP complete

D : NP hard

Q.no 5.

A:

B:

C:0

D:1

Q.no 6. Why Palindromes cannot be recognized by any FSM ?

A : an FSM cannot deterministically fix the mid-point


B : an FSM can remember arbitrarily large amount of information

C : FSM has finite memory

D : FSM has only 5 tuples

Q.no 7. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop

D : push, pop and replace

Q.no 8. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject

D : start and accept

Q.no 9. Top-down parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 10. A Turing machine operates over

A : Finite memory tape

B : Infinite memory tape

C : Depends on the algorithm

D : Depends on the input

Q.no 11. If P, Q, R are three regular expressions and if P does not contain epsilon, then
the equation R = Q + RP has a unique solution given by
A : R = QP*

B : R = P*Q

C : R = RP

D : R = QP

Q.no 12. The major difference between Mealy and Moore machine is about:

A : Output Variations

B : Input Variations

C : Both

D : Transitions

Q.no 13. Which among the following are incorrect regular identities?

A:

B:

C:

D:

Q.no 14. Which of the following pair of regular expressions are not equivalent?

A : 1(01)* and (10)*1

B : x(xx)* and (xx)*x

C : (ab)* and a*b*

D : x+ and x*x+

Q.no 15. A boolean formula is said to be in Conjuctive Normal Form (CNF) if it can
represented as

A : e1 V e2 V e3

B : e1 Ʌ e2 V e3
C : e1 V e2 Ʌ e3

D : e1 Ʌ e2 Ʌ e3

Q.no 16. Which of the following is false for a grammar G in Chomsky Normal Form:

A : G has no useless symbols

B : G has no unit productions

C : G has no epsilon productions

D : G must have useless symbols

Q.no 17. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 18. PDA is more powerful than

A : Turing Machine

B : Finite Automata

C : Linear Bounded Automata

D : Non Deterministic Turing Machine

Q.no 19. Which of the following case does not exist in complexity theory?

A : Best case

B : Worst case

C : Average case

D : Null case

Q.no 20. Which of the production rule can be accepted by Chomsky grammar. (i) A->BC,
(ii) A->a

A : only i
B : only ii

C : both i and ii

D : neither i nor ii

Q.no 21. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 22.

A:

B:

C:

D:

Q.no 23. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which the total number of a’s is divisible by 2.

A : ((a+b)(a+b))*

B : (a + ab)*

C : ( b* a b*ab*)* + b*

D : a* b (aa)*b a*

Q.no 24. Which of the following is in 2-CNF?

A : (e1 Ʌ e2) Ʌ (e1 Ʌ ~e2)

B : (e1 Ʌ e2) Ʌ (e1 V ~e2)

C : (e1 V e2) Ʌ (e1 V ~e2)


D : (e1 V e2) Ʌ (e1 Ʌ ~e2)

Q.no 25. The power of non-deterministic pushdown automata and deterministic


pushdown automata is not same.

A : true

B : false

C : maybe

D : cannot say

Q.no 26. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 27. For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.

A : true

B : false

C : maybe

D : probably

Q.no 28. Which of the following statements is incorrect?

A : A Turing Machine cannot solve Halting problem

B : Set of recursively enumerated languages is closed under union

C : A FSM with 3 stacks is more powerful than FSM with 2 stacks

D : Context sensitive grammar can be recognized by a linearly bounded memory machine.

Q.no 29. Which of the following is a false statement?

A : Moore machine has no accepting states

B : Mealy machine has no accepting states


C : We can convert Mealy to Moore and vice versa

D : We can convert Mealy to Moore but not vice versa

Q.no 30. If r1 = (aa + bb) and r2 = (a + b) then the language (aa + bb)(a + b) will be
generated by

A : (r1)(r2)

B : (r1 + r2)

C : (r2)(r1)

D : (r1)

Q.no 31. Which of the following statement(s) are correct? (a) All languages can be
generated by CFG, (b) Any regular language has an equivalent CFG, (c) Some non
regular languages cannot be generated by CFG.

A : only (a)

B : Only (b)

C : Only (c)

D : Both (b) and (c)

Q.no 32. Limitation of PDA can be overcome by

A : Mealy machine

B : Moore machine

C : Turing machine

D : Finite state machine

Q.no 33. The problem of finding a path in a graph that visits every vertex exactly once
is called

A : Hamiltonian path problem

B : Hamiltonian cycle problem

C : Subset sum problem

D : Turnpike reconstruction problem

Q.no 34. The subset construction shows that every NFA accepts a ……..
A : String

B : Function

C : Regular language

D : Context-free language

Q.no 35. Construct a regular expression for the language that contains strings having
no pair of consecutive zeros over {0, 1}.

A : (1+0)*

B:

C : ((0+1)(0+1))*

D : (01 + 10)*

Q.no 36. Production Rule: aAb->agb belongs to which of the following category?

A : Regular Language

B : Context free Language

C : Context Sensitive Language

D : Recursively Ennumerable Language

Q.no 37. Which of the following pairs have DIFFERENT expressive power?

A : Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

B : Deterministic push down automata (DPDA) and Non-deterministic pushdown automata


(NPDA)

C : Deterministic single-tape Turing machine and Non-deterministic single-tape Turing


Machine

D : Single-tape Turing machine and multi-tape Turing machine

Q.no 38. Construct a regular expression for the language that contains strings that
start with either ‘01’ or ‘10’ over {0, 1}.

A : (01 + 10)*

B : (1+0)* (01 + 10) (1+0)*


C : (01 + 10) (1+0)*

D : (1+0)*

Q.no 39. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 40. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 41.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 42. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".
A:

B:

C:

D:

Q.no 43.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 44. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab
B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 45. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 46. 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

Q.no 47. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar
Q.no 48. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 49.

A:A

B:B

C:C

D:D

Q.no 50. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*
C : (0+010)*

D : (0+1)*

Q.no 51. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 52. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 53. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 54. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a
D : (a+b)(a+b)*

Q.no 55. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 56. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 57. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?

A:
B:

C:

D:

Q.no 58. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 59. Which of the following grammars are in Chomsky Normal Form:
A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 60. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 1. A DPDA is a PDA in which:

A : No state p has two outgoing transitions

B : More than one state can have two or more outgoing transitions

C : At least one state has more than one transitions

D : At most one state has more than one transitions

Q.no 2. In Mealy machine the output depends on

A : Only present state

B : Present state and present input

C : Nothing

D : Type of input
Q.no 3. Problems that can be solved in polynomial time are known as

A : intractable

B : tractable

C : decision

D : complete

Q.no 4. If T1 and T2 are two Turing machines, the composite can be represented using
the expression

A : T1 T2

B : T2 T1

C : T1 X T2

D : T2 X T1

Q.no 5. Which of the following can be used to simulate any Turing machine?

A : Finite State Automaton

B : Universal Turing Machine

C : Counter machines

D : Deterministic Finite Automata

Q.no 6. For alphabet = {a,b}, the regular expression r = (aa)*(bb)*b denotes

A : Set of strings with 2 a’s and 2 b’s

B : Set of strings with 2 a’s 2 b’s followed by b

C : Set of strings with 2 a’s followed by b’s which is a multiple of 3

D : Set of strings with even number of a’s followed by odd number of b’s

Q.no 7. Which among the following cannot be accepted by a regular grammar?

A : L is a set of numbers divisible by 2

B : L is a set of binary complement

C : L is a set of strings with odd number of 0s


D : L is a set of 0^n1^n

Q.no 8. The transition a Push down automaton makes is additionally dependent upon
the:

A : Current State

B : input tape

C : stack

D : terminals

Q.no 9. 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 : NP Complete

Q.no 10. How many states a Turing machine has?

A : Finite

B : Infinite

C : May be finite

D : One

Q.no 11. Given the expression, is there some assignment of true and false values to the
variables that will make the entire expression true? This is termed as

A : Satisfiability problem

B : Independent set problem

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 12. In CFG, notation of VARIABLE representation is

A : Captal Letters
B : Small Letters

C : Italic Letters

D : Roman Letters

Q.no 13. Those problems that are solvable in polynomial time belong to __

A : NP

B:P

C : Hard

D : Complete

Q.no 14. Finite state machine is ___________tuple machine.

A:4

B:5

C:6

D : unlimitted

Q.no 15. Given the language L = {ab, aa, baa}, which of the following strings are in L*? 1)
abaabaaabaa 2) aaaabaaaa
3) baaaaabaaaab 4) baaaaabaa

A : 1, 2 and 3

B : 2, 3 and 4

C : 1, 2 and 4

D : 1, 3 and 4

Q.no 16. Those problems that require large amount of computational resources that
are practically not feasible to solve, these problems are known as _________

A : Decidable

B : Undecidable

C : Tractable

D : Intractable
Q.no 17. Regular expression x + y denotes the set

A : {x,y}

B : {xy}

C : {x}

D : {y}

Q.no 18. A->aA| a| b


The number of steps to generate aab are

A:2

B:3

C:4

D:5

Q.no 19. A deterministic Turing machine is

A : Ambiguous Turing Machine

B : Unambiguous Turing Machine

C : Non-Deterministic Finite Automata

D : Deterministic Finite Automata

Q.no 20. Which of these does not belong to CFG?

A : Terminal Symbol

B : Non Terminal Symbol

C : Start symbol

D : End symbol

Q.no 21. The ability for a system of instructions to simulate a Turing Machine is called
_________

A : Turing Completeness

B : Simulation

C : Turing Halting
D : Computability

Q.no 22. For a give Moore Machine,


Statement 1: Null string is processed in Moore Machine.
Statement 2: There are more than 5-Tuples in the definition of Moore Machine.
Choose the correct option.

A : Statement 1 is true and Statement 2 is true

B : Statement 1 is true while Statement 2 is false

C : Statement 1 is false while Statement 2 is true

D : Statement 1 is false and Statement 2 is false

Q.no 23. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine

A : Only (a)

B : Only (b) and (c)

C : Only (a) and (c)

D : (a), (b) and (c)

Q.no 24. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which any occurrence of the symbol b, is in
groups of odd numbers.

A : (abbb)*

B : a* b (bb)* a*

C : ((a+b)(a+b)(a+b))*

D : a* b* (bb)* a*

Q.no 25. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2

Q.no 26. Which of the following pairs have different expressive power
A : Deterministic Finite Automata (DFA) and Non-deterministic Finite Automata (NFA)

B : Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down Automata
(NPDA)

C : single tape turing machine and multi tape turing machine

D : deterministic single tape and nondeterministic single tape turing machine

Q.no 27. PDA can be represented with the help of

A : Instantaneous description

B : input symbols

C : start state

D : final state

Q.no 28. PDA works as Finite Automata when the number of auxiliary memory it has is

A:3

B:2

C:1

D:0

Q.no 29. The set of all strings over alphabet = {a,b} in which all strings having bbbb as
substring is

A : (a+b)* bbbb (a+b)*

B : (a+b)* bb (a+b)*bb

C : bbb(a+b)*

D : bb (a+b)*

Q.no 30. Which of the following represents a language which has no pair of consecutive
1’s if alphabet = {0,1}?

A:
B:

C:

D:

Q.no 31. The variable which produces


epsilon is called

A : Empty variable

B : Nullable variable

C : Non-empty variable

D : Non-nullable variable

Q.no 32. According to Chomsky hierarchy, which of the following is recognized by


Recursively Enumerable language?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 33. Which of the following is a regular language?

A : String whose length is a sequence of prime numbers

B : String with substring wwr in between

C : Palindrome string

D : String with even number of Zeroes

Q.no 34. Which of the following is not a regular expression?

A : [(a+b)*(aa+bb)]*

B : [(0+1)-(0b+a1)*(a+]*
C : (01+11+10)*

D : (1+2+0)*(1+2)*

Q.no 35.

A:

B:

C:

D : {0, 1}

Q.no 36. Which of the following statement is correct?

A : All Regular grammars are context free but not vice versa

B : All context free grammars are regular grammars but not vice versa

C : Regular grammar and context free grammar are the same entity

D : All context sensitive grammar are regular grammar but not vice versa

Q.no 37. Construct a regular expression for the language that contains strings having
even number of 0’s followed by odd number of 1’s over {0, 1}.

A : (00)* 1 (11)*

B : ((0+1)(0+1))*

C : (0+1)*

D : (001)*

Q.no 38. 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

Q.no 39. Number of states required to accept strings ending with 10 are

A:3

B:2

C:1

D : can’t be represented.

Q.no 40. 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)

Q.no 41. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 42. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 43. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3
B:5

C:7

D:2

Q.no 44. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 45. 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 : (a . b) (a . b)

Q.no 46. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa
Q.no 47. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 48. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 49. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character


Q.no 50. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 51. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 52. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable
Q.no 53. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 54. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 55.

A : X is decidable
B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 56. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 57. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard

Q.no 58. 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

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 59. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 60. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 1. Turing machine was invented by

A : Alan Turing

B : Turing man

C : Turing taring

D : Turling Bake

Q.no 2. What is the value of n if Turing machine is defined using n-tuples?

A:6

B:7

C:8

D:5

Q.no 3. 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)*
A : The set of all strings containing the substring 00

B : The set of all strings containing at most two 0’s

C : The set of all strings containing at least two 0’s

D : The set of all strings that begin and end with either 0 or 1

Q.no 4. Turing machine is more powerful than (a) Finite automata, (b) Push down
automata

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Neither (a) nor (b)

Q.no 5. Which of the following does not belong to the language if input alphabet set is
a,b

A:a

B:b

C : epsilon

D:c

Q.no 6. Which operation can be applied on stack

A : Push

B : Pop

C : Push and Pop

D : Read

Q.no 7. In regular expressions, the operator ‘*’ stands for

A : Concatenation

B : Selection

C : Iteration

D : Addition
Q.no 8. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.

A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 9. Identify the problem: Given a graph G = <V, E>, and a starting node a, does it
have a tour cost less than k?

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 10. In Parse Tree, Root represents

A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 11. A language is regular if and only if

A : accepted by DFA

B : accepted by PDA

C : accepted by LBA

D : accepted by Turing machine

Q.no 12. In Parse Tree, Intermediate Node represents

A : Terminals

B : Variables

C : Start Symbol
D : Productions

Q.no 13. Finite automata needs minimum _______ number of stacks

A:0

B:1

C:2

D:3

Q.no 14. The Grammar can be defined as: G= (V, T, P, S) In the given definition, what
does S represents?

A : Accepting State

B : Starting Variable

C : Sensitive Grammar

D : Final state

Q.no 15. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 16.

A:

B:

C:L

D : L*

Q.no 17. _________ is the class of decision problems that can be solved by non-
deterministic polynomial algorithms?
A : NP

B:P

C : Hard

D : Complete

Q.no 18. The recognizing capability of NDFAand DFA

A : must be the same

B : may be different

C : must be different

D : cannot say

Q.no 19. Regular expressions are used to represent which language?

A : Recursive language

B : Context free language

C : Regular language

D : Context Sensitive language

Q.no 20. 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 the former depends only on the present input

D : output of the former depends on the present input and next state

Q.no 21. Which among the following is not true for 2-way infinte TM?

A : Tape in both directions

B : Leftmost square not distinguished

C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.

D : Tape is only in one direction.


Q.no 22. An Epsilon-NFA is ___________ in representation.

A : Quadruple

B : Quintuple

C : Triple

D : None of the mentioned

Q.no 23. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which the total number of a’s is divisible by 2.

A : ((a+b)(a+b))*

B : (a + ab)*

C : ( b* a b*ab*)* + b*

D : a* b (aa)*b a*

Q.no 24. A context free language is called ambiguous if (a) It has two or more leftmost
derivations for the same string. (b) It has two or more rightmost derivations for the
same string. (c) It has Only single derivation tree.

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 25. Which of the functions are not performed by the Turing machine after reading
a symbol?

A : Writes the symbol

B : Moves the tape one cell left/right

C : Proceeds with next instruction or halts

D : Push the input in stack

Q.no 26. Which of the regular expressions correspond to the given problem statement:
Express the identifiers in C Programming language where l=letters d=digits

A : (l+_)(d+_)*
B : (l+d+_)*

C : (l+_)(l+d+_)*

D : (_+d)(l+d+_)*

Q.no 27. The difference between Turing Machine and Two Way FA is in:

A : Input Tape

B : Read Write Head

C : Finite Control

D : All of these

Q.no 28. Language is accepted by PDA if it is

A : regular language

B : context free language

C : unrestricted

D : regular and context free

Q.no 29.

A : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the right
movement.

B : Perform the transition from q0 to q1 by changing "X" symbol to "a" and perform the right
movement.

C : Perform the transition from q0 to q1 by changing "a" symbol to "X" and perform the Left
movement.

D : Perform the transition from q0 to q1 by changing "q0" symbol to "q1" and perform the
right movement.

Q.no 30.
A:

B:

C:

D:

Q.no 31. Unrestricted grammar is also called_______ Grammar

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 32. A PDA machine configuration (p, w, y) can be correctly represented as

A : unprocessed input, stack content, current state

B : current state, unprocessed input, stack content

C : current state, stack content, unprocessed input

D : stack content, current state, unprocessed input

Q.no 33. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 34. Which productions will generate even length palindromes for terminals 'a'
and 'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb
D : S-> aSb|bSa|a|b

Q.no 35. The complexity class P consist of all the decision problems that can be solved
by ___________using polynomial amount of computation time.

A : Push Down automata

B : DFA

C : NDFA

D : Deterministic Turing machine

Q.no 36. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 37. X is a simple mathematical model of a computer. X has unrestricted and


unlimited memory. X is a FA with R/W head. X can have an infinite tape divided into
cells, each cell holding one symbol.
Name X?

A : Push Down Automata

B : Non deterministic Finite Automata

C : Turing machines

D : Deterministic Finite Automata

Q.no 38. Can a DFA recognize a palindrome number?

A : Yes

B : No

C : May be

D : Cannot be determined

Q.no 39. A grammar G=(V,T,P,S) in which V represents

A : Set of Nonterminals
B : Start symbol

C : Set of terminals

D : Production

Q.no 40. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input

C : current state and stack

D : current state

Q.no 41. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:

D:
Q.no 42. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 43. 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

Q.no 44. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 45. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab
B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 46. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 47. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 48. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 49. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*


D : (111*)* and (111+11*)*

Q.no 50. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 51. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 52. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 53. Construct a Turing machine which accepts a string with ‘aba’ as its substring.
A:

B:

C:
D:

Q.no 54. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 55.

A:A

B:B

C:C

D:D
Q.no 56. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 57. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 58. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 59. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar


Q.no 60. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 1. A push down automaton employs which data structure?

A : queue

B : linked list

C : hash table

D : stack

Q.no 2. A grammar that produces more than one parse tree for some sentence is called

A : ambiguous

B : unambiguous

C : regular

D : context free grammar

Q.no 3. Bottom-up parsing is also known as

A : shift reduce parsing

B : predictive descent parsing

C : operator precedence parsing

D : LL1 Parsing

Q.no 4. Pushdown automata accepts

A : regular language

B : context free language

C : context sensitive language

D : unrestricted language
Q.no 5. Number of states required to accept strings ending with 101

A:3

B:4

C:2

D : cannot be represented.

Q.no 6. Top-down parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 7. Every grammar in Chomsky Normal Form is:

A : regular

B : context sensitive

C : context free

D : Unrestricted

Q.no 8. For alphabet = {a,b}, the regular expression r = (aa)*(bb)*b denotes

A : Set of strings with 2 a’s and 2 b’s

B : Set of strings with 2 a’s 2 b’s followed by b

C : Set of strings with 2 a’s followed by b’s which is a multiple of 3

D : Set of strings with even number of a’s followed by odd number of b’s

Q.no 9. Halting problem is an example for

A : decidable problem

B : undecidable problem

C : complete problem

D : trackable problem
Q.no 10. NFA, in its name has Non-deterministic words because

A : The result is undetermined

B : The choice of path is non-deterministic

C : The state to be transited next is non-deterministic

D : More number of final states

Q.no 11. Can we convert PDA to equivalent CFG?

A : yes

B : no

C : maybe

D : never

Q.no 12. To simplify a grammar we can eliminate

A : Useful symbols

B : epsilon productions

C : Reachable symbols

D : Non Unit productions

Q.no 13. A two-way infinite tape Turing machine is ________ superior than the basic
model of the Turing machine in terms of power.

A : More

B : Less

C : No way

D : Very Much

Q.no 14. Which of the following statement is true? (a) Turing machine was developed
by Alan Turing, (b) PDA is less powerful than Turing machine, (c) FA is more powerful
than TM

A : Only (a)

B : Only (b)
C : Both (a) and (b)

D : Only (c)

Q.no 15. The format: A->aB refers to which of the following?

A : Chomsky Normal Form

B : Greibach Normal Form

C : Backus Naur Form

D : Sentential form

Q.no 16. A push down automata is different than finite automata by

A : Its memory

B : number of states

C : start state

D : input symbols

Q.no 17. Language of finite automata is generated by

A : Type 0 grammar

B : Type 1 grammar

C : Type 2 grammar

D : Type 3 grammar

Q.no 18. (a+b)* is equivalent to

A : b*a*

B : (a*b*)*

C : a*b*

D:

Q.no 19. Which among the following are incorrect regular identities?

A:
B:

C:

D:

Q.no 20. Choose the correct option for the statement: Unambiguity is the ideal
structure of a language.

A : true

B : Partially True

C : false

D : Cannot be said

Q.no 21. The RE that gives none or many instances of an x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 22. The minimum number of productions required to produce a language


consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6

Q.no 23. Which of the given problems are NP-complete?

A : (a) Traveling Salesman Problem

B : (b) Satisfiability Problem

C : Both (a) and (b)


D : Turing Machine

Q.no 24. The operations of PDA never work on elements other than top of the stack.

A : false

B : true

C : may be

D : cannot say

Q.no 25. Number of states required to accept strings ending with 10 are

A:3

B:2

C:1

D : can’t be represented.

Q.no 26. Which one of the following is FALSE?

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to an equivalent DFA.

C : Every Epsilon NFA can be converted to an equivalent DFA.

D : Every Mealy can be converted to an equivalent Moore machine.

Q.no 27. A non-deterministic pushdown automaton can be converted into an equivalent


deterministic pushdown automaton.

A : never

B : not always

C : always

D : maybe

Q.no 28. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?

A : X will always be a better choice for small inputs

B : X will always be a better choice for large inputs


C : Y will always be a better choice for small inputs

D : X will always be a better choice for all inputs

Q.no 29. Limitation of PDA can be overcome by

A : Mealy machine

B : Moore machine

C : Turing machine

D : Finite state machine

Q.no 30. The worst case complexity of a deterministic problem to find the satisfiability
of a given formula of n variables is

A : O(n)

B : O(n^2)

C : O(n^3)

D : O(2^n)

Q.no 31. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states

D : transition function

Q.no 32. Which of the following statement(s) are correct? (a) All languages can be
generated by CFG, (b) Any regular language has an equivalent CFG, (c) Some non
regular languages cannot be generated by CFG.

A : only (a)

B : Only (b)

C : Only (c)

D : Both (b) and (c)


Q.no 33.

A : {w | w is a string of odd length}

B : {w | w is a string of length multiple of 3}

C : {w | w is a string of length 3}

D : {w | w is an empty string}

Q.no 34. The automaton which allows transformation to a new state without consuming
any input symbols:

A : NFA

B : DFA

C : Epsilon NFA

D : PDA

Q.no 35. Which of the following statement is false?

A : Context free language is the subset of context sensitive language

B : Regular language is the subset of context sensitive language

C : Recursively ennumerable language is the super set of regular language

D : Context sensitive language is a subset of context free language

Q.no 36. Recursively enumerable languages are …….. , whereas recursive languages are
…....

A : completely-solvable, semi solvable

B : semi-solvable, completely solvable

C : not solvable, completely solvable

D : semi-solvable, not solvable

Q.no 37. Which of the following statement is false?

A : For non deterministic PDA, equivalence is undecidable.

B : For deterministic PDA, equivalence is decidable.


C : For deterministic PDA, equivalence is undecidable.

D : For non deterministic PDA, equivalence is decidable.

Q.no 38. Choose the incorrect statement.

A : Moore and Mealy machines are FSM with output capabilities

B : Any given Moore machine has an equivalent Mealy machine

C : Any given Mealy machine has an equivalent Moore machine

D : Moore machine is not an FSM

Q.no 39. Given grammar G:


(1)S->AS (2)S->AAS (3)A->SA (4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?

A : 2,4

B : 1,3

C : 1, 2, 3, 4

D : 2, 3, 4

Q.no 40. In given Transition function of TM


(q1,b)->(q2,Y,R)
Which one is the correct statement?

A : "q1" symbol is changed to "q2"

B : "b" symbol is changed to "q2"

C : "Y" symbol is changed to "b"

D : "b" symbol is changed to "Y"

Q.no 41. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*
Q.no 42. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 43. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 44. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 45. The language A-> tB|t generated by which of the following grammar?
A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 46. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable

Q.no 47. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 48. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 49. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 50. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 51. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA
Q.no 52.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 53. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol


Q.no 54. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 55. 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

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 56.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable


Q.no 57. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 58. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 59. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 60. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal


Q.no 1. Decidable can be taken as a synonym to:

A : Recursive

B : Non Recursive

C : Recognizable

D : Non Recognizable

Q.no 2. An algorithm is called efficient if it runs in ____________ time on a serial


computer.

A : Polynomial

B : Non polynomial

C : Logarithmic

D : Non Logarithmic

Q.no 3. The minimum number of states required to recognize an octal number divisible
by 3 is

A:1

B:3

C:5

D:7

Q.no 4. In one move the Turing machine___

A : May change its state

B : Write a symbol on the cell being scanned.

C : Move the head one position left or right

D : All of the above

Q.no 5. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?

A : moves

B : transition function

C : or symbol
D : not symbol

Q.no 6. A Turing machine operates over

A : Finite memory tape

B : Infinite memory tape

C : Depends on the algorithm

D : Depends on the input

Q.no 7. A problem which is both _______ and _________ is said to be NP complete.

A : P, NP

B : NP, NP hard

C : P, P complete

D : NP Hard,P

Q.no 8. In Mealy machine the output depends on

A : Only present state

B : Present state and present input

C : Nothing

D : Type of input

Q.no 9. Transition function of Turing Machine is

A:

B:

C:

D:

Q.no 10. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.
A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 11.

A:R

B:

C : R*

D:

Q.no 12. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 13. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 14. Which of the following pair of regular expressions are not equivalent?

A : 1(01)* and (10)*1

B : x(xx)* and (xx)*x


C : (ab)* and a*b*

D : x+ and x*x+

Q.no 15. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 16. In given Transition function of TM which head movement of tape is shown
(q0,a)->(q1,X,L)

A : Left Movement

B : Right Movement

C : Top Movement

D : Bottom Movement

Q.no 17. PDA accepts languages generated by which grammar

A : type 0

B : type 1

C : type 2

D : type 3

Q.no 18. Which of the following is true?

A : (01)*0 = 0(10)0*

B : (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*

C : (0+1)*01(0+1)*+1*0* = (0+1)*0

D : (01)*01 = 0(10)0*1

Q.no 19. Which of the following are the examples of finite state machine system? (a)
Control Mechanism of an elevator (b) Traffic Lights (c) Combinational Locks
A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 20. What is the Regular Expression Matching Zero or More Specific Characters

A:x

B:#

C:*

D:&

Q.no 21. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input

C : current state and stack

D : current state

Q.no 22. Every CFG can be transformed into equivalent NPDA.

A : false

B : true

C : may be

D : cannot say

Q.no 23. Which language is represented by the following grammar G:


G={{S},{0,1},P,S}
where elements of P are:
S --> SS
S--> 0S1
S--> 1S0
S--> Є

A : Regular language

B : Context-free language
C : Context-sensitive language

D : Recursively enumerable language

Q.no 24. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2

Q.no 25. Which productions will generate even length palindromes for terminals 'a'
and 'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 26. The instantaneous description is PDA shows

A : present state, string to be processed and stack symbol

B : present state and stack symbol

C : present state and string to be processed

D : stack symbol and string to be processed

Q.no 27. The total number of states and transitions required to form a Moore machine
that processes a binary input string and will produce residue mod 3.

A : 3 and 6

B : 3 and 5

C : 2 and 4

D : 2 and 5

Q.no 28. Which of the following is not an application of Finite Automaton?


A : Compiler Design

B : Grammar Parsers

C : Text Search

D : Image processing

Q.no 29. Identify the following problem: If G=(V, E) and V' is subset of V, then V' is an
independent set iff no two nodes in V' are connected by an edge in E.

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 30. Every grammar in Chomsky Normal Form is:

A : Regular

B : Context free

C : Context sensitive

D :  Unrestricted

Q.no 31. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 32. For a DFA accepting binary numbers whose decimal equivalent is divisible by
4, what are all the possible remainders?

A:0

B:2

C : 0,2,4
D : 0,1,2,3

Q.no 33. Turing machine (TM) is more powerful than FSM (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 : It has tape symbols

Q.no 34. Language is accepted by PDA if it is

A : regular language

B : context free language

C : unrestricted

D : regular and context free

Q.no 35. Which of the following statements is false?

A : For every non-deterministic Turing machine, there exists an equivalent deterministic


Turing machine.

B : Turing recognizable languages are closed under union and complement.

C : Turing decidable languages are closed under intersection


and complement.

D : Turing recognizable languages are closed under union and intersection.

Q.no 36. Given a Grammar G:


S->aA
A->a | A
B->B
The number of productions to be removed immediately as Unit productions are

A:0

B:1

C:2

D:3
Q.no 37. The shown language is recognized by (a) Turing machine, (b) Pushdown

automata, (c) Finite automata

A : Only (a)

B : Only (b)

C : Only (c)

D : Only (a) and (b)

Q.no 38. Which of the following is not a Non deterministic Turing machine?

A : Alternating Turing Machine

B : Probabalistic Turing Machine

C : Read-only Turing Machine

D : Unsolvable

Q.no 39. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 40. An NFA’s transition function returns

A : Boolean value

B : A state

C : A set of states

D : An edge

Q.no 41. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.
A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 42. 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 : (a . b) (a . b)

Q.no 43.

A:A

B:B

C:C

D:D

Q.no 44. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11
C : 12

D : 15

Q.no 45.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 46. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 47. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 48. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.
C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 49. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 50. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 51. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?

A:
B:

C:

D:

Q.no 52. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 53. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 54. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 55. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable
C : Computable

D : Recognizable

Q.no 56. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 57. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard

Q.no 58. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 59. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular


D : CFL < CSL < Regular < Unrestricted

Q.no 60. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:

D:

Q.no 1.

A:

B:

C:L

D : L*
Q.no 2. Finite automata needs minimum _______ number of stacks

A:0

B:1

C:2

D:3

Q.no 3. _________ is the class of decision problems that can be solved by non-
deterministic polynomial algorithms?

A : NP

B:P

C : Hard

D : Complete

Q.no 4. A language L is said to be ____________ if there is a turing machine M such that


L(M)=L and M halts at every point.

A : Turing acceptable

B : Decidable

C : Undecidable

D : NP-HARD

Q.no 5. The finite automata  is called NFA when there exists____________ for a specific
input from current state to next state

A : Single path

B : Multiple paths

C : Only two paths

D : Three paths

Q.no 6.

A:
B:

C:0

D:1

Q.no 7. Turing Machine also behaves like General purpose computer and that TM is
known as _______

A : Multi-tape Turing Machine

B : Poly-tape Turing Machine

C : Universal Turing Machine

D : Deterministic Finite Automata

Q.no 8. Which among the following is the format of unit production?

A : A->B

B : A->b

C : B->Aa

D : B->aA

Q.no 9.

A : L*

B:

C:L

D:

Q.no 10. A Turing machine with several tapes in known as

A : Multi-tape Turing machine

B : Poly-tape Turing maching

C : Universal Turing machine


D : Complete Turing machine

Q.no 11. The decision problem is the function from string to ______________

A : char

B :  int

C :  boolean

D : float

Q.no 12. Bottom-up parsers use

A : leftmost derivation

B : rightmost derivation

C : rightmost derivation in reverse order

D : leftmost derivation in reverse order

Q.no 13.

A : Always starts with b

B : Can have any number of ba and ab

C : Can not have 2 b's together.

D : Starts and end with same symbol

Q.no 14. To simplify a grammar we can eliminate

A : Useful symbols

B : epsilon productions

C : Reachable symbols

D : Non Unit productions

Q.no 15. A formal language is recursive if :

A : A turing machine exists

B : A turing machine that halts for every input


C : Turing machine rejects if the input does not belong to the language

D : All of the mentioned

Q.no 16. Given the language L = {ab, aa, baa}, which of the following strings are in L*? 1)
abaabaaabaa 2) aaaabaaaa
3) baaaaabaaaab 4) baaaaabaa

A : 1, 2 and 3

B : 2, 3 and 4

C : 1, 2 and 4

D : 1, 3 and 4

Q.no 17. Given the expression, is there some assignment of true and false values to the
variables that will make the entire expression true? This is termed as

A : Satisfiability problem

B : Independent set problem

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 18. Turing machine was invented by

A : Alan Turing

B : Turing man

C : Turing taring

D : Turling Bake

Q.no 19. Which of the following statement is true?

A : Mealy machine has no terminating state

B : A Moore machine has terminating state

C : Converting from Mealy into Moore machine and vice versa is not possible

D : More machine is Moore powerful than Mealy machine

Q.no 20. Top-down parsing is also known as


A : shift reduce parsing

B : predictive descent parsing

C : LR parsing

D : SLR parsing

Q.no 21. Which of the following automata takes stack as auxiliary storage

A : finite automata

B : pushdown automata

C : Turing machine

D : finite state machine

Q.no 22. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings without double a?

A:

B : ((a+b)(a+b))*

C : (a + bb)*

D:

Q.no 23. The power of non-deterministic pushdown automata and deterministic


pushdown automata is not same.

A : true

B : false

C : maybe

D : cannot say

Q.no 24. The automaton which allows transformation to a new state without consuming
any input symbols:

A : NFA
B : DFA

C : Epsilon NFA

D : PDA

Q.no 25. Which of the regular expressions correspond to the given problem statement:
Express the identifiers in C Programming language where l=letters d=digits

A : (l+_)(d+_)*

B : (l+d+_)*

C : (l+_)(l+d+_)*

D : (_+d)(l+d+_)*

Q.no 26. The complement of a language will only be defined when and only when the
__________ over the language is defined.

A : String

B : Word

C : Alphabet

D : Grammar

Q.no 27. The ability for a system of instructions to simulate a Turing Machine is called
_________

A : Turing Completeness

B : Simulation

C : Turing Halting

D : Computability

Q.no 28. 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)


Q.no 29. PDA works as Finite Automata when the number of auxiliary memory it has is

A:3

B:2

C:1

D:0

Q.no 30. The regular expression with all strings of 0′s and 1′s with at least two
consecutive 0′s is:

A : 1 + (10)*

B : (0+1)*00(0+1)*

C : (0+1)*011

D : 0*1*2*

Q.no 31. For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.

A : true

B : false

C : maybe

D : probably

Q.no 32. An instantaneous description of Turing machine consists of

A : Present state and input to be processed

B : Present state and entire input to be processed

C : Present input only

D : Present state only

Q.no 33. The maximum number of transitions which can be performed over a state in a
DFA having alphabet set a,b,c are

A:1

B:2

C:3
D:4

Q.no 34. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 35. Under which of the following operation, NFA is not closed?

A : Negation

B : Kleene

C : Concatenation

D : complement

Q.no 36. A non-deterministic pushdown automaton can be converted into an equivalent


deterministic pushdown automaton.

A : never

B : not always

C : always

D : maybe

Q.no 37. Unrestricted grammar is also called_______ Grammar

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 38. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2
C:3

D:0

Q.no 39. Which of the following statement is false?

A : Every language that is defined by regular expression can also be defined by finite
automata

B : Every language defined by finite automata can also be defined by regular expression

C : We can convert regular expressions into finite automata

D : There exists a unique DFA for every regular language

Q.no 40. Which of the following is analogous to the NFA and NPDA ?

A : Regular language and Context Free language

B : Regular language and Context Sensitive language

C : Context free language and Context Sensitive language

D : Unrestricted language

Q.no 41. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 42. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 43. Which grammar accepts the language of {a, b} having strings ending with 'a'.
A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 44. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 45. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 46. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal


Q.no 47. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 48. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 49. 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

Q.no 50. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable

Q.no 51. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 52. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD
D:DA

Q.no 53. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 54. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 55. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:
Q.no 56. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 57. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 58.

A : X is undecidable but partially decidable

B : X is decidable
C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 59. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 60. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 1. Linear Bounded Automaton is a

A : Finite Automaton

B : Turing Machine

C : Push down Automaton

D : Deterministic Finite Automata

Q.no 2. The format: A->aB refers to which of the following?

A : Chomsky Normal Form

B : Greibach Normal Form

C : Backus Naur Form

D : Sentential form

Q.no 3. Finite state machine is ___________tuple machine.

A:4
B:5

C:6

D : unlimitted

Q.no 4. What is the value of n if Turing machine is defined using n-tuples?

A:6

B:7

C:8

D:5

Q.no 5. NPDA stands for

A : non deterministic pushup automata

B : null pushdown automata

C : nested pushdown automata

D : non deterministic pushdown automata

Q.no 6. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 7. Which of the following is true?

A : Every subset of a regular set is regular

B : Every finite subset of non-regular set is regular

C : The union of two non regular set is not regular

D : Infinite union of finite set is regular

Q.no 8. A deterministic Turing machine is

A : Ambiguous Turing Machine


B : Unambiguous Turing Machine

C : Non-Deterministic Finite Automata

D : Deterministic Finite Automata

Q.no 9. RR* can be expressed in which of the forms:

A : R+

B : R-

C : R+ U R-

D:R

Q.no 10. Number of states required to accept strings ending with 101

A:3

B:4

C:2

D : cannot be represented.

Q.no 11. Minimal finite automata need _____________ no. of final states

A:1

B:2

C:3

D : Depends on problem

Q.no 12. Choose the correct option for the statement: Unambiguity is the ideal
structure of a language.

A : true

B : Partially True

C : false

D : Cannot be said

Q.no 13. A DPDA is a PDA in which:


A : No state p has two outgoing transitions

B : More than one state can have two or more outgoing transitions

C : At least one state has more than one transitions

D : At most one state has more than one transitions

Q.no 14. The regular expression to denote zero or more instances of x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 15. Regular expressions are used to represent which language?

A : Recursive language

B : Context free language

C : Regular language

D : Context Sensitive language

Q.no 16. Turing Machine can update symbols on its tape, whereas the FA cannot update
symbols on tape.

A : true

B : false

C : Cannot say

D : May be

Q.no 17. (a+b)* is equivalent to

A : b*a*

B : (a*b*)*

C : a*b*

D:
Q.no 18. Are the given two patterns equivalent?
(1) gray | grey (2) gr(a|e)y

A : yes

B : no

C : may be

D : cannot say

Q.no 19. In Mealy machine the output depends on

A : Only present state

B : Present state and present input

C : Nothing

D : Type of input

Q.no 20. In regular expressions, the operator ‘*’ stands for

A : Concatenation

B : Selection

C : Iteration

D : Addition

Q.no 21. Which of the following statement is not true?

A : Type 0 grammar is called unrestricted grammar

B : Chomsky hierarchy define only one type of grammar

C : Type 3 grammar is recognized by FA

D : Type 2 grammar is CFG

Q.no 22. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?

A : X will always be a better choice for small inputs

B : X will always be a better choice for large inputs

C : Y will always be a better choice for small inputs


D : X will always be a better choice for all inputs

Q.no 23. X is a simple mathematical model of a computer. X has unrestricted and


unlimited memory. X is a FA with R/W head. X can have an infinite tape divided into
cells, each cell holding one symbol.
Name X?

A : Push Down Automata

B : Non deterministic Finite Automata

C : Turing machines

D : Deterministic Finite Automata

Q.no 24. Which productions will generate odd length palindromes for terminals 'a' and
'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 25. How many strings of length less than 4 contain the language described by the
regular expression (x+y)*y(a+ab)*

A:7

B : 10

C : 12

D : 11

Q.no 26. Construct a regular expression for the language that contains strings that
start with either ‘01’ or ‘10’ over {0, 1}.

A : (01 + 10)*

B : (1+0)* (01 + 10) (1+0)*

C : (01 + 10) (1+0)*

D : (1+0)*

Q.no 27. Which of the following is not a regular expression?


A : [(a+b)*(aa+bb)]*

B : [(0+1)-(0b+a1)*(a+]*

C : (01+11+10)*

D : (1+2+0)*(1+2)*

Q.no 28. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states

D : transition function

Q.no 29. Which of the following pairs have different expressive power

A : Deterministic Finite Automata (DFA) and Non-deterministic Finite Automata (NFA)

B : Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down Automata
(NPDA)

C : single tape turing machine and multi tape turing machine

D : deterministic single tape and nondeterministic single tape turing machine

Q.no 30. PDA is useful in

A : lexical analysis

B : syntax analysis

C : semantic analysis

D : code generation

Q.no 31. The set of all strings over {a,b} in which strings consisting a’s and b’s and
ending with bb is

A : ab

B : a*bbb

C : (a+b)* bb

D : (a+b)+ bb
Q.no 32. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2

Q.no 33. Recursive languages are ………… of recursively enumerable languages.

A : subset

B : proper subset

C : not subset

D : not proper subset

Q.no 34. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 35. 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

Q.no 36.

A : {w | w is a string of odd length}


B : {w | w is a string of length multiple of 3}

C : {w | w is a string of length 3}

D : {w | w is an empty string}

Q.no 37. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 38. The minimum number of 1’s to be used in a regular expression of the given
language of all strings containing exactly 2 zeroes.

A:2

B:3

C:0

D:1

Q.no 39. According to Chomsky hierarchy, which of the following is recognized by


Recursively Enumerable language?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 40. The RE in which any number of 0′s is followed by any number of 1′s followed
by any number of 2′s is

A : (0+1+2)*

B : 0*1*2*

C : 0* + 1 + 2

D : (0+1)*2*
Q.no 41. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 42. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 43. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 44. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3
B:5

C:7

D:2

Q.no 45. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 46. 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

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 47. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:
C:

D:

Q.no 48. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.

A:

B:
C:

D:

Q.no 49. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 50. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*


Q.no 51. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 52.

A:A

B:B

C:C

D:D

Q.no 53. Consider the following statements.


I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?
A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 54. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 55. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 56. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 57. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 58. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:

B:
C:

D:

Q.no 59.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable

Q.no 60. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard
C : Q is NP-complete

D : Q is NP-hard

Q.no 1. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 2. Transition function of Turing Machine is

A:

B:

C:

D:

Q.no 3. Which of the following regular expressions represents the set of strings which
do not contain a substring ‘rt’ if alphabet = {r, t}

A : (rt)*

B : (tr)*

C : (r*t*)

D : (t*r*)

Q.no 4. A push down automata is different than finite automata by

A : Its memory

B : number of states

C : start state
D : input symbols

Q.no 5. To which of the following class does a CNF-satisfiability problem belong?

A : NP class

B : P class

C : NP complete

D : NP hard

Q.no 6. Kruskal's algorithm is used to find

A : whether there is cycle in the graph

B : spanning tree of the graph

C : minimum spanning tree in the graph

D : whether there is spanning tree in the graph

Q.no 7. Which of the following are not quantifiers?

A : Kleene plus +

B : Kleene star *

C : Question mark ?

D : Union

Q.no 8. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject

D : start and accept

Q.no 9. The major difference between Mealy and Moore machine is about:

A : Output Variations

B : Input Variations

C : Both
D : Transitions

Q.no 10.

A:

B:

C:0

D:1

Q.no 11. In given Transition function of TM which head movement of tape is shown
(q0,a)->(q1,X,L)

A : Left Movement

B : Right Movement

C : Top Movement

D : Bottom Movement

Q.no 12. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 13. If two finite state machines are equivalent,

A : they should have the same number of states

B : they should have the same number of edges

C : they should have the same number of states and edges

D : they can have different number of states and edges


Q.no 14.

A:R

B:

C : R*

D:

Q.no 15. For alphabet = {a,b}, the regular expression r = (aa)*(bb)*b denotes

A : Set of strings with 2 a’s and 2 b’s

B : Set of strings with 2 a’s 2 b’s followed by b

C : Set of strings with 2 a’s followed by b’s which is a multiple of 3

D : Set of strings with even number of a’s followed by odd number of b’s

Q.no 16. Bottom-up parsing is also known as

A : shift reduce parsing

B : predictive descent parsing

C : operator precedence parsing

D : LL1 Parsing

Q.no 17. An algorithm is called efficient if it runs in ____________ time on a serial


computer.

A : Polynomial

B : Non polynomial

C : Logarithmic

D : Non Logarithmic

Q.no 18. In CFG, notation of VARIABLE representation is

A : Captal Letters
B : Small Letters

C : Italic Letters

D : Roman Letters

Q.no 19. Which of the following a Turing machine does not consist of?

A : Input tape

B : Head

C : State register

D : Stack

Q.no 20. NFA, in its name has Non-deterministic words because

A : The result is undetermined

B : The choice of path is non-deterministic

C : The state to be transited next is non-deterministic

D : More number of final states

Q.no 21.

A:

B:

C:

D:

Q.no 22. Which among the following is the LEAF of the parse tree?

A : Production P

B : Nonterminal V

C : Terminal T

D : Starting symbol S
Q.no 23. Identify the following problem: If G=(V, E) and V' is subset of V, then V' is an
independent set iff no two nodes in V' are connected by an edge in E.

A : Satisfiability

B : Independent set

C : Node-Cover Problem

D : Traveling Salesman Problem

Q.no 24. The ability for a system of instructions to simulate a Turing Machine is called
_________

A : Turing Completeness

B : Simulation

C : Turing Halting

D : Computability

Q.no 25. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input

C : current state and stack

D : current state

Q.no 26. The complement of a language will only be defined when and only when the
__________ over the language is defined.

A : String

B : Word

C : Alphabet

D : Grammar

Q.no 27. For a give Moore Machine,


Statement 1: Null string is processed in Moore Machine.
Statement 2: There are more than 5-Tuples in the definition of Moore Machine.
Choose the correct option.

A : Statement 1 is true and Statement 2 is true


B : Statement 1 is true while Statement 2 is false

C : Statement 1 is false while Statement 2 is true

D : Statement 1 is false and Statement 2 is false

Q.no 28. The difference between number of states in FA for regular expression (a + b)
and (a + b) * is:

A:1

B:2

C:3

D:0

Q.no 29. Which of the following does not obey pumping lemma for context free
languages ?

A : Finite languages

B : Context free Languages

C : Unrestricted languages

D : Restricted languages

Q.no 30. An instantaneous description of Turing machine consists of

A : Present state and input to be processed

B : Present state and entire input to be processed

C : Present input only

D : Present state only

Q.no 31. The minimum number of productions required to produce a language


consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6
Q.no 32. Number of states required to accept strings ending with 10 are

A:3

B:2

C:1

D : can’t be represented.

Q.no 33. The difference between Turing Machine and Two Way FA is in:

A : Input Tape

B : Read Write Head

C : Finite Control

D : All of these

Q.no 34. The string (a)|((b)*(c)) is equivalent to

A : Empty

B : abcabc

C : b*c|a

D : abc

Q.no 35. Regular expression (x|y)(x|y) denotes the set

A : {xy,xy}

B : {xx,xy,yx,yy}

C : {x,y}

D : {x,y,xy}

Q.no 36. A context free language is called ambiguous if (a) It has two or more leftmost
derivations for the same string. (b) It has two or more rightmost derivations for the
same string. (c) It has Only single derivation tree.

A : Only (a)

B : Only (b)

C : Both (a) and (b)


D : Only (c)

Q.no 37. 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

Q.no 38. Which of the following is not a Non deterministic Turing machine?

A : Alternating Turing Machine

B : Probabalistic Turing Machine

C : Read-only Turing Machine

D : Unsolvable

Q.no 39. Which is a wrong satatement?

A : A regular language is produced by union of two regular languages

B : The concatenation of two regular languages is regular

C : The Kleene closure of a regular language is regular

D : The complement of a regular language is also a regular language

Q.no 40. In multi head Turing machine there are

A : More than one heads of the Turing machine

B : More than one input tapes of Turing machine

C : Similar to the basic model of Turing machine

D : More than one input symbols of Turing machine

Q.no 41. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted


C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 42. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 43. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 44. 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 : (a . b) (a . b)

Q.no 45. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 46. CFG is not closed under


A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 47. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 48. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 49. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 50. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3
C:4

D:5

Q.no 51. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 52. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 53. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 54. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*
B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 55. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 56. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 57. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 58. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar


D : Center Recursive Grammar

Q.no 59. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 60. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 1.

A : L*

B:

C:L

D:

Q.no 2. In Moore machine, if input is of length n, then length of output string will be

A:n
B : n+1

C : n+n

D : n-1

Q.no 3. Those problems that are solvable in polynomial time belong to __

A : NP

B:P

C : Hard

D : Complete

Q.no 4. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 5. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 6. A problem is called __________ if it has an efficient algorithm for itself.

A : Tractable

B : Intractable

C : Computational

D : Computable

Q.no 7. If T1 and T2 are two Turing machines, the composite can be represented using
the expression
A : T1 T2

B : T2 T1

C : T1 X T2

D : T2 X T1

Q.no 8. The transition a Push down automaton makes is additionally dependent upon
the:

A : Current State

B : input tape

C : stack

D : terminals

Q.no 9. Turing Machine also behaves like General purpose computer and that TM is
known as _______

A : Multi-tape Turing Machine

B : Poly-tape Turing Machine

C : Universal Turing Machine

D : Deterministic Finite Automata

Q.no 10. Which of the following can be used to simulate any Turing machine?

A : Finite State Automaton

B : Universal Turing Machine

C : Counter machines

D : Deterministic Finite Automata

Q.no 11.

A:

B:
C:L

D : L*

Q.no 12. Which of the following are the actions that operates on stack top?

A : only push

B : only pop

C : only push and pop

D : push, pop and replace

Q.no 13. A->aA| a| b


The number of steps to generate aab are

A:2

B:3

C:4

D:5

Q.no 14. Top-down parsers use the grammar

A : LL(K)

B : LR(K)

C : SLR(K)

D : CLR(K)

Q.no 15. Which operation can be applied on stack

A : Push

B : Pop

C : Push and Pop

D : Read

Q.no 16. In Moore machine the output depends on

A : Only present state


B : Present state and present input

C : Nothing

D : Type of input

Q.no 17. The regular expression to denote zero or more instances of x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 18. Consider following regular expression


i) (a|b)* ii) (a*|b*)* iii) ((a)*b*)* Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : all are equal

Q.no 19. Precedence of regular expression in decreasing order is

A:*,.,+

B:.,*,+

C:.,+,*

D:+,.,*

Q.no 20. In Parse Tree, Root represents

A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 21. Which of the following statement is false?


A : Context free language is the subset of context sensitive language

B : Regular language is the subset of context sensitive language

C : Recursively ennumerable language is the super set of regular language

D : Context sensitive language is a subset of context free language

Q.no 22. Choose the incorrect statement.

A : Moore and Mealy machines are FSM with output capabilities

B : Any given Moore machine has an equivalent Mealy machine

C : Any given Mealy machine has an equivalent Moore machine

D : Moore machine is not an FSM

Q.no 23. 3-SAT and 2-SAT problems are

A : NP-complete and in P respectively

B : Undecidable and NP-complete

C : Both NP-complete

D : Both in P

Q.no 24. Which of the following automata takes stack as auxiliary storage

A : finite automata

B : pushdown automata

C : Turing machine

D : finite state machine

Q.no 25. The total number of states and transitions required to form a Moore machine
that processes a binary input string and will produce residue mod 3.

A : 3 and 6

B : 3 and 5

C : 2 and 4

D : 2 and 5
Q.no 26. Which among the following is equivalent to the given regular expression 01*+1

A : (01)*+1

B : 0((1)*+1)

C : (0(1)*)+1

D : ((0*1)1*)*

Q.no 27. If r1 = (aa + bb) and r2 = (a + b) then the language (aa + bb)(a + b) will be
generated by

A : (r1)(r2)

B : (r1 + r2)

C : (r2)(r1)

D : (r1)

Q.no 28. The instantaneous description is PDA shows

A : present state, string to be processed and stack symbol

B : present state and stack symbol

C : present state and string to be processed

D : stack symbol and string to be processed

Q.no 29. Recursively enumerable languages are …….. , whereas recursive languages are
…....

A : completely-solvable, semi solvable

B : semi-solvable, completely solvable

C : not solvable, completely solvable

D : semi-solvable, not solvable

Q.no 30. Which of the following statement(s) are correct? (a) All languages can be
generated by CFG, (b) Any regular language has an equivalent CFG, (c) Some non
regular languages cannot be generated by CFG.

A : only (a)

B : Only (b)
C : Only (c)

D : Both (b) and (c)

Q.no 31. X is a simple mathematical model of a computer. X has unrestricted and


unlimited memory. X is a FA with R/W head. X can have an infinite tape divided into
cells, each cell holding one symbol.
Name X?

A : Push Down Automata

B : Non deterministic Finite Automata

C : Turing machines

D : Deterministic Finite Automata

Q.no 32. Construct a regular expression for the language that contains strings having
even number of 0’s followed by odd number of 1’s over {0, 1}.

A : (00)* 1 (11)*

B : ((0+1)(0+1))*

C : (0+1)*

D : (001)*

Q.no 33. Which one of the following is FALSE?

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to an equivalent DFA.

C : Every Epsilon NFA can be converted to an equivalent DFA.

D : Every Mealy can be converted to an equivalent Moore machine.

Q.no 34. Which of the following pairs have DIFFERENT expressive power?

A : Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

B : Deterministic push down automata (DPDA) and Non-deterministic pushdown automata


(NPDA)

C : Deterministic single-tape Turing machine and Non-deterministic single-tape Turing


Machine

D : Single-tape Turing machine and multi-tape Turing machine


Q.no 35. The RE that gives none or many instances of an x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 36. Which of the following is in 2-CNF?

A : (e1 Ʌ e2) Ʌ (e1 Ʌ ~e2)

B : (e1 Ʌ e2) Ʌ (e1 V ~e2)

C : (e1 V e2) Ʌ (e1 V ~e2)

D : (e1 V e2) Ʌ (e1 Ʌ ~e2)

Q.no 37. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 38. The travelling salesman problem can be solved using _________

A : A spanning tree

B : A minimum spanning tree

C : Bellman – Ford algorithm

D : DFS traversal

Q.no 39. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states

D : transition function
Q.no 40. A grammar G=(V,T,P,S) in which V represents

A : Set of Nonterminals

B : Start symbol

C : Set of terminals

D : Production

Q.no 41. Which of the following grammars are in Chomsky Normal Form:

A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 42. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?

A:
B:

C:

D:

Q.no 43. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 44. 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

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 45. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 46. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard
Q.no 47. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 48. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable

Q.no 49. Which one of following is false.


A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 50. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar

D : Phrase grammar

Q.no 51. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:

B:
C:

D:

Q.no 52. 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

Q.no 53. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 54. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 55.

A:A

B:B

C:C

D:D
Q.no 56. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 57. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 58.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable


Q.no 59. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 60. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 1. Which of the following does not belong to the language if input alphabet set is
a,b

A:a

B:b

C : epsilon

D:c

Q.no 2. In regular expressions, the operator ‘*’ stands for


A : Concatenation

B : Selection

C : Iteration

D : Addition

Q.no 3. Which of the following are the examples of finite state machine system? (a)
Control Mechanism of an elevator (b) Traffic Lights (c) Combinational Locks

A : Only (a)

B : Only (b)

C : Only (c)

D : (a), (b) and (c)

Q.no 4. Turing machine is more powerful than (a) Finite automata, (b) Push down
automata

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Neither (a) nor (b)

Q.no 5. _________ is the class of decision problems that can be solved by non-
deterministic polynomial algorithms?

A : NP

B:P

C : Hard

D : Complete

Q.no 6. Identify the problem: Given a graph G = <V, E>, and a starting node a, does it
have a tour cost less than k?

A : Satisfiability

B : Independent set

C : Node-Cover Problem
D : Traveling Salesman Problem

Q.no 7. Epsilon-closure of a state is a combination of self state and ----

A : Epsilon-reachable states

B : initial state

C : Final state

D : Non-final states

Q.no 8. Universal TM influenced the concept of

A : Stored program computers

B : Interpretive implementation of programming languages

C : Computability

D : All of these

Q.no 9. Which among the following cannot be accepted by a regular grammar?

A : L is a set of numbers divisible by 2

B : L is a set of binary complement

C : L is a set of strings with odd number of 0s

D : L is a set of 0^n1^n

Q.no 10. Choose the correct option for the statement: Unambiguity is the ideal
structure of a language.

A : true

B : Partially True

C : false

D : Cannot be said

Q.no 11. Language of finite automata is generated by

A : Type 0 grammar

B : Type 1 grammar
C : Type 2 grammar

D : Type 3 grammar

Q.no 12. Finite state machine can recognize

A : any grammar

B : only context-free grammar

C : context free grammar and regualr grammar

D : only regular grammar

Q.no 13. Which of the production rule can be accepted by Chomsky grammar. (i) A->BC,
(ii) A->a

A : only i

B : only ii

C : both i and ii

D : neither i nor ii

Q.no 14. There is a linear grammar that generates a context free grammar

A : Always

B : Never

C : Sometimes

D : Everytime

Q.no 15. Are the given two patterns equivalent?


(1) gray | grey (2) gr(a|e)y

A : yes

B : no

C : may be

D : cannot say

Q.no 16. A push down automaton employs which data structure?

A : queue
B : linked list

C : hash table

D : stack

Q.no 17. Construct a regular expression for the language that contains strings having at
least one pair of consecutive zeros over {0, 1}.

A : (100)*

B : 1* (00)* 1*

C : [ (1 + 0 )* (00) (1 + 0 )*] +

D : ((0+1)(0+1))*

Q.no 18. If the PDA does not stop on an accepting state and the stack is not empty, the
string is

A : rejected

B : goes into loop forever

C : rejected and goes into loop forever

D : accepted

Q.no 19. The recognizing capability of NDFAand DFA

A : must be the same

B : may be different

C : must be different

D : cannot say

Q.no 20. Transition function of DFA machine maps.

A:

B:

C:

D:
Q.no 21. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine

A : Only (a)

B : Only (b) and (c)

C : Only (a) and (c)

D : (a), (b) and (c)

Q.no 22. The RE in which any number of 0′s is followed by any number of 1′s followed
by any number of 2′s is

A : (0+1+2)*

B : 0*1*2*

C : 0* + 1 + 2

D : (0+1)*2*

Q.no 23. The minimum number of 1’s to be used in a regular expression of the given
language of all strings containing exactly 2 zeroes.

A:2

B:3

C:0

D:1

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

Q.no 25. Which of the following is not an application of Finite Automaton?

A : Compiler Design

B : Grammar Parsers
C : Text Search

D : Image processing

Q.no 26. Which of the following is the restricted model of Turing machines (a) Turing
machine with semi-infinite tape, (b) Multi stack machine, (c) Offline Turing machine

A : Only (a)

B : Only (b)

C : Only (c)

D : Both (a) and (b)

Q.no 27. The problem of finding a path in a graph that visits every vertex exactly once
is called

A : Hamiltonian path problem

B : Hamiltonian cycle problem

C : Subset sum problem

D : Turnpike reconstruction problem

Q.no 28. In given Transition function of TM


(q1,b)->(q2,Y,R)
Which one is the correct statement?

A : "q1" symbol is changed to "q2"

B : "b" symbol is changed to "q2"

C : "Y" symbol is changed to "b"

D : "b" symbol is changed to "Y"

Q.no 29. Let the class of language accepted by finite state machine be L1 and the class
of languages represented by regular expressions be L2 then

A : L1<L2

B : L1>=L2

C : L1!=L2

D : L1=L2
Q.no 30. 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)

Q.no 31. The basic limitation of finite automata is that

A : It cannot remember arbitrary large amount of information.

B : It sometimes recognize grammar that are not regular.

C : It sometimes fails to recognize regular grammar.

D : It sometimes fails to recognize regular laguage

Q.no 32. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which the total number of a’s is divisible by 2.

A : ((a+b)(a+b))*

B : (a + ab)*

C : ( b* a b*ab*)* + b*

D : a* b (aa)*b a*

Q.no 33. For a DFA accepting binary numbers whose decimal equivalent is divisible by
4, what are all the possible remainders?

A:0

B:2

C : 0,2,4

D : 0,1,2,3

Q.no 34. Given grammar G:


(1)S->AS (2)S->AAS (3)A->SA (4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?

A : 2,4
B : 1,3

C : 1, 2, 3, 4

D : 2, 3, 4

Q.no 35. The variable which produces


epsilon is called

A : Empty variable

B : Nullable variable

C : Non-empty variable

D : Non-nullable variable

Q.no 36. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 37. Which of the following does not obey pumping lemma for context free
languages ?

A : Finite languages

B : Context free Languages

C : Unrestricted languages

D : Restricted languages

Q.no 38. Is the language preserved in all the steps while eliminating epsilon transitions
from a NFA?

A : yes

B : no

C : may be

D : cannot say
Q.no 39. The minimum number of productions required to produce a language
consisting of palindrome strings over T={a,b} is

A:3

B:7

C:5

D:6

Q.no 40. PDA is useful in

A : lexical analysis

B : syntax analysis

C : semantic analysis

D : code generation

Q.no 41.

A : X is undecidable but partially decidable

B : X is decidable

C : X is not a decision problem

D : X is undecidable and not even partially decidable.

Q.no 42. The minimum number of productions required to produce a language


consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2
Q.no 43. Which of the following is NOT generated by regular expression
R = (ab + abb)* bbab

A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 44. Which Transition table of Turing Machine is correct for the following problem
"Design a TM to find 2's complement of a binary number".

A:

B:

C:

D:

Q.no 45. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not


B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 46. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 47. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 48. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 49. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure

A : Only (a)

B : Only (b)
C : Only (c)

D : (a), (b) and (c)

Q.no 50. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 51.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem

Q.no 52. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is

A : (0+1)

B : (0+1)*
C:

D : (0+1)* 011

Q.no 53. 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 : (a . b) (a . b)

Q.no 54. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 55. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 56. The context free grammar


S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s


D : 0's followed by 1's

Q.no 57. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 58. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 59. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:

A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 60. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 1. Can we convert PDA to equivalent CFG?

A : yes
B : no

C : maybe

D : never

Q.no 2. A grammar that produces more than one parse tree for some sentence is called

A : ambiguous

B : unambiguous

C : regular

D : context free grammar

Q.no 3. In one move the Turing machine___

A : May change its state

B : Write a symbol on the cell being scanned.

C : Move the head one position left or right

D : All of the above

Q.no 4. Halting problem is an example for

A : decidable problem

B : undecidable problem

C : complete problem

D : trackable problem

Q.no 5. 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 : NP Complete
Q.no 6.

A : Always starts with b

B : Can have any number of ba and ab

C : Can not have 2 b's together.

D : Starts and end with same symbol

Q.no 7. A language L is said to be ____________ if there is a turing machine M such that


L(M)=L and M halts at every point.

A : Turing acceptable

B : Decidable

C : Undecidable

D : NP-HARD

Q.no 8. Which of the following case does not exist in complexity theory?

A : Best case

B : Worst case

C : Average case

D : Null case

Q.no 9. In Parse Tree, Intermediate Node represents

A : Terminals

B : Variables

C : Start Symbol

D : Productions

Q.no 10. Why Palindromes cannot be recognized by any FSM ?

A : an FSM cannot deterministically fix the mid-point

B : an FSM can remember arbitrarily large amount of information


C : FSM has finite memory

D : FSM has only 5 tuples

Q.no 11. Number of states required to accept strings ending with 101

A:3

B:4

C:2

D : cannot be represented.

Q.no 12. Turing machine was invented by

A : Alan Turing

B : Turing man

C : Turing taring

D : Turling Bake

Q.no 13. 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)*

A : The set of all strings containing the substring 00

B : The set of all strings containing at most two 0’s

C : The set of all strings containing at least two 0’s

D : The set of all strings that begin and end with either 0 or 1

Q.no 14. Which of the following is false for a grammar G in Chomsky Normal Form:

A : G has no useless symbols

B : G has no unit productions

C : G has no epsilon productions

D : G must have useless symbols

Q.no 15. Which of the following is not a part of 5-tuple finite automata?

A : Input alphabet
B : Transition function

C : Initial State

D : Output alphabet

Q.no 16. PDA accepts languages generated by which grammar

A : type 0

B : type 1

C : type 2

D : type 3

Q.no 17. A language is regular if and only if

A : accepted by DFA

B : accepted by PDA

C : accepted by LBA

D : accepted by Turing machine

Q.no 18. Which of the following are not quantifiers?

A : Kleene plus +

B : Kleene star *

C : Question mark ?

D : Union

Q.no 19. Recursive languages are also known as:

A : decidable

B : Undecidable

C : sometimes decidable

D : infinite

Q.no 20. Which among the following are incorrect regular identities?
A:

B:

C:

D:

Q.no 21. Which of the following is not a regular expression?

A : [(a+b)*(aa+bb)]*

B : [(0+1)-(0b+a1)*(a+]*

C : (01+11+10)*

D : (1+2+0)*(1+2)*

Q.no 22. Which of the following is a false statement?

A : Moore machine has no accepting states

B : Mealy machine has no accepting states

C : We can convert Mealy to Moore and vice versa

D : We can convert Mealy to Moore but not vice versa

Q.no 23. Which of the following statement is not true?

A : Type 0 grammar is called unrestricted grammar

B : Chomsky hierarchy define only one type of grammar

C : Type 3 grammar is recognized by FA

D : Type 2 grammar is CFG

Q.no 24. Which among the following is not true for 2-way infinte TM?

A : Tape in both directions

B : Leftmost square not distinguished


C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.

D : Tape is only in one direction.

Q.no 25. The maximum number of transitions which can be performed over a state in a
DFA having alphabet set a,b,c are

A:1

B:2

C:3

D:4

Q.no 26. An instantaneous description of Turing machine consists of

A : Present state and input to be processed

B : Present state and entire input to be processed

C : Present input only

D : Present state only

Q.no 27. It is less complex to prove the closure properties over regular languages using

A : NFA

B : DFA

C : PDA

D : Canot be said

Q.no 28. Production Rule: aAb->agb belongs to which of the following category?

A : Regular Language

B : Context free Language

C : Context Sensitive Language

D : Recursively Ennumerable Language

Q.no 29. If r1 = (aa + bb) and r2 = (a + b) then the language (aa + bb)(a + b) will be
generated by
A : (r1)(r2)

B : (r1 + r2)

C : (r2)(r1)

D : (r1)

Q.no 30. For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.

A : true

B : false

C : maybe

D : probably

Q.no 31. Given a Grammar G:


S->aA
A->a | A
B->B
The number of productions to be removed immediately as Unit productions are

A:0

B:1

C:2

D:3

Q.no 32. The subset construction shows that every NFA accepts a ……..

A : String

B : Function

C : Regular language

D : Context-free language

Q.no 33. Which of the following is true for the language?

A : It is not accepted by a Turing Machine

B : It is regular but not context-free


C : It is context-free but not regular

D : It is neither regular nor context-free, but accepted by a Turing machine

Q.no 34.

A:

B:

C:

D:

Q.no 35. Which productions will generate even length palindromes for terminals 'a'
and 'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 36. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which any occurrence of the symbol b, is in
groups of odd numbers.

A : (abbb)*

B : a* b (bb)* a*

C : ((a+b)(a+b)(a+b))*

D : a* b* (bb)* a*

Q.no 37. The shown language is recognized by (a) Turing machine, (b) Pushdown

automata, (c) Finite automata

A : Only (a)

B : Only (b)
C : Only (c)

D : Only (a) and (b)

Q.no 38. Which of the regular expressions correspond to the given problem statement:
Express the identifiers in C Programming language where l=letters d=digits

A : (l+_)(d+_)*

B : (l+d+_)*

C : (l+_)(l+d+_)*

D : (_+d)(l+d+_)*

Q.no 39. PDA can be represented with the help of

A : Instantaneous description

B : input symbols

C : start state

D : final state

Q.no 40. Which of the following is a regular language?

A : String whose length is a sequence of prime numbers

B : String with substring wwr in between

C : Palindrome string

D : String with even number of Zeroes

Q.no 41. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 42. CFG is not closed under

A : Kleene closure

B : Concatenation

C : Complement

D : Union

Q.no 43. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 44.
A:A

B:B

C:C

D:D

Q.no 45. Examine the following DFA: If input is 011100101, which edge is NOT

traversed?

A:AB

B:BD

C:CD

D:DA

Q.no 46. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

Q.no 47. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard
Q.no 48. Consider the following statements.
I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?

A : Only II

B : Only III

C : Only I and II

D : Only I and III

Q.no 49. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 50. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 51. Transition function of NFA machine is given by

A:

B:
C:

D:

Q.no 52. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 53. What does the following transition graph shows

A : Copies a symbol

B : Reverses a string

C : Accepts a palindrome

D : Push the symbol

Q.no 54. If all the production rules have single nonterminal symbol on the left side
then grammar is called as

A : Context free grammar

B : Context sensitive grammar

C : Unrestricted grammar
D : Phrase grammar

Q.no 55. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 56. Which of the following statement is false.

A : There exist context-free languages such that all context free grammars generating them
are ambiguous.

B : An unambiguous context free grammar always has a unique parse tree for each string of
the language generated by it.

C : Both deterministic and non deterministic PDA always accet same set of languages.

D : Finite set of strings from one alphabet is always a regular language.

Q.no 57. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 58. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3
D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 59. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 60. The following Turing machine acts like

A : Copies a string

B : Delete a symbol

C : Insert a symbol

D : Push the symbol

Q.no 1. Those problems that are solvable in polynomial time belong to __

A : NP

B:P
C : Hard

D : Complete

Q.no 2. What is the Regular Expression Matching Zero or More Specific Characters

A:x

B:#

C:*

D:&

Q.no 3. The minimum number of states required to recognize an octal number divisible
by 3 is

A:1

B:3

C:5

D:7

Q.no 4. Bottom-up parsing is also known as

A : shift reduce parsing

B : predictive descent parsing

C : operator precedence parsing

D : LL1 Parsing

Q.no 5. In CFG, notation of VARIABLE representation is

A : Captal Letters

B : Small Letters

C : Italic Letters

D : Roman Letters

Q.no 6. A push down automaton employs which data structure?

A : queue
B : linked list

C : hash table

D : stack

Q.no 7.

A:

B:

C:L

D : L*

Q.no 8. Which of the following pair of regular expressions are not equivalent?

A : 1(01)* and (10)*1

B : x(xx)* and (xx)*x

C : (ab)* and a*b*

D : x+ and x*x+

Q.no 9. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?

A : moves

B : transition function

C : or symbol

D : not symbol

Q.no 10. 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 the former depends only on the present input

D : output of the former depends on the present input and next state


Q.no 11. A Language for which no DFA exist is a________

A : Regular Language

B : Non-Regular Language

C : May be Regular

D : Cannot be said

Q.no 12. Which of the following does not belong to the language if input alphabet set is
a,b

A:a

B:b

C : epsilon

D:c

Q.no 13. To which of the following class does a CNF-satisfiability problem belong?

A : NP class

B : P class

C : NP complete

D : NP hard

Q.no 14. The format: A->aB refers to which of the following?

A : Chomsky Normal Form

B : Greibach Normal Form

C : Backus Naur Form

D : Sentential form

Q.no 15. Which of the following is true?

A : (01)*0 = 0(10)0*

B : (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*

C : (0+1)*01(0+1)*+1*0* = (0+1)*0
D : (01)*01 = 0(10)0*1

Q.no 16. A formal language is recursive if :

A : A turing machine exists

B : A turing machine that halts for every input

C : Turing machine rejects if the input does not belong to the language

D : All of the mentioned

Q.no 17. RR* can be expressed in which of the forms:

A : R+

B : R-

C : R+ U R-

D:R

Q.no 18. PDA is more powerful than

A : Turing Machine

B : Finite Automata

C : Linear Bounded Automata

D : Non Deterministic Turing Machine

Q.no 19. Minimal finite automata need _____________ no. of final states

A:1

B:2

C:3

D : Depends on problem

Q.no 20. In regular expressions, the operator ‘*’ stands for

A : Concatenation

B : Selection

C : Iteration
D : Addition

Q.no 21. Every grammar in Chomsky Normal Form is:

A : Regular

B : Context free

C : Context sensitive

D :  Unrestricted

Q.no 22. The operations of PDA never work on elements other than top of the stack.

A : false

B : true

C : may be

D : cannot say

Q.no 23. A PDA chooses the next move based on

A : current State and input

B : current state, stack and input

C : current state and stack

D : current state

Q.no 24. In definition of PDA M=(Q, Σ,Γ, q0,Z0,A,δ) what Γ represents

A : initial stack symbol

B : stack alphabet

C : finite set of states

D : transition function

Q.no 25. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings without double a?

A:
B : ((a+b)(a+b))*

C : (a + bb)*

D:

Q.no 26. Number of external states of a UTM should be atleast

A:1

B:2

C:3

D:4

Q.no 27. Which of the following statement is correct?

A : All Regular grammars are context free but not vice versa

B : All context free grammars are regular grammars but not vice versa

C : Regular grammar and context free grammar are the same entity

D : All context sensitive grammar are regular grammar but not vice versa

Q.no 28. X is a simple mathematical model of a computer. X has unrestricted and


unlimited memory. X is a FA with R/W head. X can have an infinite tape divided into
cells, each cell holding one symbol.
Name X?

A : Push Down Automata

B : Non deterministic Finite Automata

C : Turing machines

D : Deterministic Finite Automata

Q.no 29. The complement of a language will only be defined when and only when the
__________ over the language is defined.

A : String

B : Word

C : Alphabet
D : Grammar

Q.no 30. Which one of the following is FALSE?

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to an equivalent DFA.

C : Every Epsilon NFA can be converted to an equivalent DFA.

D : Every Mealy can be converted to an equivalent Moore machine.

Q.no 31. An NFA’s transition function returns

A : Boolean value

B : A state

C : A set of states

D : An edge

Q.no 32. Which of the following statement is false?

A : For non deterministic PDA, equivalence is undecidable.

B : For deterministic PDA, equivalence is decidable.

C : For deterministic PDA, equivalence is undecidable.

D : For non deterministic PDA, equivalence is decidable.

Q.no 33. 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)

Q.no 34. Language is accepted by PDA if it is

A : regular language

B : context free language


C : unrestricted

D : regular and context free

Q.no 35. 3-SAT and 2-SAT problems are

A : NP-complete and in P respectively

B : Undecidable and NP-complete

C : Both NP-complete

D : Both in P

Q.no 36. Which productions will generate odd length palindromes for terminals 'a' and
'b' ?

A : S-> aSa|bSb|a|b

B : S-> aSa|bSb|aa|bb

C : S-> aSa|bSb

D : S-> aSb|bSa|a|b

Q.no 37. Which is a wrong satatement?

A : A regular language is produced by union of two regular languages

B : The concatenation of two regular languages is regular

C : The Kleene closure of a regular language is regular

D : The complement of a regular language is also a regular language

Q.no 38. Number of states required to accept strings ending with 10 are

A:3

B:2

C:1

D : can’t be represented.

Q.no 39. Complement of a DFA can be obtained by

A : making starting state as final state.


B : no trival method.

C : making final states non-final and non-final to final.

D : make final as a starting state.

Q.no 40. Which language is represented by the following grammar G:


G={{S},{0,1},P,S}
where elements of P are:
S --> SS
S--> 0S1
S--> 1S0
S--> Є

A : Regular language

B : Context-free language

C : Context-sensitive language

D : Recursively enumerable language

Q.no 41. John is asked to make an automaton which accepts a given string for all the
occurrence of ‘1001’ in it. How many number of transitions would John use such that,
the string processing application works?

A : 10

B : 11

C : 12

D : 15

Q.no 42.

A : Decidable and Recursively Enumerable

B : Undecidable but Recursively Enumerable

C : Undecidable and Not Recursively Enumerable

D : Decidable but not Recursively Enumerable


Q.no 43. The minimum number of productions required to produce a language
consisting of palindrome strings (even and odd length) over T={a,b} is

A:3

B:5

C:7

D:2

Q.no 44. Which of the following is correct for Chomsky hierarchy?

A : CSL < Unrestricted < CF < Regular

B : Regular < CFL < CSL < Unrestricted

C : CFL < CSL < Unrestricted < Regular

D : CFL < CSL < Regular < Unrestricted

Q.no 45. Out of the three problems S, Q and R, S is an NP-complete problem and Q and R
are the two other problems not known to be in NP. Which one of the following
statements is true if Q is polynomial time reducible to S and S is the polynomial time
reducible to R?

A : Q is NP-complete

B : R is NP-complete

C : Q is NP-hard

D : R is NP-hard

Q.no 46. The language generated by


S-> aSa|bSb|a|b
over the alphabet {a,b} is the set of

A : All length palindrome

B : Even length palindrome

C : Odd length palindrome

D : Strings starting and ending with different character

Q.no 47. The regular expression for all strings of 0′s and 1′s with no two consecutive 0′s
is
A : (0+1)

B : (0+1)*

C:

D : (0+1)* 011

Q.no 48. The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?

A : Finite state automata

B : Deterministic pushdown automata

C : Non-Deterministic pushdown automata

D : Turing machine

Q.no 49. Which grammar accepts the language of {a, b} having strings ending with 'a'.

A : S->aS | bS

B : S->aS | bS |b

C : S->aS | bS |S

D : S->aS | bS |a

Q.no 50. Construct a Turing machine which accepts a string with ‘aba’ as its substring.

A:
B:

C:

D:

Q.no 51. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?
A:

B:

C:

D:

Q.no 52. The problems which have no algorithm, regardless of whether or not they are
accepted by a turing machine that fails to halt on some input are referred as:
A : Decidable

B : Undecidable

C : Computable

D : Recognizable

Q.no 53. Which of following can be accepted by DPDA

A : any palindrome

B : odd length palindrome

C : even length palindrome

D : palindrome string is not accepted

Q.no 54. 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

A : I and II

B : I and IV

C : II and III

D : II and IV

Q.no 55. From the options given below the statement, which is not necessarily true if
X1 is the recursive language and X2 and X3 are the languages that are recursively
enumerable but not recursive.

A:

B:

C : X2 – X1 is recursively enumerable

D : X1 – X3 is recursively enumerable
Q.no 56. The context free grammar
S->SS|0S1 |1S0|Є
generates :

A : Unequal number of 0’s and 1’s

B : Equal number of 0’s and 1’s

C : Any number of 0’s followed by any number of 1’s

D : 0's followed by 1's

Q.no 57. In conversion from the following CFG to CNF, the number of nonterminals to
be introduced for the terminals are:
S->Aba , A->aab , B->Ac

A:2

B:3

C:4

D:5

Q.no 58.

A : X is decidable

B : X is undecidable but partially decidable

C : X is undecidable and not even partially decidable

D : X is not a decision problem


Q.no 59. Which of the following will not be accepted by the following DFA?

A : ababaabaa

B : abbbaa

C : abbbaabb

D : abbaabbaa

Q.no 60. Consider the following regular expressions. i) (a+b)* ii) (a*+b*)* iii) ((ϵ+a)b*)*
Which of the following statements is correct?

A : i,ii are equal and ii,iii are not

B : i,ii are equal and i,iii are not

C : ii,iii are equal and i,ii are not

D : i,ii,iii are equal

Q.no 1. Which of the following statement is true? (a) Turing machine was developed by
Alan Turing, (b) PDA is less powerful than Turing machine, (c) FA is more powerful
than TM

A : Only (a)

B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 2. Every grammar in Chomsky Normal Form is:

A : regular
B : context sensitive

C : context free

D : Unrestricted

Q.no 3. Regular expression x + y denotes the set

A : {x,y}

B : {xy}

C : {x}

D : {y}

Q.no 4. Transition function of DFA machine maps.

A:

B:

C:

D:

Q.no 5. To simplify a grammar we can eliminate

A : Useful symbols

B : epsilon productions

C : Reachable symbols

D : Non Unit productions

Q.no 6. Precedence of regular expression in decreasing order is

A:*,.,+

B:.,*,+

C:.,+,*

D:+,.,*

Q.no 7. Finite automata needs minimum _______ number of stacks


A:0

B:1

C:2

D:3

Q.no 8. A DPDA is a PDA in which:

A : No state p has two outgoing transitions

B : More than one state can have two or more outgoing transitions

C : At least one state has more than one transitions

D : At most one state has more than one transitions

Q.no 9. How many states a Turing machine has?

A : Finite

B : Infinite

C : May be finite

D : One

Q.no 10. A boolean formula is said to be in Conjuctive Normal Form (CNF) if it can
represented as

A : e1 V e2 V e3

B : e1 Ʌ e2 V e3

C : e1 V e2 Ʌ e3

D : e1 Ʌ e2 Ʌ e3

Q.no 11. If P, Q, R are three regular expressions and if P does not contain epsilon, then
the equation R = Q + RP has a unique solution given by

A : R = QP*

B : R = P*Q

C : R = RP

D : R = QP
Q.no 12. What is the pumping length of string of length x?

A : x+1

B:x

C : x-1

D : x2

Q.no 13. The language accepted by a Turing machine is called ………. language.

A : Regular

B : Recursively Enumerable

C : Context free

D : Context sensitive

Q.no 14. A language L is said to be ____________ if there is a turing machine M such that
L(M)=L and M halts at every point.

A : Turing acceptable

B : Decidable

C : Undecidable

D : NP-HARD

Q.no 15. The push down automata indicate the acceptance of input string in terms of

A : final state

B : empty stack

C : final state and empty stack

D : start state

Q.no 16. Halting states are of two types. They are:

A : accept and reject

B : reject and allow

C : start and reject


D : start and accept

Q.no 17. A Turing machine operates over

A : Finite memory tape

B : Infinite memory tape

C : Depends on the algorithm

D : Depends on the input

Q.no 18. The transition a Push down automaton makes is additionally dependent upon
the:

A : Current State

B : input tape

C : stack

D : terminals

Q.no 19. (a+b)* is equivalent to

A : b*a*

B : (a*b*)*

C : a*b*

D:

Q.no 20. Which of the following a Turing machine does not consist of?

A : Input tape

B : Head

C : State register

D : Stack

Q.no 21. Can a DFA recognize a palindrome number?

A : Yes

B : No
C : May be

D : Cannot be determined

Q.no 22. The travelling salesman problem can be solved using _________

A : A spanning tree

B : A minimum spanning tree

C : Bellman – Ford algorithm

D : DFS traversal

Q.no 23. Which of the following pairs have DIFFERENT expressive power?

A : Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

B : Deterministic push down automata (DPDA) and Non-deterministic pushdown automata


(NPDA)

C : Deterministic single-tape Turing machine and Non-deterministic single-tape Turing


Machine

D : Single-tape Turing machine and multi-tape Turing machine

Q.no 24. A string derived by a grammar is graphically represented using ……...

A : Binary tree

B : Sparse tree

C : Parse tree

D : Forest

Q.no 25. The RE that gives none or many instances of an x or y is

A : (x+y)

B : (x+y)*

C : (x* + y)

D : (xy)*

Q.no 26. Which of the following is a false statement?

A : Moore machine has no accepting states


B : Mealy machine has no accepting states

C : We can convert Mealy to Moore and vice versa

D : We can convert Mealy to Moore but not vice versa

Q.no 27. Pushdown automata behaves like Turing machine when it has the number of
auxiliary memory

A : one or more

B : two or more

C : zero

D : one

Q.no 28. The production of the form A->B , where A and B are non terminals is called

A : Null production

B : Greibach Normal Form

C : Unit production

D : Chomsky Normal Form

Q.no 29. Which of the following statements is incorrect?

A : A Turing Machine cannot solve Halting problem

B : Set of recursively enumerated languages is closed under union

C : A FSM with 3 stacks is more powerful than FSM with 2 stacks

D : Context sensitive grammar can be recognized by a linearly bounded memory machine.

Q.no 30. The total number of states and transitions required to form a Moore machine
that processes a binary input string and will produce residue mod 3.

A : 3 and 6

B : 3 and 5

C : 2 and 4

D : 2 and 5

Q.no 31. Which of the following is not an application of Finite Automaton?


A : Compiler Design

B : Grammar Parsers

C : Text Search

D : Image processing

Q.no 32. Is the language preserved in all the steps while eliminating epsilon transitions
from a NFA?

A : yes

B : no

C : may be

D : cannot say

Q.no 33. The worst-case efficiency of solving a problem in polynomial time is?

A : O(p(n))

B : O(p( n log n))

C:

D : O(p(m log n))

Q.no 34. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine

A : Only (a)

B : Only (b) and (c)

C : Only (a) and (c)

D : (a), (b) and (c)

Q.no 35. An Epsilon-NFA is ___________ in representation.

A : Quadruple

B : Quintuple

C : Triple
D : None of the mentioned

Q.no 36. Which of the regular expressions corresponds to the given problem statement
over the alphabet = {a, b}, All strings in which the total number of a’s is divisible by 2.

A : ((a+b)(a+b))*

B : (a + ab)*

C : ( b* a b*ab*)* + b*

D : a* b (aa)*b a*

Q.no 37. Which of the following is analogous to the NFA and NPDA ?

A : Regular language and Context Free language

B : Regular language and Context Sensitive language

C : Context free language and Context Sensitive language

D : Unrestricted language

Q.no 38. Which of the given problems are NP-complete?

A : (a) Traveling Salesman Problem

B : (b) Satisfiability Problem

C : Both (a) and (b)

D : Turing Machine

Q.no 39. Which of the following is in 2-CNF?

A : (e1 Ʌ e2) Ʌ (e1 Ʌ ~e2)

B : (e1 Ʌ e2) Ʌ (e1 V ~e2)

C : (e1 V e2) Ʌ (e1 V ~e2)

D : (e1 V e2) Ʌ (e1 Ʌ ~e2)

Q.no 40. A context free language is called ambiguous if (a) It has two or more leftmost
derivations for the same string. (b) It has two or more rightmost derivations for the
same string. (c) It has Only single derivation tree.

A : Only (a)
B : Only (b)

C : Both (a) and (b)

D : Only (c)

Q.no 41. Choose the correct option for the given statement: The DFA shown represents
all strings which have 1 at the second last position.

A : Correct

B : Incorrect, Incomplete DFA

C : Wrong proposition

D : May be correct

Q.no 42. Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-time
reducible to R. Which one of the given statements is true?

A : R is NP-complete

B : R is NP-hard

C : Q is NP-complete

D : Q is NP-hard

Q.no 43. Transition function of NFA machine is given by

A:

B:

C:

D:

Q.no 44. Which of the following is NOT generated by regular expression


R = (ab + abb)* bbab
A : ababbbbab

B : abbbab

C : ababbabbbab

D : ababbbbbab

Q.no 45. The language A-> tB|t generated by which of the following grammar?

A : Type 3

B : Type 2

C : Type 1

D : Type 0

Q.no 46. Which one of following is false.

A : There is unique minimal DFA for every regular language.

B : Every NFA can be converted to equivalent PDA.

C : Compliment of every CFL is recursive.

D : Every NPDA can be converted to an equivalent DPDA.

Q.no 47.

A:A

B:B

C:C
D:D

Q.no 48. Context free grammar having the following production


X->Xa
is termed as

A : Left Recursive Grammar

B : Non Recursive Grammar

C : Right Recursive Grammar

D : Center Recursive Grammar

Q.no 49. Transition function of Epsilon-NFA machine is given by

A:

B:

C:

D:

Q.no 50. 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
Q.no 51. Construct the regular expressions for the following DFAs:

A : (0 + 11*0)*

B : 0*+010*

C : (0+010)*

D : (0+1)*

Q.no 52. Any string of terminals that can be generated by the following CFG
S-> XY ,
X-> aX | bX | a ,
Y-> Ya | Yb | a

A : has atleast one 'b'

B : should end with 'aa'

C : has no consecutive a's or b's

D : has atleast two a's

Q.no 53. Which Transition Diagram is correct for the following problem
"Design a TM that erases all non blank symbols on the tape, where the sequence of non-
blank symbols does not contain any blank symbols B in between. Consider Alphabet
{a,b}.
A:

B:

C:
D:

Q.no 54. The output of Moore machine can be defined as

A:

B:

C:

D : state and its input

Q.no 55. 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 : (a . b) (a . b)

Q.no 56. Consider three decision problems P1, P2 and P3. It is known that P1 is
decidable and P2 is undecidable. Which one of the following is True?

A : P3 is decidable if P1 is reducible to P3

B : P3 is undecidable if P3 is reducible to P2

C : P3 is undecidable if P2 is reducible to P3

D : P3 is decidable if P3 is reducible to P2’s complement

Q.no 57. Which of the following grammars are in Chomsky Normal Form:
A : S->AB | BC | CD,
A->0,
B->1,
C->2,
D->3

B : S->AB,
S->BCA | 0 | 1 | 2 | 3

C : S->Ab0,
A->001,
B->A2

D : SA->Aba,
A->aab,
B->Ac

Q.no 58. The regular expression denotes a language comprising all possible strings of
even length over the alphabet (0, 1)

A : 1 + 0(1+0)*

B : (0+1) (1+0)*

C : (1+0)

D : (00+0111+10)*

Q.no 59. Find the pair of regular expressions that are equivalent

A : (0+1)* and (01)*

B : (0+10)* and (0+10*)

C : (0+10)* and (0*+10)*

D : (111*)* and (111+11*)*

Q.no 60. The set of all strings over alphabet ={a,b} in which a single a followed by any
number of b’s or a single b followed by any number of a’s is

A : ab* + ba*

B : ab*ba*

C : a*b + b*a

D : (a+b)(a+b)*

You might also like