Toc
Toc
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)
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)
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
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
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 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
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
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
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
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*
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
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
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
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
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
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)
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
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
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.
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
9172604237
TECOC382
TE A
TE B
TE C
TE D
Find out whether the following context free grammar is ambiguous or not? *
YES
NO
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? *
both
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: *
Select the correct grammar for language over {0,1} consisting of palindrome
strings of odd length *
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 , b's and a's are strictly followed by b's
exactly one
any number
at most one
Lexical analysis
Syntax analysis
Semantic analysis
Oueue
COntrol Unit
Stack
FSM
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? *
β h dβb l t (V U T)* d d/ β b
α → β , where α and β belongs to (V U T)* and α and/or β can be ε
None of these
No. of states
Its Memory
Control unit
None of these
Unrestricted Grammar
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
Both
CFL
Regular
None
A pushdown automata can be defined as: (Q, ∑, Γ, δ, q0, z0, F ) What does the
symbol z0 represents? *
an element of Γ
TYPE 0 grammar
TYPE 1 grammar
TYPE 2 grammar
TYPE 3 grammar
A→a
B→b
A→a|b
B→a|b
All of these
Start Symbol
Sta t Sy bo
Context Free
Context Sensitive
Recursively Enumerable
Regular
The given context free grammar contains how many useless symbols: *
One
Two
Zero
Three
TYPE 1 grammar
TYPE 0 grammar
TYPE 0 grammar
TYPE 3 grammar
TYPE 2 grammar
Union , Intersection
Intersection, Complement
The class of the language accepted by the PDA is ________ as compared to FSM.
*
larger
Same
Smaller
Cant say
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.
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.
Select one:
a. I x S -> O
b. I x S -> S
c. I x S -> I'
d. I X S -> S'
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.
Select one:
a. W
b. None of the above
c. Θ
d. Σ
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
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
Select one:
a.
b.
c.
d.
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
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
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.
Select one:
a. 3
b. 5
c. 6
d. 4
Marks: 09
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
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
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.
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
Select one:
a. 3’s Complement
b. 2’s Complement
c. 4’s Complement
d. 1’s Complement
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
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.
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
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
Select one:
a. 3
b. 1
c. 0
d. 2
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.
Select one:
a. {f1, f2}
b. {f1, f2, f3}
c. {a, f1, f2, f3}
d. none of the mentioned
Select one:
a. Compiler Design
b. All of the mentioned
c. Text Search
d. Grammar Parsers
Select one:
a. None of the mentioned
b. Lexical Analyser
c. State charts
d. BOT
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
Select one:
a. accepted by PDA
b. accepted by DFA
c. accepted by Turing machine
d. accepted by LBA
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
Select one:
a. 0 U 1
b. 0 / 1
c. All of the mentioned
d. 0 + 1
Select one:
a. 1
b. ϵ
c. Φ
d. 0
Select one:
a. Intersection
b. All of the mentioned
c. Union
d. Kleen star
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
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
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)*
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
Select one:
a. Lexical Analyzer
b. None of the above
c. Text Editor
d. Both Lexical Analyzer
Select one:
a. all of the mentioned
b. scanner
c. lexer
d. tokenizer
Select one:
a. Cannot determined
b. False
c. Insuffient Data
d. True
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
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
Question 1 How many strings of length less than 4 contains the language described by the regular expression (x+y)*y(a+ab)*?
Correct
b. 10
c. 7
d. 12
b. (a+c).b*
c. (a+c)+b*
d. a.b*.c.b*
Question 3 How many states will be required to represent a* in NFA with epsilon moves?
Incorrect
b. 5
c. 3
d. 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=Ø
b. Insufficient data
c. cannot determine
d. True
b. x*
c. ε+r
d. x+ (positive clusure)
Question 7 In NFA with epsilon moves a+b is represented with how many number of states?
Incorrect
b. 5
c. 6
d. 8
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
b. (a+b)*.a.b.(a+b)*
c. (a+b)*.a.(a+b)*.b.(a+b)*
d. a.b
Question 9 To represent (a+b) using DFA how many states will be required?
Correct
b. 5
c. 1
d. 2
b. Insufficient data
c. False
d. cannot determine
54.147.11.221/it/mod/quiz/review.php?attempt=60930&cmid=7781#question-62681-3 3/3
Marks: 10
Select one:
a. Automata
b. Data
c. Grammar
d. Tokens
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.
Select one:
a. ->
b. %
c. =>
d. ?
Select one:
a. No
b. Can not determined
c. Insuffient Data
d. Yes
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
Select one:
a. Syntax Tree
b. Parse Tree
c. All of the above
d. Rule Tree
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
Select one:
a. Uppercase Letters
b. None of these
c. Lowercase Letters
d. Both Uppercase and Lowercase
Marks: 10
Select one:
a. None of the above
b. S->BB, B->ab|ε
c. S->bB, B->aB|ε
d. S->aB, B->bB|ε
Select one:
a. L (G) = a*
b. L (G) = a^n
c. L (G) = a^nba^n
d. L (G) = φ
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|ε
Select one:
a. Insuffient Data
b. False
c. True
d. Canot Determined
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
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
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
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
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
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
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
Select one:
a. Yes
b. Insuffient data
c. No
d. Cannot determined
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
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
Select one:
a. Context Free Grammar
b. Context Sensitive Grammar
c. Left Linear Grammar
d. Right Linear Grammar
Select one:
a. Set of variables and terminals
b. Set of variables
c. None of these
d. Set of terminals
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
Select one:
a. Type 0
b. All of these
c. Phrase structure grammar
d. Semi-thue grammar
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
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
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
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)*
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*
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*
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
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.
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
G1 : S → SbS | a
G2 : S → aB | ab, A→GAB | a, B→ABb | b
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
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.
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
L1 = {a^m b^n | m ≠ n}
L2 = {a^m b^n | m = 2n+1}
L3 = {a^m b^n | m ≠ 2n}
10270_THEORY OF COMPUTATION
Time : 1hr
Max Marks : 50
N.B
1) All questions are Multiple Choice Questions having single correct option.
7) Use only black/blue ball point pen to darken the appropriate circle.
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
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
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)
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 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 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
A : leftmost derivation
B : rightmost derivation
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
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
C : Unit production
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)
A : Set of Nonterminals
B : Start symbol
C : Set of terminals
D : Production
D : current state
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 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
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
A:7
B : 10
C : 12
D : 11
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
Q.no 39. Which of the following is analogous to the NFA and NPDA ?
D : Unrestricted language
A : 2,4
B : 1,3
C : 1, 2, 3, 4
D : 2, 3, 4
Q.no 41.
A : X is decidable
Q.no 42.
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
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
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
A : Copies a string
B : Delete a symbol
C : Insert a symbol
Q.no 51. Find the pair of regular expressions that are equivalent
Q.no 52. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?
A:
B:
C:
D:
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.
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:
A : (a + b ) * ab
B : ab (a + b ) *
C:a(a+b)*b
D : b (a + b ) * a
A : Only II
B : Only III
C : Only I and II
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.
B : X is decidable
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
D : accepted
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:&
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)*
D : The set of all strings that begin and end with either 0 or 1
A : Input alphabet
B : Transition function
C : Initial State
D : Output alphabet
Q.no 7. Pushdown automata accepts
A : regular language
D : unrestricted language
A : x+1
B:x
C : x-1
D : x2
A : Captal Letters
B : Small Letters
C : Italic Letters
D : Roman Letters
A : Turing Machine
B : Finite Automata
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
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 : LL(K)
B : LR(K)
C : SLR(K)
D : CLR(K)
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
A : Kleene plus +
B : Kleene star *
C : Question mark ?
D : Union
A:
B:
C:
D:
A : Terminal Symbol
C : Start symbol
D : End symbol
Q.no 21.
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))
C:
A : Type 3
B : Type 2
C : Type 1
D : Type 0
B : true
C : may be
D : cannot say
C : Palindrome string
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:
A:3
B:7
C:5
D:6
Q.no 33. Which among the following is not true for 2-way infinte TM?
C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.
Q.no 35. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine
A : Only (a)
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.
B : DFA
C : NDFA
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?
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 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:
A : Copies a symbol
B : Reverses a string
C : Accepts a palindrome
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
C : Wrong proposition
D : May be correct
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 : Q is NP-complete
B : R is NP-complete
C : Q is NP-hard
D : R is NP-hard
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)
A : any palindrome
Q.no 59. Construct the regular expressions for the following DFAs:
A : (0 + 11*0)*
B : 0*+010*
C : (0+010)*
D : (0+1)*
A : Kleene closure
B : Concatenation
C : Complement
D : Union
A : input symbol
B : stack symbol
C : output symbol
D : tape symbol
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
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*
D : LL1 Parsing
Q.no 9.
A:
B:
C:0
D:1
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 13. Which among the following is the format of unit production?
A : A->B
B : A->b
C : B->Aa
D : B->aA
A : Push
B : Pop
D : Read
Q.no 15.
A : Always starts with b
A : Useful symbols
B : epsilon productions
C : Reachable symbols
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:
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)
A : Empty variable
B : Nullable variable
C : Non-empty variable
D : Non-nullable variable
Q.no 24. Which of the following pairs have different expressive power
A : regular language
C : unrestricted
A : never
B : not always
C : always
D : maybe
A : true
B : false
C : maybe
D : cannot say
Q.no 29. The travelling salesman problem can be solved using _________
A : A spanning tree
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
A : Quadruple
B : Quintuple
C : Triple
Q.no 34. The difference between Turing Machine and Two Way FA is in:
A : Input Tape
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 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?
B : Delete a symbol
C : Insert a symbol
Q.no 42. Find the pair of regular expressions that are equivalent
Q.no 43. Construct a Turing machine which accepts a string with ‘aba’ as its substring.
A:
B:
C:
D:
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.
B : X is 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
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)*
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.
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
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
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
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
A : {x,y}
B : {xy}
C : {x}
D : {y}
C : Computability
D : All of these
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
Q.no 7. Turing Machine also behaves like General purpose computer and that TM is
known as _______
Q.no 8. Which of the following pair of regular expressions are not equivalent?
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
A : Epsilon-reachable states
B : initial state
C : Final state
D : Non-final states
A : leftmost derivation
B : rightmost derivation
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
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
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
D : start state
A : [(a+b)*(aa+bb)]*
B : [(0+1)-(0b+a1)*(a+]*
C : (01+11+10)*
D : (1+2+0)*(1+2)*
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*
C : Both NP-complete
D : Both in P
A:0
B:1
C:2
D:3
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)
A : Regular
B : Context free
C : Context sensitive
D : Unrestricted
A : Mealy machine
B : Moore machine
C : Turing machine
Q.no 36. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?
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)*
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 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)
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
C : Wrong proposition
D : May be correct
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
A : Copies a symbol
B : Reverses a string
C : Accepts a palindrome
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?
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)
A:
B:
C:
A : Only II
B : Only III
C : Only I and II
Q.no 57. Which Transition table of Turing Machine is correct to check well formedness
of parentheses?
A:
B:
C:
D:
B : abbbab
C : ababbabbbab
D : ababbbbbab
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
A:1
B:2
C:3
D : Depends on problem
A : Type 0 grammar
B : Type 1 grammar
C : Type 2 grammar
D : Type 3 grammar
A : P, NP
B : NP, NP hard
C : P, P complete
D : NP Hard,P
D : Sentential form
A : LL(1)
B : SLR
C : CLR
D : LALR
A : Finite Automaton
B : Turing Machine
C : Converting from Mealy into Moore machine and vice versa is not possible
D : More machine is Moore powerful than Mealy machine
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
C : Node-Cover 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 12.
A : L*
B:
C:L
D:
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
A : LL(K)
B : LR(K)
C : SLR(K)
D : CLR(K)
A : any grammar
C : Turing machine rejects if the input does not belong to the language
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
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
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
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 : Yes
B : No
C : May be
D : Cannot be determined
Q.no 30. Production Rule: aAb->agb belongs to which of the following category?
A : Regular 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 34. Out of the three decision problems P1, P2 and P3, P1 is decidable and P2 is
undecidable. The statement that holds true is
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
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
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
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?
Q.no 43. Which of the following will not be accepted by the following DFA?
A : ababaabaa
B : abbbaa
C : abbbaabb
D : abbaabbaa
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
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
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:
A : any palindrome
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.
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
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
A:
B:
C:
D:
Q.no 57.
B : X is 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?
C : Counter machines
Q.no 2. If the PDA does not stop on an accepting state and the stack is not empty, the
string is
A : rejected
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
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
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
A : Alan Turing
B : Turing man
C : Turing taring
D : Turling Bake
D : LL1 Parsing
C : Nothing
D : Type of input
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
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
Q.no 18. There is a linear grammar that generates a context free grammar
A : Always
B : Never
C : Sometimes
D : Everytime
A : Terminals
B : Variables
C : Start Symbol
D : Productions
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.
B : DFA
C : NDFA
A:0
B:1
C:2
D:3
Q.no 25. The shown language is recognized by (a) Turing machine, (b) Pushdown
A : Only (a)
B : Only (b)
C : Only (c)
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?
Q.no 28. The set of all strings over alphabet = {a,b} in which all strings having bbbb as
substring is
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?
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)
D : Only (c)
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:
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
A : Binary tree
B : Sparse tree
C : Parse tree
D : Forest
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:
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 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)
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?
D : Turing machine
Q.no 51. Find the pair of regular expressions that are equivalent
A:
B:
C:
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)
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
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
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)
Q.no 3. The push down automata indicate the acceptance of input string in terms of
A : final state
B : empty stack
D : start state
D : L is a set of 0^n1^n
A : regular
B : context sensitive
C : context free
D : Unrestricted
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 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
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
A : Epsilon-reachable states
B : initial state
C : Final state
D : Non-final states
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
A : type 0
B : type 1
C : type 2
D : type 3
A : decidable problem
B : undecidable problem
C : complete problem
D : trackable problem
A : accepted by DFA
B : accepted by PDA
C : accepted by LBA
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
…....
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)
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
C : Turing machines
Q.no 28. The worst-case efficiency of solving a problem in polynomial time is?
A : O(p(n))
C:
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?
C : Both NP-complete
D : Both in P
A:3
B:7
C:5
D:6
B : {xx,xy,yx,yy}
C : {x,y}
D : {x,y,xy}
C : Determining of a universal Turing machine can be written for fewer than k instructions
for some k
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
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*)*
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+_)*
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:
A : any palindrome
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.
A : Only II
B : Only III
C : Only I and II
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
C : Wrong proposition
D : May be correct
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?
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
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)*
A : ababbbbab
B : abbbab
C : ababbabbbab
D : ababbbbbab
Q.no 57.
B : X is decidable
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
A:
B:
C:
D:
A:
B:
C:
D:
A : Regular Language
B : Non-Regular Language
C : May be Regular
D : Cannot be said
A : leftmost derivation
B : rightmost derivation
A:4
B:5
C:6
D : unlimitted
A:1
B:2
C:3
D : Depends on problem
A : Terminal Symbol
C : Start symbol
D : End symbol
A : Type 0 grammar
B : Type 1 grammar
C : Type 2 grammar
D : Type 3 grammar
A : R+
B : R-
C : R+ U R-
D:R
A : Push
B : 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
D : Set of strings with even number of a’s followed by odd number of b’s
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)
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
C : Turing machine rejects if the input does not belong to the language
A : Satisfiability
B : Independent set
C : Node-Cover 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
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.
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
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
A : Regular language
B : Context-free language
C : Context-sensitive 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?
C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.
Q.no 31. The production of the form A->B , where A and B are non terminals is called
A : Null production
C : Unit production
D : Chomsky Normal Form
A : Regular
B : Context free
C : Context sensitive
D : Unrestricted
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
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 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)
A : Mealy machine
B : Moore machine
C : Turing machine
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
A:
B:
C:
D:
A:3
B:5
C:7
D:2
A : Copies a string
B : Delete a symbol
C : Insert a symbol
Q.no 49. If all the production rules have single nonterminal symbol on the left side
then grammar is called as
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?
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
A : Copies a symbol
B : Reverses a string
C : Accepts a palindrome
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
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
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)
A:
B:
C:
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?
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
A : Terminals
B : Variables
C : Start Symbol
D : Productions
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
A : yes
B : no
C : maybe
D : never
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.
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)
D : Only (c)
A:2
B:3
C:4
D:5
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
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
A : Empty
B : abcabc
C : b*c|a
D : abc
A : Binary tree
B : Sparse tree
C : Parse tree
D : Forest
A : subset
B : proper subset
C : not 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 31.
A:
B:
C:
D:
Q.no 32. Which of the following pairs have different expressive power
B : Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down Automata
(NPDA)
Q.no 34. Turing machine (TM) is more powerful than FSM (Finite State Machine)
because
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
A : Set of Nonterminals
B : Start symbol
C : Set of terminals
D : Production
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
A : Only (a)
B : Only (b)
C : Only (c)
Q.no 40. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?
Q.no 41.
B : X is decidable
A : I and II
B : I and IV
C : II and III
D : II and IV
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)
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
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:
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 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
A : any palindrome
A : Only II
B : Only III
C : Only I and II
A : Push
B : Pop
D : Read
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
A : regular language
D : unrestricted language
B : More than one state can have two or more outgoing transitions
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
C : Node-Cover Problem
Q.no 8. What is the Regular Expression Matching Zero or More Specific Characters
A:x
B:#
C:*
D:&
A:
B:
C:
D:
A : (x+y)
B : (x+y)*
C : (x* + y)
D : (xy)*
Q.no 11.
A:
B:
C:L
D : L*
A : Its memory
B : number of states
C : start state
D : input symbols
B : Turing Machine
C : Converting from Mealy into Moore machine and vice versa is not possible
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
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
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.
C : {w | w is a string of length 3}
D : {w | w is an empty string}
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
A : Quadruple
B : Quintuple
C : Triple
Q.no 27.
A:
B:
C:
D : {0, 1}
Q.no 29. The worst-case efficiency of solving a problem in polynomial time is?
A : O(p(n))
C:
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
C : Palindrome string
B : stack alphabet
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
C : Determining of a universal Turing machine can be written for fewer than k instructions
for some k
D : current state
Q.no 37. Which of the following is not a Non deterministic 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*
A : lexical analysis
B : syntax analysis
C : semantic analysis
D : code generation
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
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:
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
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.
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
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.
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?
Q.no 55.
A : X is decidable
Q.no 56. If all the production rules have single nonterminal symbol on the left side
then grammar is called as
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
A : Kleene closure
B : Concatenation
C : Complement
D : Union
B : type 1
C : type 2
D : type 3
Q.no 3. The push down automata indicate the acceptance of input string in terms of
A : final state
B : 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 : Sentential form
C : Nothing
D : Type of input
A : leftmost derivation
B : rightmost derivation
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))*
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
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
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 23. Which of the following does not obey pumping lemma for context free
languages ?
A : Finite 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 26. The difference between Turing Machine and Two Way FA is in:
A : Input Tape
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
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 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
C : Unit production
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*)*
B : no trival method.
A : (x+y)
B : (x+y)*
C : (x* + y)
D : (xy)*
A : regular language
C : unrestricted
Q.no 39. The complexity class P consist of all the decision problems that can be solved
by ___________using polynomial amount of computation time.
B : DFA
C : NDFA
A : Type 3
B : Type 2
C : Type 1
D : Type 0
A : Copies a string
B : Delete a symbol
C : Insert a symbol
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
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)
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
A : Only II
B : Only III
C : Only I and II
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?
D : Turing machine
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.
B : X is 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
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:
A : Recursive
B : Non Recursive
C : Recognizable
D : Non Recognizable
A:*,.,+
B:.,*,+
C:.,+,*
D:+,.,*
C : Turing machine rejects if the input does not belong to the language
B : may be different
C : must be different
D : cannot say
C : Nothing
D : Type of input
A : Type 0 grammar
B : Type 1 grammar
C : Type 2 grammar
D : Type 3 grammar
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
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
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)*
D : The set of all strings that begin and end with either 0 or 1
Q.no 14.
A:R
B:
C : R*
D:
A : yes
B : no
C : may be
D : cannot say
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
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:
B : stack alphabet
A : Set of Nonterminals
B : Start symbol
C : Set of terminals
D : Production
A:0
B:1
C:2
D:3
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 32. Which of the following automata takes stack as auxiliary storage
A : finite automata
B : pushdown automata
C : Turing machine
C : Both NP-complete
D : Both in P
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
C : Determining of a universal Turing machine can be written for fewer than k instructions
for some k
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)
D : Only (c)
A : {xy,xy}
B : {xx,xy,yx,yy}
C : {x,y}
D : {x,y,xy}
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)
A:
B:
C:
D:
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
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
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.
A : any palindrome
A : Copies a string
B : Delete a symbol
C : Insert a symbol
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
Q.no 56. Find the pair of regular expressions that are equivalent
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
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
A : R+
B : R-
C : R+ U R-
D:R
B : Variables
C : Start Symbol
D : Productions
A:
B:
C:
D:
A : NP class
B : P class
C : NP complete
D : NP hard
Q.no 5.
A:
B:
C:0
D:1
Q.no 7. Which of the following are the actions that operates on stack top?
A : only push
B : only pop
A : leftmost derivation
B : rightmost derivation
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?
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 : Regular Language
B : Non-Regular Language
C : May be Regular
D : Cannot be said
A : Turing Machine
B : Finite Automata
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
C : Unit production
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*
A : true
B : false
C : maybe
D : cannot say
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 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)
A : Mealy machine
B : Moore machine
C : Turing machine
Q.no 33. The problem of finding a path in a graph that visits every vertex exactly once
is called
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
Q.no 37. Which of the following pairs have DIFFERENT expressive power?
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)*
D : (1+0)*
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.
B : X is 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 : 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
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
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?
D : Turing machine
A:
B:
C:
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
C : Wrong proposition
D : May be correct
A : Only II
B : Only III
C : Only I and II
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
B : More than one state can have two or more outgoing transitions
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?
C : Counter machines
D : Set of strings with even number of a’s followed by odd number of b’s
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
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
C : Node-Cover Problem
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
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}
A:2
B:3
C:4
D:5
A : 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 23. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine
A : Only (a)
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)
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
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:
A : Empty variable
B : Nullable variable
C : Non-empty variable
D : Non-nullable variable
A : Type 3
B : Type 2
C : Type 1
D : Type 0
C : Palindrome string
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}
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.
A : any palindrome
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?
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
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 : Type 3
B : Type 2
C : Type 1
D : Type 0
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
Q.no 55.
A : X is decidable
B : X is undecidable but partially decidable
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.
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
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
A : Alan Turing
B : Turing man
C : Turing taring
D : Turling Bake
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
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)
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
A : Push
B : Pop
D : Read
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
A : Terminals
B : Variables
C : Start Symbol
D : Productions
A : accepted by DFA
B : accepted by PDA
C : accepted by LBA
A : Terminals
B : Variables
C : Start Symbol
D : Productions
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
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
B : may be different
C : must be different
D : cannot say
A : Recursive language
C : Regular language
Q.no 20. The major difference between a moore and mealy machine is that
Q.no 21. Which among the following is not true for 2-way infinte TM?
C : Any computation that can be performed by 2-way infinite tape can also be performed by
standard TM.
A : Quadruple
B : Quintuple
C : Triple
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)
D : Only (c)
Q.no 25. Which of the functions are not performed by the Turing machine after reading
a symbol?
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
C : Finite Control
D : All of these
A : regular language
C : unrestricted
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:
A : Type 3
B : Type 2
C : Type 1
D : Type 0
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.
B : DFA
C : NDFA
Q.no 36. The production of the form A->B , where A and B are non terminals is called
A : Null production
C : Unit production
C : Turing machines
A : Yes
B : No
C : May be
D : Cannot be determined
A : Set of Nonterminals
B : Start symbol
C : Set of terminals
D : Production
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
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)*
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?
D : Turing machine
Q.no 49. Find the pair of regular expressions that are equivalent
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)
A:
B:
C:
D:
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
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
A : Kleene closure
B : Concatenation
C : Complement
D : Union
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 : LL1 Parsing
A : regular 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.
A : leftmost derivation
B : rightmost derivation
A : regular
B : context sensitive
C : context free
D : Unrestricted
D : Set of strings with even number of a’s followed by odd number of b’s
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 : yes
B : no
C : maybe
D : never
A : Useful symbols
B : epsilon productions
C : Reachable symbols
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)
D : Sentential form
A : Its memory
B : number of states
C : start state
D : input symbols
A : Type 0 grammar
B : Type 1 grammar
C : Type 2 grammar
D : Type 3 grammar
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
A : (x+y)
B : (x+y)*
C : (x* + y)
D : (xy)*
A:3
B:7
C:5
D:6
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.
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 : Mealy machine
B : Moore machine
C : Turing 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)
B : stack alphabet
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)
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 36. Recursively enumerable languages are …….. , whereas recursive languages are
…....
A : 2,4
B : 1,3
C : 1, 2, 3, 4
D : 2, 3, 4
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
A : any palindrome
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 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 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.
B : X is decidable
A : Copies a string
B : Delete a symbol
C : Insert a symbol
A : ababaabaa
B : abbbaa
C : abbbaabb
D : abbaabbaa
A : I and II
B : I and IV
C : II and III
D : II and IV
Q.no 56.
A:
B:
C:
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
A : Only II
B : Only III
C : Only I and II
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 : Recursive
B : Non Recursive
C : Recognizable
D : Non Recognizable
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 5. Which of the following correctly recognize the symbol ‘|-‘ in context to PDA?
A : moves
B : transition function
C : or symbol
D : not symbol
A : P, NP
B : NP, NP hard
C : P, P complete
D : NP Hard,P
C : Nothing
D : Type of input
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
D : start state
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?
D : x+ and x*x+
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
A : type 0
B : type 1
C : type 2
D : type 3
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)
Q.no 20. What is the Regular Expression Matching Zero or More Specific Characters
A:x
B:#
C:*
D:&
D : current state
A : false
B : true
C : may be
D : cannot say
A : Regular language
B : Context-free language
C : Context-sensitive 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 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
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
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 : regular language
C : unrestricted
A:0
B:1
C:2
D:3
Q.no 37. The shown language is recognized by (a) Turing machine, (b) Pushdown
A : Only (a)
B : Only (b)
C : Only (c)
Q.no 38. Which of the following is not a Non deterministic Turing machine?
D : Unsolvable
A : Binary tree
B : Sparse tree
C : Parse tree
D : Forest
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
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
Q.no 46. If all the production rules have single nonterminal symbol on the left side
then grammar is called as
C : Unrestricted grammar
D : Phrase grammar
A:3
B:5
C:7
D:2
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.
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
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
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 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 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
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
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 : A->B
B : A->b
C : B->Aa
D : B->aA
Q.no 9.
A : L*
B:
C:L
D:
Q.no 11. The decision problem is the function from string to ______________
A : char
B : int
C : boolean
D : float
A : leftmost derivation
B : rightmost derivation
Q.no 13.
A : Useful symbols
B : epsilon productions
C : Reachable symbols
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
C : Node-Cover Problem
A : Alan Turing
B : Turing man
C : Turing taring
D : Turling Bake
C : Converting from Mealy into Moore machine and vice versa is not possible
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
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:
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
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 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
C : Unit production
Q.no 35. Under which of the following operation, NFA is not closed?
A : Negation
B : Kleene
C : Concatenation
D : complement
A : never
B : not always
C : always
D : maybe
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
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
Q.no 40. Which of the following is analogous to the NFA and NPDA ?
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
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
A : ababbbbab
B : abbbab
C : ababbabbbab
D : ababbbbbab
A:
B:
C:
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 : Copies a string
B : Delete a symbol
C : Insert a symbol
A : any palindrome
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 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)*
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
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?
D : Turing machine
Q.no 58.
B : X is decidable
C : X is not a decision problem
A : Kleene closure
B : Concatenation
C : Complement
D : Union
A : Finite Automaton
B : Turing Machine
D : Sentential form
A:4
B:5
C:6
D : unlimitted
A:6
B:7
C:8
D:5
A : decidable
B : Undecidable
C : sometimes decidable
D : infinite
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
B : More than one state can have two or more outgoing transitions
A : (x+y)
B : (x+y)*
C : (x* + y)
D : (xy)*
A : Recursive language
C : Regular 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
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
C : Nothing
D : Type of input
A : Concatenation
B : Selection
C : Iteration
D : Addition
Q.no 22. What does it mean when we say that an algorithm X is asymptotically more
efficient than Y?
C : Turing machines
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)*
D : (1+0)*
B : [(0+1)-(0b+a1)*(a+]*
C : (01+11+10)*
D : (1+2+0)*(1+2)*
B : stack alphabet
D : transition function
Q.no 29. Which of the following pairs have different expressive power
B : Deterministic Push Down Automata (DPDA) and Non-deterministic Push Down Automata
(NPDA)
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
A : subset
B : proper subset
C : not 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
C : Determining of a universal Turing machine can be written for fewer than k instructions
for some k
Q.no 36.
C : {w | w is a string of length 3}
D : {w | w is an empty string}
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
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.
Q.no 42. Which of the following will not be accepted by the following DFA?
A : ababaabaa
B : abbbaa
C : abbbaabb
D : abbaabbaa
A:
B:
C:
D:
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
C : Unrestricted grammar
D : Phrase grammar
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 : 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
B : Only III
C : Only I and II
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
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)
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.
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
A:
B:
C:
D:
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*)
A : Its memory
B : number of states
C : start state
D : input symbols
A : NP class
B : P class
C : NP complete
D : NP hard
A : Kleene plus +
B : Kleene star *
C : Question mark ?
D : Union
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
A : Regular Language
B : Non-Regular Language
C : May be Regular
D : Cannot be said
A:R
B:
C : R*
D:
Q.no 15. For alphabet = {a,b}, the regular expression r = (aa)*(bb)*b denotes
D : Set of strings with even number of a’s followed by odd number of b’s
D : LL1 Parsing
A : Polynomial
B : Non polynomial
C : Logarithmic
D : Non Logarithmic
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 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
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
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 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
C : Unrestricted languages
D : Restricted languages
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
C : Finite Control
D : All of these
A : Empty
B : abcabc
C : b*c|a
D : abc
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)
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?
D : Unsolvable
A : any palindrome
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)
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 : 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.
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?
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)*
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)*
A:
B:
C:
D:
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
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
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
D : start state
A : decidable
B : Undecidable
C : sometimes decidable
D : infinite
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 _______
Q.no 10. Which of the following can be used to simulate any Turing machine?
C : Counter machines
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
A:2
B:3
C:4
D:5
A : LL(K)
B : LR(K)
C : SLR(K)
D : CLR(K)
A : Push
B : Pop
D : Read
C : Nothing
D : Type of input
A : (x+y)
B : (x+y)*
C : (x* + y)
D : (xy)*
A:*,.,+
B:.,*,+
C:.,+,*
D:+,.,*
A : Terminals
B : Variables
C : Start Symbol
D : Productions
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
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 29. Recursively enumerable languages are …….. , whereas recursive languages are
…....
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)
C : Turing machines
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 34. Which of the following pairs have DIFFERENT expressive power?
A : (x+y)
B : (x+y)*
C : (x* + y)
D : (xy)*
A:1
B:2
C:3
D:4
Q.no 38. The travelling salesman problem can be solved using _________
A : A spanning tree
D : DFS traversal
B : stack alphabet
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
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
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
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 50. If all the production rules have single nonterminal symbol on the left side
then grammar is called as
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:
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:
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:
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
C : Wrong proposition
D : May be correct
Q.no 58.
A : Copies a symbol
B : Reverses a string
C : Accepts a palindrome
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
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
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)
Q.no 4. Turing machine is more powerful than (a) Finite automata, (b) Push down
automata
A : Only (a)
B : Only (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
A : Epsilon-reachable states
B : initial state
C : Final state
D : Non-final states
C : Computability
D : All of these
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
A : Type 0 grammar
B : Type 1 grammar
C : Type 2 grammar
D : Type 3 grammar
A : any 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
A : yes
B : no
C : may be
D : cannot say
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
D : accepted
B : may be different
C : must be different
D : cannot say
A:
B:
C:
D:
Q.no 21. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine
A : Only (a)
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
C : Determining of a universal Turing machine can be written for fewer than k instructions
for some k
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)
Q.no 27. The problem of finding a path in a graph that visits every vertex exactly once
is called
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 ?
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
A : 2,4
B : 1,3
C : 1, 2, 3, 4
D : 2, 3, 4
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
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
A : lexical analysis
B : syntax analysis
C : semantic analysis
D : code generation
Q.no 41.
B : X is decidable
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?
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 49. The context free languages are closed under (a) union, (b) concatenation, (c)
Kleen closure
A : Only (a)
B : Only (b)
C : Only (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
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
A:
B:
C:
D:
A : any palindrome
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
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
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 : 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
A : Terminals
B : Variables
C : Start Symbol
D : Productions
Q.no 11. Number of states required to accept strings ending with 101
A:3
B:4
C:2
D : cannot be represented.
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)*
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:
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
A : type 0
B : type 1
C : type 2
D : type 3
A : accepted by DFA
B : accepted by PDA
C : accepted by LBA
A : Kleene plus +
B : Kleene star *
C : Question mark ?
D : Union
A : decidable
B : Undecidable
C : sometimes decidable
D : infinite
Q.no 20. Which among the following are incorrect regular identities?
A:
B:
C:
D:
A : [(a+b)*(aa+bb)]*
B : [(0+1)-(0b+a1)*(a+]*
C : (01+11+10)*
D : (1+2+0)*(1+2)*
Q.no 24. Which among the following is not true for 2-way infinte TM?
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 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
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
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 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
A : Only (a)
B : Only (b)
C : Only (c)
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+_)*
A : Instantaneous description
B : input symbols
C : start state
D : final state
C : Palindrome string
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:
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
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:
B:
C:
D:
A : Copies a symbol
B : Reverses a string
C : Accepts a palindrome
Q.no 54. If all the production rules have single nonterminal symbol on the left side
then grammar is called as
C : Unrestricted grammar
D : Phrase grammar
A:
B:
C:
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.
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
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
A : Copies a string
B : Delete a symbol
C : Insert a symbol
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
D : LL1 Parsing
A : Captal Letters
B : Small Letters
C : Italic Letters
D : Roman Letters
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?
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 : 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
D : Sentential form
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
C : Turing machine rejects if the input does not belong to the language
A : R+
B : R-
C : R+ U R-
D:R
A : Turing Machine
B : Finite Automata
Q.no 19. Minimal finite automata need _____________ no. of final states
A:1
B:2
C:3
D : Depends on problem
A : Concatenation
B : Selection
C : Iteration
D : Addition
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
D : current state
B : stack alphabet
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:
A:1
B:2
C:3
D:4
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
C : Turing machines
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
A : Boolean value
B : A state
C : A set of states
D : An edge
A : regular language
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 38. Number of states required to accept strings ending with 10 are
A:3
B:2
C:1
D : can’t be represented.
A : Regular language
B : Context-free language
C : Context-sensitive 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:3
B:5
C:7
D:2
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 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?
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
A : any palindrome
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 :
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
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?
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)
D : Only (c)
A : regular
B : context sensitive
C : context free
D : Unrestricted
A : {x,y}
B : {xy}
C : {x}
D : {y}
A:
B:
C:
D:
A : Useful symbols
B : epsilon productions
C : Reachable symbols
A:*,.,+
B:.,*,+
C:.,+,*
D:+,.,*
B:1
C:2
D:3
B : More than one state can have two or more outgoing transitions
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
D : start state
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
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
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
D : DFS traversal
Q.no 23. Which of the following pairs have DIFFERENT expressive power?
A : Binary tree
B : Sparse tree
C : Parse tree
D : Forest
A : (x+y)
B : (x+y)*
C : (x* + y)
D : (xy)*
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
C : Unit production
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
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))
C:
Q.no 34. CFGs are more powerful than (a) DFA, (b) NDFA, (c) Mealy Machine
A : Only (a)
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 ?
D : Unrestricted language
D : Turing Machine
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)
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
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
A:
B:
C:
D:
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 47.
A:A
B:B
C:C
D:D
A:
B:
C:
D:
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
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:
A:
B:
C:
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
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
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)*