Theory of Computation MCQs
Theory of Computation MCQs
A. States
B. Transitions
C. Both
Answer: C) Both
A. Rectangle
B. Arrow
C. Circles
Answer: C) Circles
A. Triangle
B. Circles
C. Double circles
D. Arrows
Answer: D) Arrows
____ are entities or single objects that can be any letter, alphabet, or picture.
A. Objects
B. Transitions
C. Symbols
D. Alphabets
Answer: C) Symbols
A. W
B. ∑
C. |W|
D. ~
Answer: B) ∑
Explanation:
A. Switch
B. String
C. State
D. Symbols
Answer: B) String
A. w
B. A
C. G
D. s
Answer: A) w
Explanation:
A. Unfilled string
B. End string
C. Empty string
Explanation:
A. 0
B. E
C. $
D. ε
Answer: D) ε
Explanation:
A. Null
B. L
C. |Length|
D. |w|
Answer: D) |w|
Explanation:
A. 2
B. 0
C. 3
D. None
Answer: C) 3
Explanation:
A. 1
B. 2
C. 3
D. None
Answer: B) 2
Explanation:
A. 5
B. 4
C. 3
D. 2
Answer: A) 5
Explanation:
A. 4
B. 3
C. 5
D. 2
Answer: D) 2
Explanation:
17. In the ____, the machine only goes to one state for each input character.
A. DFA
B. NFA
Answer: A) DFA
Explanation:
In the DFA, the machine only goes to one state for each input character.
A. Yes
B. No
Answer: B) No
Explanation:
A. Yes
B. No
Answer: A) Yes
Explanation:
Explanation:
21. In both NFA and DFA, several end states are possible.
A. True
B. False
Answer: A) True
Explanation:
A. DFA
B. NFA
Answer: A) DFA
Explanation:
A. Double circles
B. Triangle
C. Double dash
D. circle
Explanation:
A. Undirected
B. Directed
Answer: B) Directed
Explanation:
A. Many
B. None
C. One
D. Zero
Answer: C) One
Explanation:
For specified input, there is only one path from the current state to the next state
in DFA.
A. δ: Q x ∑→Q
B. W: Q x ∑→Q
C. δ: Q x ∑→W
D. δ: Q x ∑→F
Answer: A) δ: Q x ∑→Q
Explanation:
A. Anti clockwise
B. Clockwise
Answer: B) Clockwise
Explanation:
A. 2
B. 3
C. 4
D. 5
Answer: D) 5
Explanation:
A. δ: Q x ∑ →3Q
B. δ: Q x ∑ →2Q
C. δ: Q x ∑ →4Q
D. δ: Q x ∑ →FQ
Answer: B) δ: Q x ∑ →2Q
Explanation:
The five states of NFA are identical to those of DFA but have distinct transition
functions δ: Q x ∑ →2Q.
A. Constant expression
B. Frequent expression
C. Regular expression
D. Conventional expression
Explanation:
A. Regular language
B. Consistent language
C. Kleen language
D. Series language
Explanation:
Regular languages are the languages that are accepted by some regular
expressions.
Explanation:
If L is a regular language, then its Kleen closure L1* will also be a regular
language.
33. What will be the regular expression for the language accepting all the
strings which are starting with 1 and ending with 0, over ∑ = {0, 1}?
A. R = 1 (0+1)* 1
B. R = 1 (0+1)+ 0
C. R = 1 (0+1)* 0
D. R = 1 (0+1)+1
Answer: C) R = 1 (0+1)* 0
Explanation:
The initial symbol in a regular expression should be 1, and the last symbol should
be 0, so the regular expression will be R = 1 (0+1)* 0.
34. A ____ machine is a finite state machine in which the current state and
current input symbol determine the future state.
A. Moore
B. Mealy
Answer: A) Moore
Explanation:
A Moore machine is a finite-state machine in which the current state and current
input symbol determine the future state.
A. 5
B. 4
C. 3
D. 6
Answer: D) 6
Explanation:
Explanation:
A Mealy machine is a machine in which the output symbol depends upon the
present input symbol and the present state of the machine.
A. 5
B. 4
C. 3
D. 6
Answer: D) 6
Explanation:
The Mealy machine can be described by 6 tuples (Q, q0, ∑, O, δ, X') where
Explanation:
A. 2
B. 3
C. 4
D. 5
Answer: C) 4
Explanation:
• G is the grammar
• T is the final set of a terminal symbol
• V is the final set of a non-terminal symbol
• P is a set of production rules
• S is the start symbol
A. Lowercase letter
B. Upper case letter
C. Camel case letter
Explanation:
A. Lowercase letter
B. Upper case letter
C. Camel case letter
Explanation:
42. The input is scanned and replaced with the production rule from left to
right in the ____ derivation.
A. Right most deviation
B. Left most deviation
Explanation:
The input is scanned and replaced with the production rule from left to right in
the leftmost derivation.
Explanation:
We read the input string from right to left in the rightmost derivation.
A. Comprehend tree
B. Deviated tree
C. Decipher tree
D. Parse tree
Explanation:
45. In a parse tree, the root node always represents a ____ symbol.
Explanation:
A. Non-terminal node
B. Terminal node
Explanation:
Explanation:
Explanation:
A. Heap
B. Array
C. Stack
D. None
Answer: C) Stack
Explanation:
Pushdown automaton is a finite automaton with additional memory known as a
stack.
A. PDA
B. FA
Answer: A) PDA
Explanation:
Explanation:
52. The CFG that accepts deterministic PDAs also allows non-deterministic
PDAs?
A. False
B. True
Answer: B) True
Explanation:
The CFG that accepts deterministic PDAs also allows non-deterministic PDAs.
A. NPDA
B. DPDA
Answer: A) NPDA
Explanation:
Some CFGs can only be accepted by NPDA and not by DPDA. As a result, NPDA is
more potent than DPDA.
A. TYPE 3
B. TYPE 2
C. TYPE 1
D. TYPE 0
Answer: D) TYPE 0
Explanation:
According to Chomsky's hierarchy TYPE 0 represents unrestricted grammar.
A. TYPE 3
B. TYPE 2
C. TYPE 1
D. TYPE 0
Answer: B) TYPE 2
Explanation:
A. TYPE 3
B. TYPE 2
C. TYPE 1
D. TYPE 0
Answer: A) TYPE 3
Explanation:
A. TYPE 3
B. TYPE 2
C. TYPE 1
D. TYPE 0
Answer: C) TYPE 1
Explanation:
Explanation:
A. Finite Automaton
B. Pushdown Automaton
C. Turing Machine
D. None of the above
Answer: C) Turing Machine
Explanation:
A. Finite Automaton
B. Pushdown Automaton
C. Turing Machine
Explanation:
a. 9 states
b. 10 states
c. 11 states
d. 15 states
a. N!
b. 2N
c. 2^N
d. N^2
3. Which one of these given regular expressions isn’t equivalent to this regular
expression:
(m + n + o) *
a. (m*n* + o*)*
b. ((mn)* + o*)*
c. (m*n*o*)*
d. (m* + n* + o*)*
a. L (D) = L (G)
b. L (D) ⊂ L (G)
c. L (D) is empty
d. L (D) ⊃ L (G)
5. If you consider a regular expression r, in which r = (11 + 111)* over Ʃ = {0, 1},
then the number of states in minimal DFA and NFA respectively are:
a. DFA – 4, NFA – 3
b. DFA – 3, NFA – 3
c. DFA – 3, NFA – 4
d. DFA – 4, NFA – 4
a. Recursive
c. Regular
d. Context Free
7. The C language is a:
a. Regular language
It is a ___________ language.
a. regular
a. I
b. IV
c. I and III
d. I and IV
L1 = {0^i1^j | i != 2j}
L2 = {0^i1^j | i = 2j+1}
L3 = {0^i1^j | i = j}
L4 = {0^i1^j | i != j}
a. Only L3
b. Only L3 & L2
c. Only L4 & L3
d. All LA, L2, L3, and L4
11. The L= {0^i21^i | i≥0 } language over the {0,1, 2} alphabet is:
b. a regular language
d. not recursive
12. If G is the CFG, r is the total number of rightmost derivations, l is the total
number of leftmost derivations, as well as P refers to the total number of
parse trees, then assume that r, l, and P are computed for some given
particular string. Here, for a given ‘G’ CFG and given ‘w’ string, what is the
relation between all three of these?
a. r ≤ P ≥ l
b. r = P = l
c. r ≥ P ≤ l
d. None
Answer: (b) r = P = l
a. context-free
b. regular
c. recursive
d. context-sensitive
Answer: (c) recursive
c. L is not context-free
d. L = O
Explanation:
A. States
B. Transitions
C. Both
Answer: C) Both
Explanation:
A. Rectangle
B. Arrow
C. Circles
Answer: C) Circles
Explanation:
A. Triangle
B. Circles
C. Double circles
D. Arrows
Answer: D) Arrows
Explanation:
5. ____ are entities or single objects that can be any letter, alphabet, or
picture.
A. Objects
B. Transitions
C. Symbols
D. Alphabets
Answer: C) Symbols
Explanation:
Symbols are entities or single objects that can be any letter, alphabet, or picture.
Explanation:
A. W
B. ∑
C. |W|
D. ~
Answer: B) ∑
Explanation:
A. Switch
B. String
C. State
D. Symbols
Answer: B) String
Explanation:
A. w
B. A
C. G
D. s
Answer: A) w
Explanation:
A. Unfilled string
B. End string
C. Empty string
Explanation:
A. 0
B. E
C. $
D. ε
Answer: D) ε
Explanation:
Empty string is represented by ε.
A. Null
B. L
C. |Length|
D. |w|
Answer: D) |w|
Explanation:
A. 2
B. 0
C. 3
D. None
Answer: C) 3
Explanation:
A. 1
B. 2
C. 3
D. None
Answer: B) 2
Explanation:
A. 5
B. 4
C. 3
D. 2
Answer: A) 5
Explanation:
A. 4
B. 3
C. 5
D. 2
Answer: D) 2
Explanation:
17. In the ____, the machine only goes to one state for each input character.
A. DFA
B. NFA
Answer: A) DFA
Explanation:
In the DFA, the machine only goes to one state for each input character.
A. Yes
B. No
Answer: B) No
Explanation:
A. Yes
B. No
Answer: A) Yes
Explanation:
Explanation:
21. In both NFA and DFA, several end states are possible.
A. True
B. False
Answer: A) True
Explanation:
There can be multiple final states in both NFA and DFA.
A. DFA
B. NFA
Answer: A) DFA
Explanation:
A. Double circles
B. Triangle
C. Double dash
D. circle
Explanation:
A. Undirected
B. Directed
Answer: B) Directed
Explanation:
25. For specified input, there can be how many paths from the current state
to the next state in DFA?
A. Many
B. None
C. One
D. Zero
Answer: C) One
Explanation:
For specified input, there is only one path from the current state to the next state
in DFA.
A. δ: Q x ∑→Q
B. W: Q x ∑→Q
C. δ: Q x ∑→W
D. δ: Q x ∑→F
Answer: A) δ: Q x ∑→Q
Explanation:
A. Anti clockwise
B. Clockwise
Answer: B) Clockwise
Explanation:
A. 2
B. 3
C. 4
D. 5
Answer: D) 5
Explanation:
Answer: B) δ: Q x ∑ →2Q
Explanation:
The five states of NFA are identical to those of DFA but have distinct transition
functions δ: Q x ∑ →2Q.
A. Constant expression
B. Frequent expression
C. Regular expression
D. Conventional expression
Explanation:
A. Regular language
B. Consistent language
C. Kleen language
D. Series language
Explanation:
Regular languages are the languages that are accepted by some regular
expressions.
32. If L is a regular language, then its Kleen closure L1* will ____.
Explanation:
If L is a regular language, then its Kleen closure L1* will also be a regular
language.
33. What will be the regular expression for the language accepting all the
strings which are starting with 1 and ending with 0, over ∑ = {0, 1}?
A. R = 1 (0+1)* 1
B. R = 1 (0+1)+ 0
C. R = 1 (0+1)* 0
D. R = 1 (0+1)+1
Answer: C) R = 1 (0+1)* 0
Explanation:
The initial symbol in a regular expression should be 1, and the last symbol should
be 0, so the regular expression will be R = 1 (0+1)* 0.
34. A ____ machine is a finite state machine in which the current state and
current input symbol determine the future state.
A. Moore
B. Mealy
Answer: A) Moore
Explanation:
A Moore machine is a finite-state machine in which the current state and current
input symbol determine the future state.
A. 5
B. 4
C. 3
D. 6
Answer: D) 6
Explanation:
Explanation:
A Mealy machine is a machine in which the output symbol depends upon the
present input symbol and the present state of the machine.
A. 5
B. 4
C. 3
D. 6
Answer: D) 6
Explanation:
The Mealy machine can be described by 6 tuples (Q, q0, ∑, O, δ, X') where
Explanation:
A. 2
B. 3
C. 4
D. 5
Answer: C) 4
Explanation:
• G is the grammar
• T is the final set of a terminal symbol
• V is the final set of a non-terminal symbol
• P is a set of production rules
• S is the start symbol
A. Lowercase letter
B. Upper case letter
C. Camel case letter
Explanation:
A. Lowercase letter
B. Upper case letter
C. Camel case letter
Explanation:
Non-terminal symbols are denoted by capital letters.
42. The input is scanned and replaced with the production rule from left to
right in the ____ derivation.
Explanation:
The input is scanned and replaced with the production rule from left to right in
the leftmost derivation.
Explanation:
We read the input string from right to left in the rightmost derivation.
A. Comprehend tree
B. Deviated tree
C. Decipher tree
D. Parse tree
Explanation:
45. In a parse tree, the root node always represents a ____ symbol.
Explanation:
A. Non-terminal node
B. Terminal node
Explanation:
In a parse tree, the leaf node always has terminal nodes.
Explanation:
Explanation:
A. Heap
B. Array
C. Stack
D. None
Answer: C) Stack
Explanation:
A. PDA
B. FA
Answer: A) PDA
Explanation:
Explanation:
52. The CFG that accepts deterministic PDAs also allows non-deterministic
PDAs?
A. False
B. True
Answer: B) True
Explanation:
The CFG that accepts deterministic PDAs also allows non-deterministic PDAs.
A. NPDA
B. DPDA
Answer: A) NPDA
Explanation:
Some CFGs can only be accepted by NPDA and not by DPDA. As a result, NPDA is
more potent than DPDA.
A. TYPE 3
B. TYPE 2
C. TYPE 1
D. TYPE 0
Answer: D) TYPE 0
Explanation:
A. TYPE 3
B. TYPE 2
C. TYPE 1
D. TYPE 0
Answer: B) TYPE 2
Explanation:
Answer: A) TYPE 3
Explanation:
A. TYPE 3
B. TYPE 2
C. TYPE 1
D. TYPE 0
Answer: C) TYPE 1
Explanation:
A. Finite Automaton
B. Pushdown Automaton
C. Turing Machine
D. None of the above
Explanation:
A. Finite Automaton
B. Pushdown Automaton
C. Turing Machine
Explanation:
1:
Number of states of the FSM required to simulate behaviour of a computer with a memory
capable of storing "m" words, each of length 'n'
A. m x 2n
B. 2mn
C.2m+n
D.all of these
Option: B
Explanation :
For every data here length is ‘n’ and memory's states are defined in terms of power of 2,
Here the total memory capability for all the words = mn
Hence number of states are 2mn
2:
An FSM with
D.None of these
Option: C
Explanation :
3:
Option: A
Explanation :
4:
Power of
Option: D
Explanation :
5:
D.All of these
Option: D
Explanation :
Option (a) and option (b) are similar deriving expressions using rule :- (pq)*p = p(qp)*
Option (c) will also be valid since:-
(x+x*+) will be
--->(xx*)(x*x**)
--->x+
6:
A finite state machine with the following state table has a single input x and a single output z. If
initial state is unknown, then shortest input sequence to reach the inal state C is
X=1 X =0
A D, 0 B, 0
B B, 1 C, 1
C B, 0 D, 1
D B, 1 C, 0
A. 01
B. 10
C.110
D.110
Answer Report Discuss
Option: B
Explanation :
7:
A. 1
B. 3
C.4
D.2
Option: D
Explanation :
Finite Automata (FA) or Finite State Machine to add two integers can be constructed using
two states:
q0: Start state to represent carry bit is 0
q1: State to represent carry bit is 1
8:
If two finite state machines are equivalent, they should have the same number of
A. states
B. edges
D.none of these
Option: D
Explanation :
9:
A. Designing compilers
D.All of these
Option: D
Explanation :
10:
L = {aP | p ; } is prime is
A. regular
B. not regular
C.accepted by DFA
D.accepted by PDA
Option: B
11:
B. from any given state, there can't be any token leading to two different states
Option: D
Explanation :
12:
If f : {a, b}* —> (a, b}* be given by f (n) = ax for every value of n ∈ (a, b}, then f is
Option: A
Explanation :
13:
Option: C
Explanation :
14:
Running time of NFA to DFA conversion including the case where NFA has e-transition is
A. 0 (n3)
B. 0 (n332)
C.0 (n32n)
D.0 (n22n)
Option: C
Explanation :
15:
A. The task of lexical analyzer is to translate the input source language text into tokens
and determine the groups of tokens are inter-related.
B. Two basic approaches to translation are generation and interpretation.
C.A load-and-go compiler is capable o translating the source language text on a host
machine A that can be later run on any target machine B.
D.None of these
Option: D
16:
D.All of these
Explanation :
Strings of odd number of zeroes can be generated by the regular expression (00)
*0.Pumping lemma can be used to prove the non-regularity of the other options.
17:
C.in DFSA, from any given state, there can't be any alphabet leading to two diferent states
D.in NDFSA, from any given state, there can't be any alphabet leading to two diferent states
Option: C
Explanation :
18:
A. even
B. odd
C.null
D.none of these
Option: A
Explanation :
19:
A PDM behaves like an FSM wnen the number of auxiliary memory it has, is
A. 0
B. 1
C.2
D.None of these
Option: A
Explanation :
20:
A. any grammar
Option: D
21:
A. output of the former depends on the present state and present input
D.all of these
Option: B
Explanation :
22:
A. regular expression
B. DFSM
C.NDFSM
D.all of these
Option: D
Explanation :
23:
A. Designing computers
B. Designing compilers
D.Developing computers
Option: D
Explanation :
Click on Discuss to view users comments.
24:
Option: C
Explanation :
25:
A. Mathematical semantics
B. Interpretative semantics
C.Translational semantics
D.Axiomatic semantics
Option: A
26:
Which of the following regular expressions denotes a language comprising all possible
strings over the alphabet {a, b } ?
A. a* b*
B. (a | b)*
C. (ab)+
D. (a | b*)
Option: B
Explanation :
27:
An FSM (Finite State Machine) can be considered to be a TM (Turing Machine) of finite tape
length
Option: A
Explanation :
28:
D.all of these
Option: D
Explanation :
29:
If ∑ = {a, b, c, d, e, f } then number of strings in ∑ of length 4 such that no symbol is used more
than once in a string is
A. 35
B. 360
C.49
D.720
Option: B
Explanation :
Here string length is 4 so we can create string of length 4 by 6 values. Suppose at first place
we can arrange any value by 6 methods.so 6. then Remaining total numbers are 5 so we
can arrange them by 5 methods at second place. then remaining total numbers are 4 so
we can arrange them by 4 methods. now remaining total numbers are 3 and we can
arrange them by 3 methods. so according to permutation technique. We multiply them i.e.
6*5*4*3=360. So, 'B'
30:
A. context - free
B. context-sensitive
C.recursive
D.Right-linear
Option: D
31:
A. NO
B. YES
C.SOMETIMES
D.Depends on NFA
Option: B
Explanation :
32:
A. The language accepted by finite automata are the languages denoted by regular
expressions
C.For a regular expression r, there does not exist NFA with L(r) any transit that accept
D.None of these
Option: C
Explanation :
Click on Discuss to view users comments.
33:
A. {a}
B. { ∈ , a, b }
C.{a, b}
D.{ ab }
Option: C
Explanation :
34:
A. { a, b, ab, aa }
B. { a, b, ba, bb }
C.{ a, b }
Option: D
Explanation :
35:
A. a | b
B. (ab)*
C. (a | b)*
D.a* I b
Option: C
36:
Which of the following regular expressions denotes a language comprising all possible
strings of even length over the alphabet ( 0 , 1 ) ?
A. (0 | 1) *
B. (0 | 1) (0 | 1)*
C.(00 01 10 11 )*
D.(0 | 1 ) (0 | 1)(0 | 1 ) *
Option: C
Explanation :
37:
Explanation :
38:
C.b* c l a
Option: C
Explanation :
39:
A. generative, cognitive
B. generative, acceptor
C.acceptor, cognitive
D.cognitive, generative
Option: D
Explanation :
In the figure given below, a deterministic finite automation M has start state A and
accepting state D. Which of the following regular expression denoted the set of all words
accepted by
M?
A. 001
B. 10 * 1 * 0
C.( 0 | 1) * 011
D.1* 0 * 001
Option: C
41:
A. union
B. concatenation
C.Kleene's closure
D. all of these
Option: D
Explanation :
42:
A. compile time
B. Run time
D.none of these
Option: B
Explanation :
43:
A. (a ∪ b) *
B. (b* ∪ a*)*
C. (b ∪ a)*
D.All of above
Option: D
Explanation :
44:
B. can't
C.may
D.may not
Option: B
Explanation :
45:
A. S ⊂ T
B. T⊂ S
C. S = T
D.S ∩ T= φ
Option: C
46:
A. n states
B. n + 1 states
C. n + 2 states
D. none of these
Explanation :
47:
If regular set A is represented by A = (01 + 1)* and the regular set 'B' is represented by B =
((01)*1*)*, then
A. A ⊂ B
B. B ⊂ A
D. A=B
Option: D
Explanation :
48:
B.
Option: A
Explanation :
49:
Which of the following are not regular ?
D.All of these
Option: D
Explanation :
50:
An FSM with
D.none of these
Option: C
51:
A. even
B. odd
C.null
D.none of these
Option: A
Explanation :
52:
A PDM behaves like an FSM wnen the number of auxiliary memory it has, is
A. 0
B. 1
C.2
D.none of these
Option: A
Explanation :
53:
A finite state machine with the following state table has a single input x and a single output z
A D, 0 B, 0 A. 01
B. 10
B B,1 C,1
C.10
C B, 0 D, 1 D.110
54:
A. all strings
B. no string
C. ε- alone
D.none of these
Option: C
Explanation :
55:
If f : {a, b}* ---> {a , b } * be given by f(n) = ax for every value of n ∈ {a, b}, then f is
Option: A
56:
Option: A
Explanation :
57:
B. (1 + 0 (0 + 10) 00)*
Option: A
Explanation :
58:
Option: C