Pdf24 Merged
Pdf24 Merged
2. Final state(s) may not be a part of the given states of a finite automaton.
a. True
b. False
c. Both
d. None of These
5. For any transition function δ and for any two input strings x and y, δ(q, xy) = _________
a. δ(q, x).δ(q, y)
b. δ(q, yx)
c. δ(q, x)×δ(q, y)
d. δ(δ(q, x),y)
1. c
2. b
3. b
4. a
5. d
6. d
7. c
8. a
9. a
10. c
11. c
12. b
3. The language of all words with atleast2 a's can be described by the Regular Expression
a. a(ab)*a
b. (a + b)*ab*a(a + b)*
c. b*ab*a(a + b)*
d. All of the above
6. ^+ RR*= ?
a. R
b. R*
c. R+
d. ^
7. If L= language of words containing even number of a’s. The corresponding Regular Expression is:
a. (a+b)*aa(a+b)*
b. (b+ab*a)*
c. a+bb*aab*a
d. (a+b)*ab(a+b)*
8. The language that can be expressed by any regular expression is called aNon-regular language.
a. True
b. False
9. Arden’s theorem states that if R = Q + RP, then _________is its unique solution.
a. R = QP*
b. R = PQ*
c. R = P*Q*
d. R = Q*P*
a. 01*01*
b. (01)*
c. 0*1*
d. 1*0*
1. a
2. a
3. d
4. d
5. c
6. b
7. b
8. b
9. a
10. c
11. a
12. a
7. Grammatical rules which do not involve the meaning of words are called:
a. Semantics
b. Syntactic
c. Both a and b
d. None of given
9. The symbols in a grammar that must be replaced by other things are called:
a. Productions
b. Terminals
c. Non-terminals
d. None of given
11. The terminals are designated by _____letters, while the non-terminals are designated by ____letters.
a. Capital, bold
b. Small, capital
c. Capital, small
d. Small, bold
1. b
2. a
3. c
4. c
5. d
6. a
7. b
8. b
9. c
10. a
11. b
12. d
This derivation is
a. a leftmost derivation
b. a rightmost derivation
c. both leftmost and rightmost derivation
d. neither leftmost nor rightmost derivation
6. Which of the following strings is not generated by the following grammar? S → SaSbS|ε
a. aabb
b. abab
c. aababb
d. aaabb
10. If S → aXb|b XaX → aX|bX|Λ. The given CFG generates the language in English
a. Beginning and ending in different letters
b. Beginning and ending in same letter
c. Having even-even language
d. None of given
11. The CFG is not said to be ambiguous if there exists atleast one word of itslanguage that can be
generated
by the different production trees,
a. TRUE
b. FALSE
1. d
2. c
3. d
4. b
5. b
6. d
7. d
8. c
9. b
10. a
11. b
12. c
9. T(A) = { w ϵ Σ* | (q0,w,Z0) ⊢* (qf, ^, α) for some qfϵ F and α ϵ τ*) defines acceptance of a PDA by:
a. Null Store
b. Final state
c. Null Set
d. Empty Store
10. N(A) = { w ϵ Σ* | (q0,w,Z0) ⊢* (q, ^, ^) for some qϵ Q) defines acceptance of a PDA by:
a. Null Store
b. Final state
c. Null Set
d. Final Store
12. For a given context free grammar, we can construct an equivalent Pushdown automata:
a. True
b. False
1. c
2. d
3. d
4. a
5. c
6. d
7. b
8. c
9. b
10. a
11. c
12. a
8. The read-write head in a Turing machine model can move only in one direction:
a. True
b. False
11. So as to move from one ID to another in a Turing machine, we use ________ symbol:
a. ⊢
b. :=
c. →
d. ⇒
1. a
2. d
3. b
4. c
5. d
6. c
7. b
8. b
9. a
10. c
11. a
12. b
UNIT-I: FINITE AUTOMATA
6. When next state of an automata at any instant of time is determined by the present state and the present
input, then it is called a:
a. State relation
b. Output relation
c. Set of states
d. Set of input symbols
1. C
2. A
3. A
4. D
5. B
6. A
7. B
8. B
9. B
10. B
11. A
12. A
2. To examine whether a certain FA accepts any words, it is required to seek the paths from _______state.
a. Final to initial
b. Final to final
c. Initial to final
d. Initial to initial
6. Identity: ^ + R = ________
a. ^
b. RR
c. R*
d. R
7. Identity: R + R = ________
a. 2R
b. RR
c. R
d. R*
10. CONVERSION OF NFA TO DFA WILL LEAD TO HOW MANY INITIAL STATES
A. 2
B. 1
C. NONE
D. BOTH
11. How many strings of length less than 4 contains the language described by the regular expression (x+y)*y(a+ab)*?
a) 7
b) 10
c) 12
d) 11
1. D 8. C
2. C 9. A
3. A 10. B
4. A 11. D
5. C 12. A
6. D
7. C
UNIT-III: FORMAL LANGUAGES AND REGULAR GRAMMARS
2. c 7. b 11. d
3. b 8. d 12. d
4. b
5. a 9. a
1. a 6. a 10. a
Unit 4 :CONTEXT FREE GRAMMARS + SIMPLIFICATION OF CONTEXT- FREE GRAMMARS
6. The derivation of the word W generated by a CFG, such that at each step,a production is applied to the left
most nonterminal in the working string is said to be
a. Left most terminal
b. Left most deviation
c. None of these
d. Both a and b
7. The process of finding the derivation of word generated by particular grammar is called :
a. PLUS TIMING
b. Parsing
c. HALT
d. All of above
5. b 10. B
1. a 6. b 11. C
2. a 7. b 12. d
3. b 8. d
4. c 9. C
Unit V: PUSHDOWN AUTOMATA AND PARSING
1. For a given Pushdown automata, we can construct an equivalent context free grammar:
a. True
b. False
2. In __________ parsing, we attempt to construct a derivation of the input string, starting from the root and ending
in the given input string.
a. Top-down
b. Top-Up
c. Bottom-Up
d. Bottom-Down
3. In __________ parsing, we attempt to construct a derivation from the given input string to the top ie, the root with
label S.
a. Top-down
b. Top-Up
c. Bottom-Up
d. Bottom-Down
6. In LL(k), k represents:
a. Number of symbols to look behind
b. Number of symbols to look ahead
c. Number of input symbols in the string
d. Number of symbols towards left of current symbol
8. In order to do top-down parsing for a general string in L(G), we prepare a table called:
a. Transition table
b. Parse Table
c. Top-down Table
d. Production Table
9. The transition a Push down automaton makes is additionally dependent upon the:
a) stack
b) input tape
c) terminals
d) none of the mentioned
10. With reference of a DPDA, which among the following do we perform from the start state with an empty stack?
a) process the whole string
b) end in final state
c) end with an empty stack
d) all of the mentioned
11. If the PDA does not stop on an accepting state and the stack is not empty, the string is:
a) rejected
b) goes into loop forever
c) both (a) and (b)
d) none of the mentioned
12. A language accepted by Deterministic Push down automata is closed under which of the following?
a) Complement
b) Union
c) Both (a) and (b)
d) None of the mentioned
1. a 7. b
2. a 8. b
3. c 9. a
4. d 10. d
5. b 11. a
6. b 12. a
Unit V1: TURING MACHINES AND COMPLEXITY
5. A ____________ is a theoretical computing machine invented by Alan Turing (1937) to serve as an idealized
model for mathematical calculation.
a. Linear Bounded Automata
b. Turing Machine
c. Finite Automata
d. Pushdown Automata
6. A Turing machine can run forever, enter a loop, or reach a particular state or set of conditions at which it is
prescribed to halt.
a. True
b. False
7. In computer science, a _______________is a Turing machine that can simulate an arbitrary Turing machine on
arbitrary input.
a. Universal Turing machine
b. Deterministic Turing machine
c. Non- Deterministic Turing machine
d. Multi-Tape Turing machine
10. Which of the following can accept even palindrome over {a,b}
a) Push down Automata
b) Turing machine
c) NDFA
d) All of the mentioned
11. If T1 and T2 are two turing machines. The composite can be represented using the expression:
a) T1T2
b) T1 U T2
c) T1 X T2
d) None of the mentioned
12. The number of states required to automate the last question i.e. {a,b}*{aba}{a,b}* using finite automata:
a) 4
b) 3
c) 5
d) 6
1. d
2. b
3. a
4. d
5. b
6. a
7. a
8. c
9. c
10. c
11. a
12. a
UNIT-I: FINITE AUTOMATA
15. A finite automata may contain more than one final states:
a. True
b. False
16. The number of columns in a transition table for a finite automata are:
a. Three
b. One less than the number of input symbols
c. Same as the number of input symbols
d. One more than the number of input symbols
18. When next state of an automata at any instant of time is determined by the present state and the present
input, then it is called a:
a. State relation
b. Output relation
c. Set of states
d. Set of input symbols
13. C
14. A
15. A
16. D
17. B
18. A
19. B
20. B
21. B
22. B
23. A
24. A
2. To examine whether a certain FA accepts any words, it is required to seek the paths from _______state.
e. Final to initial
f. Final to final
g. Initial to final
h. Initial to initial
6. Identity: ^ + R = ________
e. ^
f. RR
g. R*
h. R
7. Identity: R + R = ________
e. 2R
f. RR
g. R
h. R*
10. CONVERSION OF NFA TO DFA WILL LEAD TO HOW MANY INITIAL STATES
A. 2
B. 1
C. NONE
D. BOTH
11. How many strings of length less than 4 contains the language described by the regular expression (x+y)*y(a+ab)*?
a) 7
b) 10
c) 12
d) 11
13. D 20. C
14. C 21. A
15. A 22. B
16. A 23. D
17. C 24. A
18. D
19. C
UNIT-III: FORMAL LANGUAGES AND REGULAR GRAMMARS
19. The symbol used for step by step derivation of a grammar is:
a. →
b. ⇒
c. ↔
d. ⇄
e.
20. Language generated by grammar G = ( {S, C}, {a, b}, P, S ) where P consists of S → aCa, C → aCa | b is:
a. abna
b. anbnan
c. abnan
d. anban
21. Regular grammar is
a) Context free grammar
b) Non context free grammar
c) English grammar
d) None of the mentioned
22. Regular expression are
a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
23. L and ~L are recursive enumerable then L is
a) Regular
b) Context free
c) Context sensitive
d) Recursive
24. . Regular expressions are closed under
a) Union
b) Intersection
c) Kleene star
d) All of the mentioned
15. The productions of the form nonterminal → one nonterminal, is called _________
e. Null production
f. Unit production
g. Null able production
h. None of given
18. The derivation of the word W generated by a CFG, such that at each step,a production is applied to the left
most nonterminal in the working string is said to be
a. Left most terminal
b. Left most deviation
c. None of these
d. Both a and b
19. The process of finding the derivation of word generated by particular grammar is called :
a. PLUS TIMING
b. Parsing
c. HALT
d. All of above
17. b 22. B
13. a 18. b 23. C
14. a 19. b 24. d
15. b 20. d
16. c 21. C
Unit V: PUSHDOWN AUTOMATA AND PARSING
1. For a given Pushdown automata, we can construct an equivalent context free grammar:
c. True
d. False
2. In __________ parsing, we attempt to construct a derivation of the input string, starting from the root and ending
in the given input string.
e. Top-down
f. Top-Up
g. Bottom-Up
h. Bottom-Down
3. In __________ parsing, we attempt to construct a derivation from the given input string to the top ie, the root with
label S.
e. Top-down
f. Top-Up
g. Bottom-Up
h. Bottom-Down
6. In LL(k), k represents:
e. Number of symbols to look behind
f. Number of symbols to look ahead
g. Number of input symbols in the string
h. Number of symbols towards left of current symbol
8. In order to do top-down parsing for a general string in L(G), we prepare a table called:
e. Transition table
f. Parse Table
g. Top-down Table
h. Production Table
9. The transition a Push down automaton makes is additionally dependent upon the:
a) stack
b) input tape
c) terminals
d) none of the mentioned
10. With reference of a DPDA, which among the following do we perform from the start state with an empty stack?
a) process the whole string
b) end in final state
c) end with an empty stack
d) all of the mentioned
11. If the PDA does not stop on an accepting state and the stack is not empty, the string is:
a) rejected
b) goes into loop forever
c) both (a) and (b)
d) none of the mentioned
12. A language accepted by Deterministic Push down automata is closed under which of the following?
a) Complement
b) Union
c) Both (a) and (b)
d) None of the mentioned
13. a 19. b
14. a 20. b
15. c 21. a
16. d 22. d
17. b 23. a
18. b 24. a
Unit V1: TURING MACHINES AND COMPLEXITY
5. A ____________ is a theoretical computing machine invented by Alan Turing (1937) to serve as an idealized
model for mathematical calculation.
e. Linear Bounded Automata
f. Turing Machine
g. Finite Automata
h. Pushdown Automata
6. A Turing machine can run forever, enter a loop, or reach a particular state or set of conditions at which it is
prescribed to halt.
c. True
d. False
7. In computer science, a _______________is a Turing machine that can simulate an arbitrary Turing machine on
arbitrary input.
e. Universal Turing machine
f. Deterministic Turing machine
g. Non- Deterministic Turing machine
h. Multi-Tape Turing machine
10. Which of the following can accept even palindrome over {a,b}
a) Push down Automata
b) Turing machine
c) NDFA
d) All of the mentioned
11. If T1 and T2 are two turing machines. The composite can be represented using the expression:
a) T1T2
b) T1 U T2
c) T1 X T2
d) None of the mentioned
12. The number of states required to automate the last question i.e. {a,b}*{aba}{a,b}* using finite automata:
a) 4
b) 3
c) 5
d) 6
15. a 22. c
16. d 23. a
17. b 24. a
18. a
19. a
13. d 20. c
14. b 21. c
Q1 Which of the following pairs of regular expressions are equivalent?
a) 1(01)* and (10)*1
b) x (xx)* and (xx)*x
c) x^+ and x^+ x^(*+)
d) All of the mentioned
Q3
Ans. C
Q4
Ans. A
Q5
Ans. B
Q6
Ans. A
Ans.A
a. {xy,xy}
b. {xx,xy,yx,yy}
c. {x,y}
d. {x,y,xy}
Ans.b
Q9 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*
Ans. B
Ans. D
Q11
a. (0+1)*001(0+1)*
b. 1*001(0+1)*
c. (01)*(0+0+1)(01)*
d. None of the mentioned
Ans. A
Q12
Which of the given regular expressions correspond to the automata shown?
a. (110+1)*0
b. (11+110)*1
c. (110+11)*0
d. (1+110)*1
Ans. C
Q13 Which among the following looks similar to the given expression?
((0+1). (0+1)) *
Ans. A
a. (a +b) *c
b. (a)+((b)*.c)
c. (a + (b*)).c
d. a+ ((b*).c)
Ans. D
Q15
a(bab)*∪a(ba)*
Ans. a
ans. C
1. There are ________ tuples in finite state machine.
a) 4
b) 5
c) 6
d) unlimited
Ans:- B
a. Always
b. Sometimes
c.Never
d. Depends on NFA
Ans:-a
a. >
b.<
c.=
d.<=
Ans:- c
a. A B
b. C
c. C D
d. D A
Ans:- C
a. Q X Σ→Q
b. Q X Σ→2Q
c. Q X Σ→2n
d.Q X Σ→Qn
Ans:- B
Ans:- C
12. Which among the following states would be notated as the final
state/acceptance state?
b. q2
c. q1, q2
d. q3
Ans:- b
13. Which of the following are the final states in the given DFA according to the
Language given ?
L= {xϵ∑= {a, b} |length of x is at most 2}
a. q0, q1
b. q0, q2
c.q1, q2
d. q0, q1, q2
Ans:D
14. Which of the following x is accepted by the given DFA (x is a binary string ∑=
{0,1})?
a. divisible by 3
b. divisible by 2
c. divisible by 2 and 3
d. divisible by 3 and 2
Ans:- d
Statement: The DFA shown represents all strings which has 1 at second last
position.
a. Correct
c. Wrong proposition
d. May be correct
MCQ’s on regular languages and regular expressions
a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
2. Regular grammar is
c) english grammar
a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
4. Consider the languages L1=ɸ and L2 = {a}. Which one of the following represents L1 L2* U L1*
a) A
b) B
c) C
d) D
5. 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
6. Let w be any string of length n is {0,1}*. Let L be the set of all substrings of w. What is the
minimum number of states in a non-deterministic finite automaton that accepts L?
a) n-1
b) n
c) n+1
d) 2n-1
7. 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) (1*0)*1*
b) 0 + (0 + 10)*
c) (0 + 1)* 10(0 + 1)*
d) none of these
9. The smallest finite automation which accepts the language {x | length of x is divisible by 3}
has :
a) 2 states
b) 3 states
c) 4 states
d) 5 states
10. Consider the following languages
Answer: A
Q2)
Q3) Given the language L = {ab, aa, baa}, which of the following strings are in L*?
1) abaabaaabaa
2) aaaabaaaa
3) baaaaabaaaab
4) baaaaabaa
Answer : 1,2,4
Answer: b*(aa*(bb*+∈)+∈)
Q9) A regular language over an alphabet a is one that can be obtained from
a) union
b) concatenation
c) kleene
d) All of the mentioned
Answer: d
Q10)
Answer:A
MCQs based on NDFA to DFA Conversion:
1. Can we convert a Non-Deterministic Finite Automata to a Deterministic Finite Automata?
a. No
b. Yes
2. While converting an NDFA to a DFA, the set of input symbols in DFA are:
a. Same as that of NDFA
b. Different from the given NDFA
3. When we convert an NDFA to a DFA, the number of states in the DFA ____________
a. Would remain same
b. Not necessarily remain the same
4. For the following NDFA, what would be the states in a corresponding DFA?
a. [q0]
b. [q0], [q1]
c. [q0], [q0, q1]
d. [q0], [q1], [q0, q1]
5. “DFA is said to be a specific case of NDFA and for every NDFA that exists for a given
language, an equivalent DFA also exists”. The statement is True or False?
a. True
b. False
8. Let P and Q be two regular expressions over Σ. If P does not contain ^, then according to
Arden’s theorem, R = Q + RP has a unique solution given by _________________
a. R = QP*
b. R = Q + P*
c. R = Q*P
d. R = Q + P
9. By using Arden’s Theorem, the equation q1 = q1(ab + ba) + ^ can be written as,
a. q1= (a+ b)*
b. q1= (abba)*
c. q1= (ab + ba)*
d. q1= (ab)*
13. The regular expression corresponding to the equation q2 = 0*1 + q2(1) when an Arden’s
Theorem is applied is ______________
a. (0*1)1*
b. (00)*
c. (11)*
d. 0*1*
14. Which of the following is useful for converting a finite automaton into a regular expression?
a. Null Moves
b. Kleen’s Closure
c. Transition Function
d. Arden’s Theorem
15. Recognize the regular expression corresponding to the following Finite Automata using
Arden’s Method:
a. 0*1*
b. (0 + 1)*
c. (1101)*
d. (0 + 11 + 010)*
UNIT-1
MCQ
Mealy and Moore Machine
1. An automata in which output depends only on the states of the machine is called
a) An automaton without a Memory
b) Automaton with a finite Memory
c) Moore Machine
d) Mealy Machine
2. An automata in which output depends only on the states as well as on the input at any
instant of time is called
a) An automaton without a Memory
b) Automaton with a finite Memory
c) Moore Machine
d) Mealy Machine
3. The Finite state machine described by the following state diagram with A as starting
state, where an arc label is x / y and x stands for 1-bit input and y stands for 2- bit output
[ GATE CS 2002]
a) Outputs the sum of the present and the previous bits of the input.
b) Outputs 01 whenever the input sequence contains 11.
c) Outputs 00 whenever the input sequence contains 10.
d) None of these
Explanation:
We assume the input string to be 1101.
1. (A, 1) –> (B, 01)
Here, previous input bit + present input bit = 0 + 1 = 01 = output
2. (B, 1) –> (C, 10)
Here, previous input bit + present input bit = 1 + 1 = 10 = output
3. (C, 0) –> (A, 01)
Here, previous input bit + present input bit = 1 + 0 = 01 = output
4. (A, 1) –> (B, 01)
Here, previous input bit + present input bit = 0 + 1 = 01 = output
Thus, option (A) is correct.
4. In Moore Machine, suppose if Input=’101’, then the output would be of length:
a) |Input|+1
b) |Input|
c) |Input-1|
d) Cannot be predicted
Explanation:
Initial state, from which the operations begin is also initialized with a value.
7. Find output string for the input string 0111 from the following Moore Machine
a) 00010
b) 10110
c) 11111
d) 10101
8. Find output string for the input string 1111 from the following Moore Machine
a) 01000
b) 00110
c) 11111
d) 10101
9. Find output string for the input 0010 from the following Mealy machine
a) 9’s Complement
b) 2’s Complement
c) 1’s Complement
d) 10’s Complement
Answer: b
11. The major difference between Mealy and Moore machine is about:
a) Output Variations
b) Input Variations
c) Both
d) None of the mentioned
View Answer
12. Which of the following does the given Mealy machine represents?
a) 9’s Complement
b) 2’s Complement
c) 1’s Complement
d) 10’s Complement
14. According to Moore circuit, the output of synchronous sequential circuit depend/s on ______
of flip flop
a. Past state
b. Present state
c. Next state
d. External inputs
15. Find the correct answer after, converting the following Mealy to Moore machine
a)
Present State Next State Output
a=0 a=1
->q1 q3 q20 0
q20 q1 q4 0
q21 q1 q4 1
q3 q21 q1 0
q4 q4 q3 1
b)
c)
Present State Next State Output
a=0 a=1
->q1 q3 q20 1
q20 q1 q4 0
q21 q1 q4 1
q3 q21 q1 1
q4 q4 q3 1
d)
ans a
3.Which DFA is accept the string in which every a is followed by b where Σ = {a,b} .
a)
b)
c)
d) None of these
4.
9.)Consider the finite automaton in the following figure. What is the set of reachable states for the input string 0011 ?
a. q0, q1,q2
b. q0,q1
c. q0,q1,q2,q3
d. q3
8)Statement 1: Acceptance of string only when it goes to first state to final state .
a) D b) A c) B d) C
a) q2 b) q3 c) q1 d) q4
b){A,F},{B},{C,D,E}
D){A,B,F){C,D,E}
13.) 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
14.)Let w be any string of length n is {0,1}*. Let L be the set of all substrings of w. What is the minimum
number of states in a non-deterministic finite automaton that accepts L?
A )n-1
b)n
c)n+1
D)2n-1
a) an
b) anbn
c) anbncn
1) a ,b 2) c 3) a,b,c 4) a
1. A language is regular if and only if
a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
d) accepted by Turing machine
Answer- a
2. Regular grammar is
a. context free grammar
b. non context free grammar
c. English grammar
d. none of the mentioned
Answer- a
a. Type 0 language
b. Type 1 language
c. Type 2 language
d. Type 3 language
a. Concatenation
b. Union
c. Complement
Answer- d
5. If L1 is regular, then there exists some regular expression r1 which describes it. Same for L2.
Then:L1 U L2 = L(r1) U L(r2) = r1 + r2
a. True
b. False
Answer : a
6. If L1 = {an | n ≥ 0} and L2 = {bn | n ≥ 0} is regular
then L3 = L1.L2 = {am . bn | m ≥ 0 and n ≥ 0} is also regular?
a. False
b True
Answer b
7. Which one of the following languages over the alphabet {0,1} is described by the regular
expression?
(0+1)*0(0+1)*0(0+1)*
a. The set of all strings containing the substring 00.
b. The set of all strings containing at most two 0’s.
Answer c
a. Regular expression
b. Type 0 Language
c. English Grammer
Answer a
Answer d
10. Regular expressions are used to represent which language
a) Recursive language
c) Regular language
d) All of these
Answer c
a) Union
b) Concatenation
c) Closure
d) All of these
answer d
a) R + R = R
b) (R*)* = R*
c) ɛR = Rɛ = R
d) ØR = RØ = RR*
Answer d
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
d) All of these
Answer d
a) ɛ +RR* = R* = ɛ + R*R
b) (R1R2)*R1 = R1(R2R1)*
c) R*R* = R*
d) All of these
Answer b
16. Consider a finite automaton, with A-moves, given in Fig. which among the following is the
Equivalent automaton without A-moves.
a.
b.
c.
d. None of above
Answer a
17. Suppose we want to replace a null move from vertex V1 to vertex V2 in FA Then
What is the first step needs to be done:
a. Make a new vertex V3
b. Find all the edges starting from v2
c. Delete Vertex V2
d. None of the above
Answer b
1. Which of the following does not represents the given language?
Language: {0,01}
a) 0+01
b) {0} U {01}
c) {0} U {0}{1}
d) {0} ^ {01}
Answer d
2. According to the given language, which among the following expressions does it corresponds to?
Language L={xϵ{0,1}|x is of length 4 or less}
a) (0+1+0+1+0+1+0+1)4
b) (0+1)4
c) (01)4
d) (0+1+ε)4
answer D
answer b
5. If language is { ^, a, aa,aaa, aaaa, aaaa, aaaaa,aaaaaa,........} then what will be the regular
expression
1. {a}*
2. {a}+
3. {a}
4. none of these
Answer :- 1
6. If language is { a, aa,aaa, aaaa, aaaa, aaaaa,aaaaaa,........} then what will be the regular
expression
1. {a}*
2. {a}+
3. {a}
4. none of these
Answer 2
7. if the language is {ac, abc, abbc, ...........} then what will be the regular expression.
a. ab*c
b. a*bc
c. a*b*c
d. abc*
Answer a
a. b(c+ab)*d
b. b(c+ab)d*
c. b(c+ab)*d*
d. b*(c+ab)*d*
answer a
9. Plus Operation refers to which of the following set operations:
a) Union
b) Dot
c) Kleene
d) Two of the options are correct
Answer a
10.) what will be the langauge for this regular expression (a+b)*.
a) any string of a,b is possible including null
b) any string of a,b is possible not including null
c) string starts with a and ends b is possible
d) none of these
answer B
Answer A
16) what will be the regular expression for language in which of all strings containing exaxctly
2a’s.
a) b*ab*ab*
b) ab*ab*
c) (a+b)*aa(a+b)*
d) none of these
Answer a
17) find the regular expression for
ambncp where m,n,p >=1
a) aa*bb*cc*
b) aa*b*c*
c) a*b*c*
d) none of these
Answer a
Answer C
answer B
answer c
A context sensitive language is accepted by
a) Finite automata
b) Linear bounded automata
c) Both (a) and (b)
d) None of these
Ans- B
Ans-A
Ans- B
Ans-a
Ans- B
Which of the following strings do not belong the given regular expression?
(a)*(a+cba)
a) aa
b) aaa
c) acba
d) acbacba
Ans-d
A.S --> Sa | b
D.None of these
Ans-B
a. FA
b. LBA
c. Turing Machine
d. All
S→XaaX
X→aX| bX|Λ
Then the above grammar defines the language expressed by___________ regular expression
a. (a+b)*aa(a+b)*
b. (a+b)*a(a+b)*a
c. (a+b)*aa(a+b)*aa
d. (a+b)*aba+b)*
Ans-A
A. REGULAR LANGUAGES
B. CONTEXT FREE
C. CONTEXT SENSITIVE
D. NONE.
Ans- C
Q Regular grammar is
a) Context free grammar
b) Non context free grammar
c) English grammar
d) None of the mentioned
Ans- A
Regular expression are
a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
Ans- A
L and ~L are recursive enumerable then L is
a) Regular
b) Context free
c) Context sensitive
d) Recursive
Ans-D
Regular expressions are closed under
a) Union
b) Intersection
c) Kleene star
d) All of the mentioned
Ans-d
How many strings of length less than 4 contains the language described by the regular expression
(x+y)*y(a+ab)*?
a) 7
b) 10
c) 12
d) 11
Ans-D
Grammatical rules which do not involve the meaning of words are called:
a. Semantics
b. Syntactic
c. Both a and b
d. None of given
Ans-B
The symbols in a grammar that must be replaced by other Synbols are called:
a. Productions
b. Terminals
c. Non-terminals
d. None of given
Ans-C
Q1. Consider the languages L1 = ᶲ and L2 = {a}. Which one of the following represents
L1 L2* U L1
a) {€} b)ᶲ c) a* d) {€,a}
Q2. Let S and T be language over ={a,b} represented by the regular expressions (a+b*)*
and (a+b)*, respectively. Which of the following is true?
(a) ScT (S is a subset of T)
(b) TcS (T is a subset of S)
(c) S=T
(d) SnT=Ø
Q3. Let L denotes the language generated by the grammar S – OSO/00. Which of the
following is true?
(a) L = O
(b) L is regular but not O
(c) L is context free but not regular
(d) L is not context free
Q4. Consider the following two statements:
S1: { 0^2n |n >= l} is a regu1ar language
S2: { 0^m 0^n 0^(m+n) l m >= 1 and n >= 2} is a regu1ar language
Which of the following statements is correct? (GATE CS 2001)
a) Only S1 is correct
b) Only S2 is correct
c) Both S1 and S2 are correct
d) None of S1 and S2 is correct
Q5. Which of the following statements in true? (GATE CS 2001)
(a) If a language is context free it can always be accepted by a deterministic push-down
automaton
(b) The union of two context free languages is context free
(c) The intersection of two context free languages is context free
(d) The complement of a context free language is context free
Q6. Given an arbitrary non-deterministic finite automaton (NFA) with N states, the
maximum number of states in an equivalent minimized DFA is at least. (GATE CS 2001)
(a) N^2
(b) 2^N
(c) 2N
(d) N!
Q7. Given the language L = {ab, aa, baa}, whih 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
8. Which of the following problems are decidable?
….1) Does a given program ever produce an output?
….2) If L is a context-free language, then is L’ (complement of L) also context-free?
….3) If L is a regular language, then is L’ also regular?
….4) If L is a recursive language, then, is L’ also recursive?
(A) 1, 2, 3, 4
(B) 1, 2,
(C) 2, 3, 4
(D) 3, 4
9. Let P be a regular language and Q be context-free language such that Q ⊆ P. (For
example, let P be the language represented by the regular expression p*q* and Q be
{pnqn|n ∈ N}). Then which of the following is ALWAYS regular?
(A) P ∩ Q
(B) P – Q
(C) ∑* – P
(D) ∑* – Q
10. (a+b)* is equivalent to
a) b*a*
b) (a*b*)*
c) a*b*
d) none of the mentioned
11. a? is equivalent to
a) a
b) a+Φ
c) a+ϵ
d) wrong expression
12. Regular expression Φ* is equivalent to
a) ϵ
b) Φ
c) 0
d) 1
13. A language is regular if and only if
a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
d) accepted by Turing machine
14. 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 U L2 = .*
d) L1=L2
15. Regular expression {0,1} is equivalent to
a) 0 U 1
b) 0 / 1
c) 0 + 1
d) All of the mentioned
TOC mcq
Definition and description of FA:
1. NFA, in its name has ’non-deterministic’ because of :
a) The result is undetermined
b) The choice of path is non-deterministic
c) The state to be transited next is non-deterministic
d) All of the mentioned
Answer: b
2. Languages of a automata is
a) If a string is accepted by automata
b) If it halts
c) If automata touch final state in its life time
d) All language are language of automata
Answer: a
8. Which DFA is correct for the given Language: accepting string ending with '01' over input alphabets
∑={a.b}
a) b) c) d) None of these
Ans c
9. How many Final states in the given language : {an | where n >=1 but n ≠ 2,6 } , Σ= {a}
a) 2 b) 4 c) 3 d) 6
Ans b)
10. Transition function maps.
a) Σ * Q -> Σ
b) Q * Q -> Σ
c) Σ * Σ -> Q
d) Q * Σ -> Q Ans d)
11. Finite automata has only
a) Finite memory
b) Read only head
c) Finite control
d) All of them Ans d)
14. Which NFA is correct for the transition table as given below:
Present State 0 1
a) b)
15. Given a NFA with N states, the maximum number of states in an equivalent minimized DFA is at least
a) N^2
b) 2^N
c) 2N
d) N! Ans b)
1. Transition function of DFA maps.
a) Σ * Q -> Σ
b) Q * Q -> Σ
c) Σ * Σ -> Q
d) Q * Σ -> Q
Answer: d
Answer: a
3. δ*(q,ya) is equivalent to .
a) δ((q,y),a)
b) δ(δ*(q,y),a)
c) δ(q,ya)
d) independent from δ notation
Answer: b
4. Languages of a automata is
a) If it is accepted by automata
b) If it halts
c) If automata touch final state in its life time
d) All language are language of automata
Answer: a
5. Finite automata requires minimum _______ number of stacks.
a) 1
b) 0
c) 2
d) None of the mentioned
Answer: b
6. FSM with output capability can be used to add two given integer in binary representation.
This is
a) True
b) False
c) May be true
d) None of the mentioned
Answer: a
7. If NFA of 6 states excluding the initial state is converted into DFA, maximum possible
number of states for the DFA is ?
a) 64
b) 32
c) 128
d) 127
Answer: c
8. NFA, in its name has ’non-deterministic’ because of :
a) The result is undetermined
b) The choice of path is non-deterministic
c) The state to be transited next is non-deterministic
d) All of the mentioned
Answer: b
9. The construction time for DFA from an equivalent NFA (m number of node)is:
a) O(m2)
b) O(2m)
c) O(m)
d) O(log m)
Answer: b
10. Which of the following option is correct?
a) NFA is slower to process and its representation uses more memory than DFA
b) DFA is faster to process and its representation uses less memory than NFA
c) NFA is slower to process and its representation uses less memory than DFA
d) DFA is slower to process and its representation uses less memory than NFA
Answer: c
11. Choose the correct option for the given statement:
Statement: The DFA shown represents all strings which has 1 at second last position.
a) Correct
b) Incorrect, Incomplete DFA
c) Wrong proposition
d) May be correct
Answer: c
12.
Transition Function – mcq’s
Answer: c
a. A Boolean value
b. A state
c. A set of states
d. An edge
answer: c
a) Correct
b) Incorrect, Incomplete DFA
c) Wrong proposition
d) May be correct
Answer: c ( bcz it is nfa)
Q7. Which of the following is a not a part of 5-tuple finite automata?
a) Input alphabet
b) Transition function
c) Initial State
d) Output Alphabet
Answer: d
Q3
Ans. C
Q4
Ans. A
Q5
Ans. B
Q6
Ans. A
Ans.A
a. {xy,xy}
b. {xx,xy,yx,yy}
c. {x,y}
d. {x,y,xy}
Ans.b
Q9 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*
Ans. B
Ans. D
Q11
a. (0+1)*001(0+1)*
b. 1*001(0+1)*
c. (01)*(0+0+1)(01)*
d. None of the mentioned
Ans. A
Q12
Which of the given regular expressions correspond to the automata shown?
a. (110+1)*0
b. (11+110)*1
c. (110+11)*0
d. (1+110)*1
Ans. C
Q13 Which among the following looks similar to the given expression?
((0+1). (0+1)) *
Ans. A
a. (a +b) *c
b. (a)+((b)*.c)
c. (a + (b*)).c
d. a+ ((b*).c)
Ans. D
Q15
a(bab)*∪a(ba)*
Ans. a
ans. C
1. There are ________ tuples in finite state machine.
a) 4
b) 5
c) 6
d) unlimited
Ans:- B
a. Always
b. Sometimes
c.Never
d. Depends on NFA
Ans:-a
a. >
b.<
c.=
d.<=
Ans:- c
a. A B
b. C
c. C D
d. D A
Ans:- C
a. Q X Σ→Q
b. Q X Σ→2Q
c. Q X Σ→2n
d.Q X Σ→Qn
Ans:- B
Ans:- C
12. Which among the following states would be notated as the final
state/acceptance state?
b. q2
c. q1, q2
d. q3
Ans:- b
13. Which of the following are the final states in the given DFA according to the
Language given ?
L= {xϵ∑= {a, b} |length of x is at most 2}
a. q0, q1
b. q0, q2
c.q1, q2
d. q0, q1, q2
Ans:D
14. Which of the following x is accepted by the given DFA (x is a binary string ∑=
{0,1})?
a. divisible by 3
b. divisible by 2
c. divisible by 2 and 3
d. divisible by 3 and 2
Ans:- d
Statement: The DFA shown represents all strings which has 1 at second last
position.
a. Correct
c. Wrong proposition
d. May be correct
MCQ’s on regular languages and regular expressions
a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
2. Regular grammar is
c) english grammar
a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
4. Consider the languages L1=ɸ and L2 = {a}. Which one of the following represents L1 L2* U L1*
a) A
b) B
c) C
d) D
5. 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
6. Let w be any string of length n is {0,1}*. Let L be the set of all substrings of w. What is the
minimum number of states in a non-deterministic finite automaton that accepts L?
a) n-1
b) n
c) n+1
d) 2n-1
7. 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) (1*0)*1*
b) 0 + (0 + 10)*
c) (0 + 1)* 10(0 + 1)*
d) none of these
9. The smallest finite automation which accepts the language {x | length of x is divisible by 3}
has :
a) 2 states
b) 3 states
c) 4 states
d) 5 states
10. Consider the following languages
Answer: A
Q2)
Q3) Given the language L = {ab, aa, baa}, which of the following strings are in L*?
1) abaabaaabaa
2) aaaabaaaa
3) baaaaabaaaab
4) baaaaabaa
Answer : 1,2,4
Answer: b*(aa*(bb*+∈)+∈)
Q9) A regular language over an alphabet a is one that can be obtained from
a) union
b) concatenation
c) kleene
d) All of the mentioned
Answer: d
Q10)
Answer:A
MCQs based on NDFA to DFA Conversion:
1. Can we convert a Non-Deterministic Finite Automata to a Deterministic Finite Automata?
a. No
b. Yes
2. While converting an NDFA to a DFA, the set of input symbols in DFA are:
a. Same as that of NDFA
b. Different from the given NDFA
3. When we convert an NDFA to a DFA, the number of states in the DFA ____________
a. Would remain same
b. Not necessarily remain the same
4. For the following NDFA, what would be the states in a corresponding DFA?
a. [q0]
b. [q0], [q1]
c. [q0], [q0, q1]
d. [q0], [q1], [q0, q1]
5. “DFA is said to be a specific case of NDFA and for every NDFA that exists for a given
language, an equivalent DFA also exists”. The statement is True or False?
a. True
b. False
8. Let P and Q be two regular expressions over Σ. If P does not contain ^, then according to
Arden’s theorem, R = Q + RP has a unique solution given by _________________
a. R = QP*
b. R = Q + P*
c. R = Q*P
d. R = Q + P
9. By using Arden’s Theorem, the equation q1 = q1(ab + ba) + ^ can be written as,
a. q1= (a+ b)*
b. q1= (abba)*
c. q1= (ab + ba)*
d. q1= (ab)*
13. The regular expression corresponding to the equation q2 = 0*1 + q2(1) when an Arden’s
Theorem is applied is ______________
a. (0*1)1*
b. (00)*
c. (11)*
d. 0*1*
14. Which of the following is useful for converting a finite automaton into a regular expression?
a. Null Moves
b. Kleen’s Closure
c. Transition Function
d. Arden’s Theorem
15. Recognize the regular expression corresponding to the following Finite Automata using
Arden’s Method:
a. 0*1*
b. (0 + 1)*
c. (1101)*
d. (0 + 11 + 010)*
UNIT-1
MCQ
Mealy and Moore Machine
1. An automata in which output depends only on the states of the machine is called
a) An automaton without a Memory
b) Automaton with a finite Memory
c) Moore Machine
d) Mealy Machine
2. An automata in which output depends only on the states as well as on the input at any
instant of time is called
a) An automaton without a Memory
b) Automaton with a finite Memory
c) Moore Machine
d) Mealy Machine
3. The Finite state machine described by the following state diagram with A as starting
state, where an arc label is x / y and x stands for 1-bit input and y stands for 2- bit output
[ GATE CS 2002]
a) Outputs the sum of the present and the previous bits of the input.
b) Outputs 01 whenever the input sequence contains 11.
c) Outputs 00 whenever the input sequence contains 10.
d) None of these
Explanation:
We assume the input string to be 1101.
1. (A, 1) –> (B, 01)
Here, previous input bit + present input bit = 0 + 1 = 01 = output
2. (B, 1) –> (C, 10)
Here, previous input bit + present input bit = 1 + 1 = 10 = output
3. (C, 0) –> (A, 01)
Here, previous input bit + present input bit = 1 + 0 = 01 = output
4. (A, 1) –> (B, 01)
Here, previous input bit + present input bit = 0 + 1 = 01 = output
Thus, option (A) is correct.
4. In Moore Machine, suppose if Input=’101’, then the output would be of length:
a) |Input|+1
b) |Input|
c) |Input-1|
d) Cannot be predicted
Explanation:
Initial state, from which the operations begin is also initialized with a value.
7. Find output string for the input string 0111 from the following Moore Machine
a) 00010
b) 10110
c) 11111
d) 10101
8. Find output string for the input string 1111 from the following Moore Machine
a) 01000
b) 00110
c) 11111
d) 10101
9. Find output string for the input 0010 from the following Mealy machine
a) 9’s Complement
b) 2’s Complement
c) 1’s Complement
d) 10’s Complement
Answer: b
11. The major difference between Mealy and Moore machine is about:
a) Output Variations
b) Input Variations
c) Both
d) None of the mentioned
View Answer
12. Which of the following does the given Mealy machine represents?
a) 9’s Complement
b) 2’s Complement
c) 1’s Complement
d) 10’s Complement
14. According to Moore circuit, the output of synchronous sequential circuit depend/s on ______
of flip flop
a. Past state
b. Present state
c. Next state
d. External inputs
15. Find the correct answer after, converting the following Mealy to Moore machine
a)
Present State Next State Output
a=0 a=1
->q1 q3 q20 0
q20 q1 q4 0
q21 q1 q4 1
q3 q21 q1 0
q4 q4 q3 1
b)
c)
Present State Next State Output
a=0 a=1
->q1 q3 q20 1
q20 q1 q4 0
q21 q1 q4 1
q3 q21 q1 1
q4 q4 q3 1
d)
ans a
3.Which DFA is accept the string in which every a is followed by b where Σ = {a,b} .
a)
b)
c)
d) None of these
4.
9.)Consider the finite automaton in the following figure. What is the set of reachable states for the input string 0011 ?
a. q0, q1,q2
b. q0,q1
c. q0,q1,q2,q3
d. q3
8)Statement 1: Acceptance of string only when it goes to first state to final state .
a) D b) A c) B d) C
a) q2 b) q3 c) q1 d) q4
b){A,F},{B},{C,D,E}
D){A,B,F){C,D,E}
13.) 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
14.)Let w be any string of length n is {0,1}*. Let L be the set of all substrings of w. What is the minimum
number of states in a non-deterministic finite automaton that accepts L?
A )n-1
b)n
c)n+1
D)2n-1
a) an
b) anbn
c) anbncn
1) a ,b 2) c 3) a,b,c 4) a
1. A language is regular if and only if
a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
d) accepted by Turing machine
Answer- a
2. Regular grammar is
a. context free grammar
b. non context free grammar
c. English grammar
d. none of the mentioned
Answer- a
a. Type 0 language
b. Type 1 language
c. Type 2 language
d. Type 3 language
a. Concatenation
b. Union
c. Complement
Answer- d
5. If L1 is regular, then there exists some regular expression r1 which describes it. Same for L2.
Then:L1 U L2 = L(r1) U L(r2) = r1 + r2
a. True
b. False
Answer : a
6. If L1 = {an | n ≥ 0} and L2 = {bn | n ≥ 0} is regular
then L3 = L1.L2 = {am . bn | m ≥ 0 and n ≥ 0} is also regular?
a. False
b True
Answer b
7. Which one of the following languages over the alphabet {0,1} is described by the regular
expression?
(0+1)*0(0+1)*0(0+1)*
a. The set of all strings containing the substring 00.
b. The set of all strings containing at most two 0’s.
Answer c
a. Regular expression
b. Type 0 Language
c. English Grammer
Answer a
Answer d
10. Regular expressions are used to represent which language
a) Recursive language
c) Regular language
d) All of these
Answer c
a) Union
b) Concatenation
c) Closure
d) All of these
answer d
a) R + R = R
b) (R*)* = R*
c) ɛR = Rɛ = R
d) ØR = RØ = RR*
Answer d
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
d) All of these
Answer d
a) ɛ +RR* = R* = ɛ + R*R
b) (R1R2)*R1 = R1(R2R1)*
c) R*R* = R*
d) All of these
Answer b
16. Consider a finite automaton, with A-moves, given in Fig. which among the following is the
Equivalent automaton without A-moves.
a.
b.
c.
d. None of above
Answer a
17. Suppose we want to replace a null move from vertex V1 to vertex V2 in FA Then
What is the first step needs to be done:
a. Make a new vertex V3
b. Find all the edges starting from v2
c. Delete Vertex V2
d. None of the above
Answer b
1. Which of the following does not represents the given language?
Language: {0,01}
a) 0+01
b) {0} U {01}
c) {0} U {0}{1}
d) {0} ^ {01}
Answer d
2. According to the given language, which among the following expressions does it corresponds to?
Language L={xϵ{0,1}|x is of length 4 or less}
a) (0+1+0+1+0+1+0+1)4
b) (0+1)4
c) (01)4
d) (0+1+ε)4
answer D
answer b
5. If language is { ^, a, aa,aaa, aaaa, aaaa, aaaaa,aaaaaa,........} then what will be the regular
expression
1. {a}*
2. {a}+
3. {a}
4. none of these
Answer :- 1
6. If language is { a, aa,aaa, aaaa, aaaa, aaaaa,aaaaaa,........} then what will be the regular
expression
1. {a}*
2. {a}+
3. {a}
4. none of these
Answer 2
7. if the language is {ac, abc, abbc, ...........} then what will be the regular expression.
a. ab*c
b. a*bc
c. a*b*c
d. abc*
Answer a
a. b(c+ab)*d
b. b(c+ab)d*
c. b(c+ab)*d*
d. b*(c+ab)*d*
answer a
9. Plus Operation refers to which of the following set operations:
a) Union
b) Dot
c) Kleene
d) Two of the options are correct
Answer a
10.) what will be the langauge for this regular expression (a+b)*.
a) any string of a,b is possible including null
b) any string of a,b is possible not including null
c) string starts with a and ends b is possible
d) none of these
answer B
Answer A
16) what will be the regular expression for language in which of all strings containing exaxctly
2a’s.
a) b*ab*ab*
b) ab*ab*
c) (a+b)*aa(a+b)*
d) none of these
Answer a
17) find the regular expression for
ambncp where m,n,p >=1
a) aa*bb*cc*
b) aa*b*c*
c) a*b*c*
d) none of these
Answer a
Answer C
answer B
answer c
A context sensitive language is accepted by
a) Finite automata
b) Linear bounded automata
c) Both (a) and (b)
d) None of these
Ans- B
Ans-A
Ans- B
Ans-a
Ans- B
Which of the following strings do not belong the given regular expression?
(a)*(a+cba)
a) aa
b) aaa
c) acba
d) acbacba
Ans-d
A.S --> Sa | b
D.None of these
Ans-B
a. FA
b. LBA
c. Turing Machine
d. All
S→XaaX
X→aX| bX|Λ
Then the above grammar defines the language expressed by___________ regular expression
a. (a+b)*aa(a+b)*
b. (a+b)*a(a+b)*a
c. (a+b)*aa(a+b)*aa
d. (a+b)*aba+b)*
Ans-A
A. REGULAR LANGUAGES
B. CONTEXT FREE
C. CONTEXT SENSITIVE
D. NONE.
Ans- C
Q Regular grammar is
a) Context free grammar
b) Non context free grammar
c) English grammar
d) None of the mentioned
Ans- A
Regular expression are
a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
Ans- A
L and ~L are recursive enumerable then L is
a) Regular
b) Context free
c) Context sensitive
d) Recursive
Ans-D
Regular expressions are closed under
a) Union
b) Intersection
c) Kleene star
d) All of the mentioned
Ans-d
How many strings of length less than 4 contains the language described by the regular expression
(x+y)*y(a+ab)*?
a) 7
b) 10
c) 12
d) 11
Ans-D
Grammatical rules which do not involve the meaning of words are called:
a. Semantics
b. Syntactic
c. Both a and b
d. None of given
Ans-B
The symbols in a grammar that must be replaced by other Synbols are called:
a. Productions
b. Terminals
c. Non-terminals
d. None of given
Ans-C
A context sensitive language is accepted by
a) Finite automata
b) Linear bounded automata
c) Both (a) and (b)
d) None of these
Ans- B
Ans-A
Ans- B
Ans-a
Ans- B
Which of the following strings do not belong the given regular expression?
(a)*(a+cba)
a) aa
b) aaa
c) acba
d) acbacba
Ans-d
A.S --> Sa | b
D.None of these
Ans-B
S→XaaX
X→aX| bX|Λ
Then the above grammar defines the language expressed by___________ regular expression
a. (a+b)*aa(a+b)*
b. (a+b)*a(a+b)*a
c. (a+b)*aa(a+b)*aa
d. (a+b)*aba+b)*
Ans-A
A. REGULAR LANGUAGES
B. CONTEXT FREE
C. CONTEXT SENSITIVE
D. NONE.
Ans- C
Q Regular grammar is
a) Context free grammar
b) Non context free grammar
c) English grammar
d) None of the mentioned
Ans- A
Regular expression are
a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
Ans- A
L and ~L are recursive enumerable then L is
a) Regular
b) Context free
c) Context sensitive
d) Recursive
Ans-D
Regular expressions are closed under
a) Union
b) Intersection
c) Kleene star
d) All of the mentioned
Ans-d
How many strings of length less than 4 contains the language described by the regular expression
(x+y)*y(a+ab)*?
a) 7
b) 10
c) 12
d) 11
Ans-D
Grammatical rules which do not involve the meaning of words are called:
a. Semantics
b. Syntactic
c. Both a and b
d. None of given
Ans-B
The symbols in a grammar that must be replaced by other Synbols are called:
a. Productions
b. Terminals
c. Non-terminals
d. None of given
Ans-C
Q1. Consider the languages L1 = ᶲ and L2 = {a}. Which one of the following represents
L1 L2* U L1
a) {€} b)ᶲ c) a* d) {€,a}
Q2. Let S and T be language over ={a,b} represented by the regular expressions (a+b*)*
and (a+b)*, respectively. Which of the following is true?
(a) ScT (S is a subset of T)
(b) TcS (T is a subset of S)
(c) S=T
(d) SnT=Ø
Q3. Let L denotes the language generated by the grammar S – OSO/00. Which of the
following is true?
(a) L = O
(b) L is regular but not O
(c) L is context free but not regular
(d) L is not context free
Q4. Consider the following two statements:
S1: { 0^2n |n >= l} is a regu1ar language
S2: { 0^m 0^n 0^(m+n) l m >= 1 and n >= 2} is a regu1ar language
Which of the following statements is correct? (GATE CS 2001)
a) Only S1 is correct
b) Only S2 is correct
c) Both S1 and S2 are correct
d) None of S1 and S2 is correct
Q5. Which of the following statements in true? (GATE CS 2001)
(a) If a language is context free it can always be accepted by a deterministic push-down
automaton
(b) The union of two context free languages is context free
(c) The intersection of two context free languages is context free
(d) The complement of a context free language is context free
Q6. Given an arbitrary non-deterministic finite automaton (NFA) with N states, the
maximum number of states in an equivalent minimized DFA is at least. (GATE CS 2001)
(a) N^2
(b) 2^N
(c) 2N
(d) N!
Q7. Given the language L = {ab, aa, baa}, whih 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
8. Which of the following problems are decidable?
….1) Does a given program ever produce an output?
….2) If L is a context-free language, then is L’ (complement of L) also context-free?
….3) If L is a regular language, then is L’ also regular?
….4) If L is a recursive language, then, is L’ also recursive?
(A) 1, 2, 3, 4
(B) 1, 2,
(C) 2, 3, 4
(D) 3, 4
9. Let P be a regular language and Q be context-free language such that Q ⊆ P. (For
example, let P be the language represented by the regular expression p*q* and Q be
{pnqn|n ∈ N}). Then which of the following is ALWAYS regular?
(A) P ∩ Q
(B) P – Q
(C) ∑* – P
(D) ∑* – Q
10. (a+b)* is equivalent to
a) b*a*
b) (a*b*)*
c) a*b*
d) none of the mentioned
11. a? is equivalent to
a) a
b) a+Φ
c) a+ϵ
d) wrong expression
12. Regular expression Φ* is equivalent to
a) ϵ
b) Φ
c) 0
d) 1
13. A language is regular if and only if
a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
d) accepted by Turing machine
14. 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 U L2 = .*
d) L1=L2
15. Regular expression {0,1} is equivalent to
a) 0 U 1
b) 0 / 1
c) 0 + 1
d) All of the mentioned
UNIT-I: FINITE AUTOMATA
2. Final state(s) may not be a part of the given states of a finite automaton.
a. True
b. False
c. Both
d. None of These
5. For any transition function δ and for any two input strings x and y, δ(q, xy) = _________
a. δ(q, x).δ(q, y)
b. δ(q, yx)
c. δ(q, x)×δ(q, y)
d. δ(δ(q, x),y)
1. c 4. a 7. c 10. c
2. b 5. d 8. a 11. c
3. b 6. d 9. a 12. b
UNIT-II: REGULAR EXPRESSIONS AND REGULAR SETS
a. Finite Automata
b. Push Down Automata
c. Turing Machine
d. All of the above
3. The language of all words with atleast2 a's can be described by the Regular Expression
a. a(ab)*a
b. (a + b)*ab*a(a + b)*
c. b*ab*a(a + b)*
d. All of the above
a. Type 0
b. Type 1
c. Type 2
d. Type 3.
5. Which of the following Regular Expression over {0,1} denotes set of all strings not containing 100
as substring?
a. (1 + 0)*0*
b. 0*1010*
c. 0*1*01
d. All of the above.
6. ^+ RR*= ?
a. R
b. R*
c. R+
d. ^
7. If L= language of words containing even number of a’s. The corresponding Regular Expression is:
a. (a+b)*aa(a+b)*
b. (b+ab*a)*
c. a+bb*aab*a
d. (a+b)*ab(a+b)*
8. The language that can be expressed by any regular expression is called aNon-regular language.
a. True
b. False
9. Arden’s theorem states that if R = Q + RP, then _________is its unique solution.
a. R = QP*
b. R = PQ*
c. R = P*Q*
d. R = Q*P*
a. 01*01*
b. (01)*
c. 0*1*
d. 1*0*
a. True
b. False
1. a 3. d 5. c 7. b
2. a 4. d 6. b 8. b
9. a 10. c 11. a 12. a
UNIT-III: FORMAL LANGUAGES AND REGULAR GRAMMARS
7. Grammatical rules which do not involve the meaning of words are called:
a. Semantics
b. Syntactic
c. Both a and b
d. None of given
9. The symbols in a grammar that must be replaced by other things are called:
a. Productions
b. Terminals
c. Non-terminals
d. None of given
11. The terminals are designated by _____letters, while the non-terminals are designated by
____letters.
a. Capital, bold
b. Small, capital
c. Capital, small
d. Small, bold
1. b
2. a
3. c
4. c
5. d
6. a
7. b
8. b
9. c
10. a
11. b
12. d
UNIT-I: FINITE AUTOMATA
15. A finite automata may contain more than one final states:
a. True
b. False
16. The number of columns in a transition table for a finite automata are:
a. Three
b. One less than the number of input symbols
c. Same as the number of input symbols
d. One more than the number of input symbols
18. When next state of an automata at any instant of time is determined by the present state and
the present input, then it is called a:
a. State relation
b. Output relation
c. Set of states
d. Set of input symbols
1. C
2. A
3. A
4. D
5. B
6. A
7. B
8. B
9. B
10. B
11. A
12. A
UNIT-II: REGULAR EXPRESSIONS AND REGULAR SETS
a. i=…….-3,-2,-1, 1, 2, 3, 4……
b. i=0, 1, 2, 3, 4……….
c. i=…….-3,-2,-1, 0, 1, 2, 3, 4……
d. i=1, 2, 3, 4……….
2. To examine whether a certain FA accepts any words, it is required to seek the paths from
_______state.
a. Final to initial
b. Final to final
c. Initial to final
d. Initial to initial
S→XaaX
X→aX| bX|Λ
Then the above grammar defines the language expressed by___________ regular expression
a. (a+b)*aa(a+b)*
b. (a+b)*a(a+b)*a
c. (a+b)*aa(a+b)*aa
d. (a+b)*aba+b)*
a. True
b. False
a. Null
b. Odd
c. Even
d. None of these
6. Identity: ^ + R = ________
a. ^
b. RR
c. R*
d. R
7. Identity: R + R = ________
a. 2R
b. RR
c. R
d. R*
a. R**
b. R*R*
c. R*
d. R
9. The languages which can not accept PDA________
A. REGULAR LANGUAGES
B. CONTEXT FREE
C. CONTEXT SENSITIVE
D. NONE.
10. CONVERSION OF NFA TO DFA WILL LEAD TO HOW MANY INITIAL STATES
A. 2
B. 1
C. NONE
D. BOTH
11. How many strings of length less than 4 contains the language described by the regular expression
(x+y)*y(a+ab)*?
a) 7
b) 10
c) 12
d) 11
1. D 8. C
2. C 9. A
3. A 10. B
4. A 11. D
5. C 12. A
6. D
7. C
UNIT-III: FORMAL LANGUAGES AND REGULAR GRAMMARS
19. The symbol used for step by step derivation of a grammar is:
a. →
b. ⇒
c. ↔
d. ⇄
e.
20. Language generated by grammar G = ( {S, C}, {a, b}, P, S ) where P consists of S → aCa, C → aCa |
b is:
a. abna
b. anbnan
c. abnan
d. anban
21. Regular grammar is
a) Context free grammar
b) Non context free grammar
c) English grammar
d) None of the mentioned
22. Regular expression are
a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
23. L and ~L are recursive enumerable then L is
a) Regular
b) Context free
c) Context sensitive
d) Recursive
24. . Regular expressions are closed under
a) Union
b) Intersection
c) Kleene star
d) All of the mentioned
17. a 21. a
13. a 18. a 22. a
14. c 19. b 23. d
15. b 20. d 24. d
16. b
Unit 4 :CONTEXT FREE GRAMMARS + SIMPLIFICATION OF CONTEXT- FREE GRAMMARS
6. The derivation of the word W generated by a CFG, such that at each step,a production is applied
to the left most nonterminal in the working string is said to be
a. Left most terminal
b. Left most deviation
c. None of these
d. Both a and b
7. The process of finding the derivation of word generated by particular grammar is called :
a. PLUS TIMING
b. Parsing
c. HALT
d. All of above
3. b 8. d
4. c 9. C
1. a 5. b 10. B
2. a 6. b 11. C
7. b 12. d
Unit V: PUSHDOWN AUTOMATA AND PARSING
1. For a given Pushdown automata, we can construct an equivalent context free grammar:
a. True
b. False
2. In __________ parsing, we attempt to construct a derivation of the input string, starting from the root and ending
in the given input string.
a. Top-down
b. Top-Up
c. Bottom-Up
d. Bottom-Down
3. In __________ parsing, we attempt to construct a derivation from the given input string to the top ie, the root with
label S.
a. Top-down
b. Top-Up
c. Bottom-Up
d. Bottom-Down
6. In LL(k), k represents:
a. Number of symbols to look behind
b. Number of symbols to look ahead
c. Number of input symbols in the string
d. Number of symbols towards left of current symbol
8. In order to do top-down parsing for a general string in L(G), we prepare a table called:
a. Transition table
b. Parse Table
c. Top-down Table
d. Production Table
9. The transition a Push down automaton makes is additionally dependent upon the:
a) stack
b) input tape
c) terminals
d) none of the mentioned
10. With reference of a DPDA, which among the following do we perform from the start state with an empty stack?
a) process the whole string
b) end in final state
c) end with an empty stack
d) all of the mentioned
11. If the PDA does not stop on an accepting state and the stack is not empty, the string is:
a) rejected
b) goes into loop forever
c) both (a) and (b)
d) none of the mentioned
12. A language accepted by Deterministic Push down automata is closed under which of the following?
a) Complement
b) Union
c) Both (a) and (b)
d) None of the mentioned
1. a 7. b
2. a 8. b
3. c 9. a
4. d 10. d
5. b 11. a
6. b 12. a
Unit V1: TURING MACHINES AND COMPLEXITY
a. True
b. False
a. True
b. False
a. S. C. Kleene
b. Alanzo Church
c. Charles Babbage
d. Alan Turing
6. A Turing machine can run forever, enter a loop, or reach a particular state or set of conditions at
which it is prescribed to halt.
a. True
b. False
7. In computer science, a _______________is a Turing machine that can simulate an arbitrary Turing
machine on arbitrary input.
10. Which of the following can accept even palindrome over {a,b}
a) Push down Automata
b) Turing machine
c) NDFA
d) All of the mentioned
11. If T1 and T2 are two turing machines. The composite can be represented using the expression:
a) T1T2
b) T1 U T2
c) T1 X T2
d) None of the mentioned
12. The number of states required to automate the last question i.e. {a,b}*{aba}{a,b}* using finite automata:
a) 4
b) 3
c) 5
d) 6
2. b
3. a
4. d
5. b
6. a
7. a
8. c
9. c
10. c
11. a
12. a
1. d
Q1 Which of the following pairs of regular expressions are equivalent?
a) 1(01)* and (10)*1
b) x (xx)* and (xx)*x
c) x^+ and x^+ x^(*+)
d) All of the mentioned
Q3
Ans. C
Q4
Ans. A
Q5
Ans. B
Q6
Ans. A
Ans.A
a. {xy,xy}
b. {xx,xy,yx,yy}
c. {x,y}
d. {x,y,xy}
Ans.b
Q9 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*
Ans. B
Ans. D
Q11
a. (0+1)*001(0+1)*
b. 1*001(0+1)*
c. (01)*(0+0+1)(01)*
d. None of the mentioned
Ans. A
Q12
b. (11+110)*1
c. (110+11)*0
d. (1+110)*1
Ans. C
Q13 Which among the following looks similar to the given expression?
((0+1). (0+1)) *
a. (a +b) *c
b. (a)+((b)*.c)
c. (a + (b*)).c
d. a+ ((b*).c)
Ans. D
Q15
a(bab)*∪a(ba)*
Ans. a
Q16 Which of the following does the given NFA represent?
ans. C
Question 1: While applying Pumping lemma over a language, we consider a string w that belong to L and
fragment it into _________ parts.
a) 2
b) 5
c) 3
d) 6
Ans: c
Question 2: If we select a string w such that w∈L, and w=xyz. Which of the following portions cannot be
an empty string?
a) x
b) y
c) z
Ans: b
Question 3: There exists a language L. We define a string w such that w∈L and w=xyz and |w| >=n for
some constant integer n.What can be the maximum length of the substring xy i.e. |xy|<=?
a) n
b) |y|
c) |x|
Ans: a
Question 4: Fill in the blank in terms of p, where p is the maximum string length in L.
Statement: Finite languages trivially satisfy the pumping lemma by having n = ______
a) p*1
b) p+1
c) p-1
Ans: b
Question 5: Let w be a string and fragmented by three variable x, y, and z as per pumping lemma. What
does these variables represent?
a) string count
b) string
c) both (a) and (b)
Ans: a
a) {0i1i|i>=0}
c) {0n| n is prime}
Ans: d
c) Either a or b
Ans: a
Question 8: Amongst the various pairs, which pair is taken in the pumping lemma
a) 1st
b) 2nd
c) 4th
Ans: a
Question 9: Let w= xyz and y refers to the middle portion and |y|>0.What do we call the process of
repeating y 0 or more times before checking that they still belong to the language L or not?
a) Generating
b) Pumping
c) Producing
Ans: b
Question 10: Answer in accordance to the third and last statement in pumping lemma:
a) i>0
b) i<0
c) i<=0
d) i>=0
Ans: d
Question 11: Which of the technique can be used to prove that a language is non regular?
a) Ardens theorem
b) Pumping Lemma
c) Ogden’s Lemma
Ans: b
Question 12: If L1′ and L2′ are regular languages, then L1.L2 will be
a) regular
b) non regular
c) may be regular
d) none of the mentioned
Ans: a
Question 13: If L1 and L2′ are regular languages, L1 ∩ (L2′ U L1′)’ will be
a) regular
b) non regular
c) may be regular
Ans: a
a) regular
b) non regular
c) may be regular
Ans: a
Question 15: Which among the following is the closure property of a regular language?
a) Emptiness
b) Universality
c) Membership
Ans: d
a. A B
b. C
c. C D
d. D A
Ans:- C
10. The transitional function of a NFA is
a. Q X Σ→Q
b. Q X Σ→2Q
c. Q X Σ→2n
d.Q X Σ→Qn
Ans:- B
11. Which is true for Dead State?
a. It cannot be reached anytime
b. There is no necessity of the state
c. If control enters no way to come out from the state
d.If control enters FA deads
Ans:- C
12. Which among the following states would be notated as the final
state/acceptance state?
a. q1
b. q2
c. q1, q2
d. q3
Ans:- b
13. Which of the following are the final states in the given DFA according to the
Language given ?
L= {xϵ∑= {a, b} |length of x is at most 2}
a. q0, q1
b. q0, q2
c.q1, q2
d. q0, q1, q2
Ans:D
14. Which of the following x is accepted by the given DFA (x is a binary string ∑=
{0,1})?
a. divisible by 3
b. divisible by 2
c. divisible by 2 and 3
d. divisible by 3 and 2
Ans:- d
15. Choose the correct option for the given statement:
Statement: The DFA shown represents all strings which has 1 at second last
position.
a. Correct
b. Incorrect, Incomplete DFA
c. Wrong proposition
d. May be correct
a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
2. Regular grammar is
c) english grammar
a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
4. Consider the languages L1=ɸ and L2 = {a}. Which one of the following represents L1 L2* U L1*
a) A
b) B
c) C
d) D
5. 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
6. Let w be any string of length n is {0,1}*. Let L be the set of all substrings of w. What is the minimum
number of states in a non-deterministic finite automaton that accepts L?
a) n-1
b) n
c) n+1
d) 2n-1
7. 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.
b) 0 + (0 + 10)*
c) (0 + 1)* 10(0 + 1)*
d) none of these
9. The smallest finite automation which accepts the language {x | length of x is divisible by 3}
has :
a) 2 states
b) 3 states
c) 4 states
d) 5 states
10. Consider the following languages
Q1) Consider the languages L1 = and L2 = {a}. Which one of the following represents L1
L2* U L1*
a){ epsilon } b) a* c){epsilon,a} d)none
Answer: A
Q2)
Consider the DFA given. Which of the following are FALSE?
1. Complement of L(A) is context-free.
2. L(A) = L((11*0+0)(0 + 1)*0*1*)
3. For the language accepted by A, A is the minimal DFA.
4. A accepts all strings over {0, 1} of length at least 2.
Answer: 3 and 4
Q3) Given the language L = {ab, aa, baa}, which of the following strings are in L*?
1) abaabaaabaa
2) aaaabaaaa
3) baaaaabaaaab
4) baaaaabaa
Answer : 1,2,4
Answer : c*a(d+bc*a)*
Q5) Find the regular expression for the given
Answer: b*(aa*(bb*+∈)+∈)
Q6) Find the regular expression for the given
ans a
3.Which DFA is accept the string in which every a is followed by b where Σ = {a,b} .
a)
b)
c)
d) None of these
4.
9.)Consider the finite automaton in the following figure. What is the set of reachable states for the input string 0011 ?
a. q0, q1,q2
b. q0,q1
c. q0,q1,q2,q3
d. q3
a) D b) A c) B d) C
10) How many states after Minimize the below dfa
a) 3 b) 2 c) 4 d) 5
a) an
b) anbn
c) anbncn
1) a ,b 2) c 3) a,b,c 4) a
Answer- a
2. Regular grammar is
a. context free grammar
b. non context free grammar
c. English grammar
d. none of the mentioned
Answer- a
a. Type 0 language
b. Type 1 language
c. Type 2 language
d. Type 3 language
a. Concatenation
b. Union
c. Complement
d. All of the above
Answer- d
5. If L1 is regular, then there exists some regular expression r1 which describes it. Same for L2.
Then:L1 U L2 = L(r1) U L(r2) = r1 + r2
a. True
b. False
Answer : a
a) Recursive language
c) Regular language
d) All of these
Answer c
a) Union
b) Concatenation
c) Closure
d) All of these
answer d
a) R + R = R
b) (R*)* = R*
c) ɛR = Rɛ = R
d) ØR = RØ = RR*
Answer d
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
d) All of these
Answer d
a) ɛ +RR* = R* = ɛ + R*R
b) (R1R2)*R1 = R1(R2R1)*
c) R*R* = R*
d) All of these
Answer b
16. Consider a finite automaton, with A-moves, given in Fig. which among the following is the
Equivalent automaton without A-moves.
a.
b.
c.
d. None of above
Answer a
17. Suppose we want to replace a null move from vertex V1 to vertex V2 in FA Then
What is the first step needs to be done:
a. Make a new vertex V3
b. Find all the edges starting from v2
c. Delete Vertex V2
d. None of the above
Answer b
Ans- B
A grammar G = (V, T, P, S) in which V is
a) Set of variables
b) Set of terminals
c) Set of variables and terminals
d) None of these
Ans-A
A grammar G = (V, T, P, S) in which T is
a) Set of variables
b) Set of terminals
c) Set of variables and terminals
d) None of these
Ans- B
Which of the following is more powerful?
a) PDA
b) Turing machine
c) Finite automata
d) Context sensitive language
Ans-B
A.S --> Sa | b
D.None of these
Ans-B
Regular Grammar is accepted by
a. FA
b. LBA
c. Turing Machine
d. All
Ans- C
Q Regular grammar is
a) Context free grammar
b) Non context free grammar
c) English grammar
d) None of the mentioned
Ans- A
Regular expression are
a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
Ans- A
L and ~L are recursive enumerable then L is
a) Regular
b) Context free
c) Context sensitive
d) Recursive
Ans-D
Regular expressions are closed under
a) Union
b) Intersection
c) Kleene star
d) All of the mentioned
Ans-d
How many strings of length less than 4 contains the language described by the regular expression
(x+y)*y(a+ab)*?
a) 7
b) 10
c) 12
d) 11
Ans-D
Grammatical rules which involve the meaning of words are called:
a. Semantics
b. Syntactic
c. Both a and b
d. None of given
Ans- A
Grammatical rules which do not involve the meaning of words are called:
a. Semantics
b. Syntactic
c. Both a and b
d. None of given
Ans-B
The symbols in a grammar that can’t be replaced by anything are called:
a. Productions
b. Terminals
c. Non-terminals
d. All of above
Ans-B
The symbols in a grammar that must be replaced by other Synbols are called:
e. Productions
f. Terminals
g. Non-terminals
h. None of given
Ans-C
Q1. Consider the languages L1 = ᶲ and L2 = {a}. Which one of the following represents
L1 L2* U L1
a) {€} b)ᶲ c) a* d) {€,a}
Q2. Let S and T be language over ={a,b} represented by the regular expressions (a+b*)*
and (a+b)*, respectively. Which of the following is true?
(a) ScT (S is a subset of T)
(b) TcS (T is a subset of S)
(c) S=T
(d) SnT=Ø
Q3. Let L denotes the language generated by the grammar S – OSO/00. Which of the
following is true?
(a) L = O
(b) L is regular but not O
(c) L is context free but not regular
(d) L is not context free
Q4. Consider the following two statements:
S1: { 0^2n |n >= l} is a regu1ar language
S2: { 0^m 0^n 0^(m+n) l m >= 1 and n >= 2} is a regu1ar language
Which of the following statements is correct? (GATE CS 2001)
a) Only S1 is correct
b) Only S2 is correct
c) Both S1 and S2 are correct
d) None of S1 and S2 is correct
Q5. Which of the following statements in true? (GATE CS 2001)
(a) If a language is context free it can always be accepted by a deterministic push-down
automaton
(b) The union of two context free languages is context free
(c) The intersection of two context free languages is context free
(d) The complement of a context free language is context free
Q6. Given an arbitrary non-deterministic finite automaton (NFA) with N states, the
maximum number of states in an equivalent minimized DFA is at least. (GATE CS 2001)
(a) N^2
(b) 2^N
(c) 2N
(d) N!
Q7. Given the language L = {ab, aa, baa}, whih 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
8. Which of the following problems are decidable?
….1) Does a given program ever produce an output?
….2) If L is a context-free language, then is L’ (complement of L) also context-free?
….3) If L is a regular language, then is L’ also regular?
….4) If L is a recursive language, then, is L’ also recursive?
(A) 1, 2, 3, 4
(B) 1, 2,
(C) 2, 3, 4
(D) 3, 4
9. Let P be a regular language and Q be context-free language such that Q ⊆ P. (For
example, let P be the language represented by the regular expression p*q* and Q be
{pnqn
|n ∈ N}). Then which of the following is ALWAYS regular?
(A) P ∩ Q
(B) P – Q
(C) ∑* – P
(D) ∑* – Q
10. (a+b)* is equivalent to
a) b*a*
b) (a*b*)*
c) a*b*
d) none of the mentioned
11. a? is equivalent to
a) a
b) a+Φ
c) a+ϵ
d) wrong expression
12. Regular expression Φ* is equivalent to
a) ϵ
b) Φ
c) 0
d) 1
13. A language is regular if and only if
a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
d) accepted by Turing machine
14. 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 U L2 = .*
d) L1=L2
15. Regular expression {0,1} is equivalent to
a) 0 U 1
b) 0 / 1
c) 0 + 1
d) All of the mentioned
Answer: a
3. δ*(q,ya) is equivalent to .
a) δ((q,y),a)
b) δ(δ*(q,y),a)
c) δ(q,ya)
d) independent from δ notation
Answer: b
4. Languages of a automata is
a) If it is accepted by automata
b) If it halts
c) If automata touch final state in its life time
d) All language are language of automata
Answer: a
5. Finite automata requires minimum _______ number of stacks.
a) 1
b) 0
c) 2
d) None of the mentioned
Answer: b
6. FSM with output capability can be used to add two given integer in binary representation.
This is
a) True
b) False
c) May be true
d) None of the mentioned
Answer: a
7. If NFA of 6 states excluding the initial state is converted into DFA, maximum possible
number of states for the DFA is ?
a) 64
b) 32
c) 128
d) 127
Answer: c
8. NFA, in its name has ’non-deterministic’ because of :
a) The result is undetermined
b) The choice of path is non-deterministic
c) The state to be transited next is non-deterministic
d) All of the mentioned
Answer: b
9. The construction time for DFA from an equivalent NFA (m number of node)is:
a) O(m2)
b) O(2m)
c) O(m)
d) O(log m)
Answer: b
10. Which of the following option is correct?
a) NFA is slower to process and its representation uses more memory than DFA
b) DFA is faster to process and its representation uses less memory than NFA
c) NFA is slower to process and its representation uses less memory than DFA
d) DFA is slower to process and its representation uses less memory than NFA
Answer: c
11. Choose the correct option for the given statement:
Statement: The DFA shown represents all strings which has 1 at second last position.
a) Correct
b) Incorrect, Incomplete DFA
c) Wrong proposition
d) May be correct
Answer: c
12.
TOC mcq
Definition and description of FA:
1. NFA, in its name has ’non-deterministic’ because of :
a) The result is undetermined
b) The choice of path is non-deterministic
c) The state to be transited next is non-deterministic
d) All of the mentioned
Answer: b
2. Languages of a automata is
a) If a string is accepted by automata
b) If it halts
c) If automata touch final state in its life time
d) All language are language of automata
Answer: a
8. Which DFA is correct for the given Language: accepting string ending with '01' over input alphabets ∑={a.b}
9. How many Final states in the given language : {an | where n >=1 but n ≠ 2,6 } , Σ= {a}
a) 2 b) 4 c) 3 d) 6
Ans b)
10. Transition function maps.
a) Σ * Q -> Σ
b) Q * Q -> Σ
c) Σ * Σ -> Q
d) Q * Σ -> Q Ans d)
14. Which NFA is correct for the transition table as given below:
Present State 0 1
a) b)
15. Given a NFA with N states, the maximum number of states in an equivalent minimized DFA is at least
a) N^2
b) 2^N
c) 2N
d) N! Ans b)
Answer: c
a. A Boolean value
b. A state
c. A set of states
d. An edge
answer: c
a) Correct
b) Incorrect, Incomplete DFA
c) Wrong proposition
d) May be correct
Answer: c ( bcz it is nfa)
Q7. Which of the following is a not a part of 5-tuple finite automata?
a) Input alphabet
b) Transition function
c) Initial State
d) Output Alphabet
Answer: d
Answer: (b)
References:
http://en.wikipedia.org/wiki/Powerset_construction
Consider L= {(ap)* | P is a prime number} over the alphabet {a}, then what is the minimum
number of states in NFA that accepts the language L?
(A) three
(B) five
(C) four
(D) six
Explanation:
Let w be any string of length n in {a, b}*. Consider ‘L’ be the set of all strings ending with at
least n a’s. What is the minimum number of states in non deterministic finite automata that
accept ‘L’?
(A) (n+3)
(B) (n+1)
(C) n
(D) 2n
Explanation:
It is correct since, the minimum number of states required for NFA for ending with at least 2 a’s
is (2 + 1) i.e., regular expression will be (a + b)*aa
What is the minimum number of states in deterministic finite automata (DFA) for string starting
with ba2 and ending with ‘a’ over alphabet {a, b}?
(A) Ten
(B) Nine
(C) Eight
(D) Six
n the above DFA, minimum number of states required is six.
Ques-5: What is the number of states in minimal NFA(non deterministic finite automata), which
accepts set of all strings in which the third last symbol is ‘a’ over alphabet {a, b}?
(A) three
(B) four
(C) six
(D) five
3)Definition of a language L with alphabet {a} is given as following. L= { a nk | k > 0, and n is
a positive integer constant} What is the minimum number of states needed in a DFA to
recognize L?
(A) k+1
(B) n+1
(C) 2n+1
(D) 2k+1
Answer (B)
A) k+1
(B) n+1
(C) 2n+1
(D) 2k+1
Answer (B)
Note that n is a constant and k is any positive integer. For example, if n is given as 3, then the
DFA must be able to accept 3a, 6a, 9a, 12a, .. To build such a DFA, we need 4 states.
4) Let w be any string of length n is {0,1}*. Let L be the set of all substrings of w. What is
the minimum number of states in a non-deterministic finite automaton that accepts L?
(A) n-1
(B) n
(C) n+1
(D) 2n-1
Answer (C)
We need minimum n+1 states to build NFA that accepts all substrings of a binary string. For
example, following NFA accepts all substrings of “010” and it has 4 states.
1) 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)
Lexical analysis is the first step in compilation. In lexical analysis, program is divided into
tokens. Lexical analyzers are typically based on finite state automata. Tokens can typically be
expressed as different regular expressions:
An identifier is given by [a-zA-Z][a-zA-Z0-9]*
The keyword if is given by if.
Integers are given by [+-]?[0-9]+.
1) What is the complement of the language accepted by the NFA shown below? Assume ∑ =
{a} and ε is the empty string
(A) Φ
(B) ε
(C) a
(D) {a, ε}
Answer (B)
The given alphabet ∑ contains only one symbol {a} and the given NFA accepts all strings with
any number of occurrences of ‘a’. In other words, the NFA accepts a+. Therefore complement of
the language accepted by automata is empty string.
4) Consider the set of strings on {0,1} in which, every substring of 3 symbols has at most
two zeros. For examples, 001110 and 011001 are in the language, but 100010 is not. All
strings of length less than 3 are also in the language. A partially completed DFA that
accepts this language is shown below.
https://www.sanfoundry.com/automata-theory-mcqs-finite-automata/
2. In DFA Transition function maps.
a) Σ * Q -> Σ
b) Q * Q -> Σ
c) Σ * Σ -> Q
d) Q * Σ -> Q
Answer:d
Answer:d
Explanation: According to Chomsky classification.
Answer:b
Explanation: Finite automata doesn’t require any stack operation
Answer:a
Explanation:Because there is no memory associated with automata.
15. FSM with output capability can be used to add two given integer in binary representation.
This is
a) True
b) False
c) May be true
d) None of the mentioned
View Answer
Answer:a
Explanation: Use them as a flip flop output
Answer: b
Explanation: Non deterministic or deterministic depends upon the definite path defined for the
transition from one state to another or undefined(multiple paths).
Answer: a
Explanation: Statement 1 and 2 always true for a given Language.
Answer: a
Explanation: Initially Q is empty. Then since the initial state of the DFA is {0} , {0} is added to
Q.
Since 2( 0 , a ) = { 1 , 2 } , { 1 , 2 } is added to Q and ( { 0 } , a ) = { 1 , 2 } .
Since 2( 0 , b ) = , is added to Q and ( { 0 } , b ) = .
At this point Q = { {0} , { 1 , 2 }, }. Similarly ( { 1 , 2 } , b ) = { 1 , 3 } . Hence { 1 , 3 } is added
to Q . Similarly ( { 1 , 3 } , a ) = { 1 , 2 } and ( { 1 , 3 } , b ) = . Thus there are no new states to
be added to Q . Since the transitions from all states of Q have been computed and no more states
are added to Q, the conversion process stops here.
1. Let S and T be language over ={a,b} represented by the regular expressions (a+b*)* and
(a+b)*, respectively. Which of the following is true? (GATE CS 2000)
Answer: (c).
2) Which one of the following languages over the alphabet {0,1} is described by the regular
expression: (0+1)*0(0+1)*0(0+1)*?
(A) The set of all strings containing the substring 00.
(B) The set of all strings containing at most two 0’s.
(C) The set of all strings containing at least two 0’s.
(D) The set of all strings that begin and end with either 0 or 1.
Answer (C)
The regular expression has two 0’s surrounded by (0+1)* which means accepted strings must
have at least 2 0’s.
3) Let L={w ∈ (0 + 1)*|w has even number of 1s}, i.e. L is the set of all bit strings with even
number of 1s. Which one of the regular expression below represents L?
(A) (0*10*)*
(B) 0*(10*10*)*
(C) 0*(10*1*)*0*
(D) 0*1(10*1*)*10*
Answer (B)
Option (A) is incorrect because it cannot accept “110”
Option (C) is incorrect because it accept a string with single 1.
Option (D) is incorrect because it cannot accept 11101
(A) only X
(B) only Y
(C) only Z
(D) all of the above.
Explanation:
X: It is incorrect. since, a language L and its compliment can be infinite.
Y: It is correct.since, if the language contains epsilon then its initial state must be final also,
otherwise the DFA wont be able to accept epsilon.
Z: It is incorrect. since, every language accepted by NFA is also accepted by some DFA. Hence,
NFA and DFA both are equivalent in power.
5 Which one of the following regular expression describes the language over {a, b} which
consists of no pair of consecutive b’s?
Explanation:
6 What is the length of the shortest string not in the language over alphabet {0, 1} for regular
expression given below:
1*(0 + 1)*1*
(A) seven
(B) five
(C) six
(D) four
Explanation:
Check each string generated over the alphabet {0, 1} until you reach the shortest string which is
not generated by the given regular expression.
In this case, smallest string which is not generated by the given regular expression is 0110,
whose length is four.
7 Consider X and Y are two languages over alphabet {0, 1} represented by regular expression
0*(10*)* and (0* + 1*)* respectively. which of the following is true?
Explanation:
Here,
L(X)
= 0*(10*)*
= {epsilon, 0, 1, 10, 01, 00, 11, ......}
And.
L(Y)
= (0* + 1*)*
= {epsilon, 0, 1, 10, 01, 00, 11, ....}
https://www.sanfoundry.com/compilers-questions-answers-nfa-epsilon-moves-1/
8. S –> aSa| bSb| a| b ;the language generated by the above grammar is the set of
a) All palindromes.
b) All odd length palindromes
c) Strings beginning and ending with the same symbol
d) All even length palindromes
View Answer
Answer: b
Explanation: The strings accepted by language are {a, b, aaa, bbb, aba, bab,}. All the strings are
odd length palindromes.
9 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) strings with the substring 00
b) strings with at most two 0’s
c) strings with at least two 0’s
d) strings beginning and ending with either 0 or 1
View Answer
Answer: c
Explanation: The RE having 2 0’s padded by (0+1)* which means accepted strings must have at
least 2 0’s.
Answer: b
Explanation: It adds nothing new to the automata.
11.Which of the technique can be used to prove that a language is non regular?
a) Ardens theorem
b) Pumping Lemma
c) Ogden’s Lemma
d) None of the mentioned
View Answer
Answer: b
Explanation: We use the powerful technique called Pumping Lemma, for showing certain
languages not to be regular. We use Ardens theorem to find out a regular expression out of a
finite automaton.
Answer: b
Explanation: Here, i has limits i.e. the language is finite, contains few elements and can be
graphed using a deterministic finite automata. Thus, it is regular. Others can be proved non
regular using Pumping lemma.
Answer: d
Explanation: All of the given languages are regular and finite and thus, can be represented using
respective deterministic finite automata. We can also use mealy or moore machine to represent
remainders for option c.
14. If L is DFA-regular, L’ is
a) Non regular
b) DFA-regular
c) Non-finite
d) None of the mentioned
View Answer
Answer: b
Explanation: This is a simple example of a closure property: a property saying that the set of
DFA-regular languages is closed under certain operations.
If L is DFA-regular, L’ is
a) Non regular
b) DFA-regular
c) Non-finite
d) None of the mentioned
View Answer
Answer: b
Explanation: This is a simple example of a closure property: a property saying that the set of
DFA-regular languages is closed under certain operations.
Answer: b
Explanation: Let L be a regular language. If ~L has k equivalent classes, then any DFA that
recognizes L must have atleast k states.
Answer: c
Explanation: In automata theory, the Myphill Nerode theorem provides a necessary and
sufficient condition for a language to be regular. The Myphill Nerode theorem can be used to
show a language L is regular by proving that the number of equivalence classes of RL(relation) is
finite.
Answer: a
Explanation: NFAs were introduced Dana Scott and Michael O. Rabin who also showed their
equivalence to DFAs.
Answer: d
Explanation: RE are closed under
• Union (cf. picture)
• Intersection
• Concatenation
• Negation
• Keene closure.
Answer: c
Explanation: A transition function Δ: Q × Σ → P (Q).Where P (Q) denotes the power set of Q…
20. How many strings of length less than 4 contains the language described by the regular
expression (x+y)*y(a+ab)*?
a) 7
b) 10
c) 12
d) 11
View Answer
Answer : d
Explanation : string of length 0 = 1
string of length 1 = 4
string of length 2 = 3
string of length 3 = 3
21. Which of the following is true?
a) (01)*0 = 0(10)*
b) (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*
c) (0+1)*01(0+1)*+1*0* = (0+1)*
d) All of the mentioned
View Answer
Answer : d
Explaination : None.
Answer : a
Explanation : All of above machine can accept regular language but all string accepted by
machine is regular only for DFA.
23. 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 U L2 = .*
d) L1=L2
View Answer
Answer : d
Explanation : Finite state machine and regular expression have same power to express a
language.
Answer : b
Explanation : Except b all are regular expression*
Answer : a
Explanation : According to Chomsky hierarchy .
Answer : b
Explanation : None.
Answer : d
Explanation : According to definition of regular expression.
Answer: c
Explanation: In automata theory, the Myphill Nerode theorem provides a necessary and
sufficient condition for a language to be regular. The Myphill Nerode theorem can be used to
show a language L is regular by proving that the number of equivalence classes of RL(relation) is
finite.
28. Which of the following strings do not belong the given regular expression?
(a)*(a+cba)
a) aa
b) aaa
c) acba
d) acbacba
View Answer
Answer: d
Explanation: The string acbacba is unacceptable by the regular expression (a)*(a+cba).
2. Let L denotes the language generated by the grammar S – OSO/00. Which of the following is
true? (GATE CS 2000)
(a) L = O
(b) L is regular but not O
(c) L is context free but not regular
(d) L is not context free
Answer: (b)
Explanation: Please note that grammar itself is not regular but language L is regular as L can be
represented using a regular grammar, for example S -> S00/00.
References:
http://en.wikipedia.org/wiki/Regular_grammar
Answer: (c)
Explanation:
S1 can be written as (00)^n where n >= 1. And S2 can be written as (00)^(m+n) where m >=2
and n >= 1. S2 can be further reduced to (00)^x where x >= 3.
We can easily write regular grammars for both S1 and S2.
G1 -> G100/00 (For S1)
G2 -> G200/000000 (For S2)
Explanation:
(A) It is correct, since this language can form regular expression which is {{ a(a + b)+a }
+ {b(a + b)+b}}, i.e., start and end with same symbol.
(B) It is deterministic context free language since, string before and and after ‘x’ are same
so, it is matched.
(C) It cannot be regular since, wwR is done at first which requires comparison which
cannot be done via finite automata.
(D) It is also not regular since, comparison is required.
S1 = {(an)m | n = 0}
S2 = {anbn | n>=1} U {anbm | n>=1, m>=1}
(A) only S1
(B) only S2
(C) both S1 and S2
(D) none
Explanation:
Both given languages are regular. Option (C) is correct.
1) S –> aSa| bSb| a| b ;The language generated by the above grammar over the alphabet {a,b} is
the set of
(A) All palindromes.
(B) All odd length palindromes.
(C) Strings that begin and end with the same symbol
(D) All even length palindromes.
Answer (B)
The strings accepted by language are {a, b, aaa, bbb, aba, bab, ..}. All of these strings are odd
length palindromes.
1) Let P be a regular language and Q be context-free language such that Q ⊆ P. (For example, let
P be the language represented by the regular expression p*q* and Q be {pnqn|n ∈ N}). Then
which of the following is ALWAYS regular?
(A) P ∩ Q
(B) P – Q
(C) ∑* – P
(D) ∑* – Q
Answer (C)
The expression ∑* – P represents complement of P which is a regular language. Complement of
Regular languages is also regular. Then a DFA that accepts the complement of L, i.e. ∑* – L,
can be obtained by swapping its accepting states with its non-accepting states.
2) Given the language L = {ab, aa, baa}, whih 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
Answer (C)
Any combination of strings in set {ab, aa, baa} will be in L*.
….1) “abaabaaabaa” can be partitioned as a combination of strings in set {ab, aa, baa}. The
partitions are “ab aa baa ab aa”
….2) “aaaabaaaa” can be partitioned as a combination of strings in set {ab, aa, baa}. The
partitions are “aa ab aa aa”
….3) “baaaaabaaaab” cannot be partitioned as a combination of strings in set {ab, aa, baa}
….4) “baaaaabaa” can be partitioned as a combination of strings in set {ab, aa, baa}. The
partitions are “baa aa ab aa”
Answer: a
Explanation: The chomsky hierarchy lays down the following order:
Regular<CFL<CSL<Unrestricted
Answer: d
Explanation: All the given options are generated by the given grammar. Using the methods of
left and right derivations, it is simpler to look for string which a grammar can generate.
If L and L' are recursively enumerable, then L is
A Regular
B context-free
context-sensitive
Answer: d
Explanation: RE or recursively ennumerable is only called the class of recursively ennumerable
language.
Answer: c
Explanation: Every recursive language is recursively ennumerable but there exists recursively
ennumerable languages that are not recursive. If L is accepted by a Non deterministic TM T, and
every possible sequence of moves of T causes it to halt, then L is recursive.
Answer: c
Explanation: If T is a turing machine recognizing L, we can make it recognize L’ by
interchanging the two outputs. And every recursive language is recursively ennumerable.
Answer: d
Explanation: The closure property of recursive languages include union, intersection and
complement operations.
Answer: c
Explanation: Theorem- If L is a recursively ennumerable language whose complement is
recursively ennumerable, then L is recursive.
Answer : a
Explanation : All of above machine can accept regular language but all string accepted by
machine is regular only for DFA.
4. Regular grammar is
a) context free grammar
b) non context free grammar
c) english grammar
d) none of the mentioned
View Answer
Answer : a
Explanation : Regular grammar is subset of context free grammar.
5. 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 U L2 = .*
d) L1=L2
View Answer
Answer : d
Explanation : Finite state machine and regular expression have same power to express a
language.
Answer : a
Explanation : According to Chomsky hierarchy
Answer: a
Explanation: grammars in which all of the rules contain only one non-terminal on the left-hand
side, and where in every case that non-terminal is the first symbol are called right Linear.
Answer: d
Explanation: Linear grammar is of 2 types Left and Right Linear Grammar
Answer: b
Explanation: In this case they both correspond to the regular expression (ab)*a
Answer: a
3. δ*(q,ya) is equivalent to .
a) δ((q,y),a)
b) δ(δ*(q,y),a)
c) δ(q,ya)
d) independent from δ notation
Answer: b
4. Languages of a automata is
a) If it is accepted by automata
b) If it halts
c) If automata touch final state in its life time
d) All language are language of automata
Answer: a
5. Finite automata requires minimum _______ number of stacks.
a) 1
b) 0
c) 2
d) None of the mentioned
Answer: b
6. FSM with output capability can be used to add two given integer in binary representation.
This is
a) True
b) False
c) May be true
d) None of the mentioned
Answer: a
7. If NFA of 6 states excluding the initial state is converted into DFA, maximum possible
number of states for the DFA is ?
a) 64
b) 32
c) 128
d) 127
Answer: c
8. NFA, in its name has ’non-deterministic’ because of :
a) The result is undetermined
b) The choice of path is non-deterministic
c) The state to be transited next is non-deterministic
d) All of the mentioned
Answer: b
9. The construction time for DFA from an equivalent NFA (m number of node)is:
a) O(m2)
b) O(2m)
c) O(m)
d) O(log m)
Answer: b
10. Which of the following option is correct?
a) NFA is slower to process and its representation uses more memory than DFA
b) DFA is faster to process and its representation uses less memory than NFA
c) NFA is slower to process and its representation uses less memory than DFA
d) DFA is slower to process and its representation uses less memory than NFA
Answer: c
11. Choose the correct option for the given statement:
Statement: The DFA shown represents all strings which has 1 at second last position.
a) Correct
b) Incorrect, Incomplete DFA
c) Wrong proposition
d) May be correct
Answer: c
12.
TOC mcq
Definition and description of FA:
1. NFA, in its name has ’non-deterministic’ because of :
a) The result is undetermined
b) The choice of path is non-deterministic
c) The state to be transited next is non-deterministic
d) All of the mentioned
Answer: b
2. Languages of a automata is
a) If a string is accepted by automata
b) If it halts
c) If automata touch final state in its life time
d) All language are language of automata
Answer: a
8. Which DFA is correct for the given Language: accepting string ending with '01' over input alphabets
∑={a.b}
a) b) c) d) None of these
Ans c
9. How many Final states in the given language : {an | where n >=1 but n ≠ 2,6 } , Σ= {a}
a) 2 b) 4 c) 3 d) 6
Ans b)
10. Transition function maps.
a) Σ * Q -> Σ
b) Q * Q -> Σ
c) Σ * Σ -> Q
d) Q * Σ -> Q Ans d)
11. Finite automata has only
a) Finite memory
b) Read only head
c) Finite control
d) All of them Ans d)
14. Which NFA is correct for the transition table as given below:
Present State 0 1
a) b)
15. Given a NFA with N states, the maximum number of states in an equivalent minimized DFA is at least
a) N^2
b) 2^N
c) 2N
d) N! Ans b)
Transition Function – mcq’s
Answer: c
a. A Boolean value
b. A state
c. A set of states
d. An edge
answer: c
a) Correct
b) Incorrect, Incomplete DFA
c) Wrong proposition
d) May be correct
Answer: c ( bcz it is nfa)
Q7. Which of the following is a not a part of 5-tuple finite automata?
a) Input alphabet
b) Transition function
c) Initial State
d) Output Alphabet
Answer: d