Assignment
Assignment
Ques 2
Ques 3
Ques 4
Ques 5
Ques 8
Which of the following conversion is not feasible?
(a) Regular expression to automaton conversion
(b) Automaton to Regular Expression Conversion
(c) NFA to DFA
(d) None of the mentioned
Ques 9
Ques 10
Two finite state machines are said to be equivalent if they:
(a) Have the same number of edges
(b) Have the same number of states
(c) Recognize the same set of tokens
(d) Have the same number of states and edges
Ques 11 Backtracking is allowed in
Ques 12 The total number of states and transitions required to form a moore machine that will produce residue mod 3.
a) 3 and 6 b) 3 and 5 c) 2 and 4 d) 2 and 5
Ques 13
The following mealy machine outputs which of the following?
Ques 14 Given an arbitrary non-deterministic finite automaton (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!
Ques 15 There exists a language L. We define a string w such that x∈L and x=uvw and |x| >=n
for some constant integer n. What can be the maximum length of the substring uv i.e. |uv|<=?
(a) N
(b) |v|
(c) |u|
(d) none of the mentioned
Ques 16
Ques 17
Consider the following two statements:
S1: { 0^2n |n >= l} is a regular language
S2: { 0^m 0^n 0^(m+n) l m >= 1 and n >= 2} is a regular language
Which of the following statements is correct?
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
Ques18 Which among the following looks similar to the given expression?
((0+1). (0+1)) *
Name Roll No
Time 25 min Marks 20
Ques1 Consider the Deterministic Finite-state Automation (DFA) A shown below. The DFA runs on the alphabet
{0, 1}, and has the set of states {s, p, q, r}, with s being the start state and p being the only final state.
Which one of the following regular expressions correctly describes the language accepted by A?
A. 1(0*11)*
B. 0(0+1)*
C. 1(0+11)*
D. 1(110*)*
Ques 2 Arrange the following steps in a proper sequence for the operation of a Pushdown Automaton (PDA).
(A) Read the input symbol.
(B) Determine the current state and stack contents.
(C) Push or pop the stack based on the transition function.
(D) Move to the next state based on the current state and stack operation.
(E) Accept or reject the input based on the final state.
Choose the correct answer from the options given below:
1. (A), (B), (C), (D), (E)
2. (B), (A), (D), (C), (E)
3. (B), (A), (C), (D), (E)
4. (A), (C), (D), (B), (E)
Ques 3 How many strings of length less than 4 contains the language described by the regular expression(x+y)*y(a+ab)*
A. 7
B. 8
C. 11
D. 12
Ques 4 The following grammar
G=(N,T,P,S) N=(S,A,B) T{a,b,c} P:SaSa AbB BbB B->c is
a) is type 3
b) is type 2 but not 3
c) is type 1 but not 2
d) is type 0 but not 1
Ques 5
a) Regular
b) not regular
c) can be regular
d) all of these
Ques 6 Given grammar: S->xP P->x P->Q Q-> P Q->yy
Which of the following is the production of Q after simplification?
a) P
b) yy
c) xP
d) P| yy
Ques 7 Given grammar G:
S-> PQP
P->xP|a|ε
Q-> yQ|ε
Eliminate ε and unit productions. State the number of productions the starting variable holds?
a) 6
b) 7
c) 8
d) 9
A. Change a state
B. Write a tape symbol in the cell scanned
C. Move the tape head left or right
D. All of the mentioned
Ques 9
a) wwr|Σ(a+b)*
b) wabwr|Σ(a+b)*
c) w=(a+b)*ab
d) Both A and B
Ques 10
a) L=anb2n |n>=1
b) L=anb3n |n>=1
c) L=anb2n+1 |n>=1
d) Both B and C
Ques 11 With reference to the process of conversion of a context free grammar to CNF, the numbers of variables to be
introduced for the terminals are:
S->ABa
A->aab
B->Ac
a) 3
b) 4
c) 2
d) 5
Ques 12 Which of the expressions correctly is a requirement of the pumping lemma for the context free languages?
a) uvixyiz
b) uvixiyiz
c) uv2nxy2nz
d) All of the mentioned
Ques 13
A. 010101001111
✓
B. 010101011111
C. 010101010000
D. 010001011111
Ques 14 Which of the following languages is generated by the given grammar?
S->aS|bS|ε
A. an bn|n,m>=0
B. w ε {a,b}*|w has equal number of a’s and b’s
C. {a,b}*
D. Both A and B
Ques 15 S aSa|bSb|a|b
The language generated by the above grammar over the alpha bet {a,b} is the set of
A. All palindromes
B. All odd length palindromes
C. String that begin and ends with same symbol
D. All even length palindromes
Ques 16
A. L1
B. L2
✓C. L1 and L2
D. L2 and L3
Ques 17 Which of the following statement is true?
A. If a language is context free it can always be accepted by Deterministic pushdown automata.
B. The union of two CFL is context free
C. The intersection of two context free languages is context free
✓
D. Both B and C
Ques 18 Let LD be the set of all languages accepted by a PDA by final state and LE the set of all languages accepted by empty
stack. Which of the following is true?
A. LD=LE
B. LD LE
C. LD LD
D. Noe of the above
Ques 19
✓
Ques 20
✓
a) ε
b) 11010
c) 10001010
d) String of letter count 11
Quiz 3
Theory of Automata and Formal Languages
Name Roll No
Time 25 min Marks 20
Ques1
1. Which of the following is not a characteristic of a Turing machine?
A) It has a finite set of states.
B) It has an infinite tape.
C) It can move both left and right on the tape.
✓
D) It can only perform one computation at a time.
2. Find the highest type number which can be applied to the following productions:
S->Aa
A->c/Ba
B->abc
A. Type 0
B. Type 1
C. Type 2
✓
D. Type 3
3. Consider the following context-free grammar:
S → AB | a
A → aA | ε
B → bB | ε
Which of the following is the correct CNF conversion for this grammar?
4. A push down automata can be represented as: PDA= ε-NFA +[stack] State true or false:
✓a) true
b) false
5. Which of the following does not have left recursions?
✓a) Chomsky Normal Form
b) Greibach Normal Form
c) Backus Naur Form
d) All of the mentioned
6. Given Grammar G: S->aA A->a| A B->B The number of productions to be removed immediately as Unit
productions:
a) 0
b) 1
✓c) 2
d) 3
7. In pushdown automata notation, what does the symbol z0 represents?
a) an element of G
✓b) initial stack symbol
c) top stack alphabet
d) all of the mentioned
8. Which of the following does the given parse tree correspond to?
a) P->1100
✓
b) P->0110
c) P->1100ε
d) P->0101
9. Which of the following the given language belongs to?
L={ambmcm| m>=1}
✓a) Context free language
b) Regular language
c) Both (a) and (b)
d) None of the mentioned
10. A->aA| a| b
The number of steps to form aab:
✓a) 2
b) 3
c) 4
d) 5
11. Consider the finite state machine whose transition table is given below.Here Q(a,b,c,d,e,f) Σ(0,1),q0(a)
and F(f).Give the entire sequence of states for the input string (1110001).
A. b-->d-->f-->f-->f-->f-->f-->f
B. a-->b-->d-->f-->f-->f-->f-->f
✓C. a-->c-->f-->f-->f-->f-->f-->f
D. None of these
12. The minimum number of productions required to produce a language consisting of
palindrome strings over ∑={a,b} is
✓a) 3
b) 7
c) 5
d) 6
13. Given grammar G:
S->aS| AB
A-> ε
B->ε
D-> b
Reduce the grammar, removing all the ε productions:
✓a) S->aS| AB| A| B, D-> b
b) S->aS| AB| A| B| a, D-> b
c) S->aS| AB| A| B
d) None of the mentioned
14. Given grammar G:
(1)S->AS
(2)S->AAS
(3)A->SA
(4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?
a) 2,4
✓b) 1,3
c) 1, 2, 3, 4
d) 2, 3, 4
15.
✓
a) ababaabaa
b) abbbaa
c) abbbaabb
d) abbaabbaa
16.
✓
20. Which of the following regular expression resembles the given diagram?
a) {a}*{b}*{a,b}
b) {a,b}*{aba}
c) {a,b}*{bab}
d) {a,b}*{a}*{b}*