IT - Sem IV - AT+Sample Questions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Sample Questions

Information Technology
Subject Name: Automata Theory Course Code: ITC404

Semester: IV
Multiple Choice Questions
Choose the correct option for following questions. All the Questions
carry equal marks

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


Option A: (0+1)*. (00+11)*
Option B: (0+1)-(01+01)*(0+1)*
Option C: (01+11+10)*
Option D: (1+2+0)*(1+2)*

2. which language is represented by Regular expressions ?


Option A: Recursive language
Option B: Regular language
Option C: Context free language
Option D: Ambiguous Language

3. The set of all strings over ∑ ={} in which a single 0 is followed by any
number of 1‟s or a single 1 followed by any number of 0‟s is-----
Option A: 01* + 10*
Option B: 01*10*
Option C: 0*1 + 1*0
Option D: 0*

4. The language accepted by this DFA is

Option A: ababaabaa
Option B: abbbaa
Option C: abbbaabb
Option D: abbaabbaa

5. Moore Machine is an application of:


Option A: Finite automata without input
Option B: Finite automata with output
Option C: Non- Finite automata with output
Option D: Non- Finite automata without output

6. In regular expressions, the operator „*‟ stands for------


Option A: Concatenation
Option B: Addition
Option C: Selection
Option D: Iteration

7. The number of elements present in the ε-closure(B) in the given diagram.

Option A: 0
Option B: 1
Option C: 2
Option D: 3

8. Grammar is called ambiguous if ---------------


Option A: Two or more productions have the same non-terminal on the left-hand side
Option B: Derivation tree has more than one associated sentence
Option C: There is a sentence with more than one derivation tree corresponding to it
Option D: Brackets are not present in the grammar

9. S -> aSa
S->bSb
S->a
S->b
The language generated by the above grammar over the alphabet {a,b} is the
set of
Option A: All Palindromes
Option B: All Odd length Palindromes
Option C: All even length palindromes
Option D: String with null value

10. Unrestricted grammar is also called_______ Grammar


Option A: Type 3
Option B: Type 2
Option C: Type 1
Option D: Type 0

11. The Trees which represent derivations in CFG are called


Option A: Parse tree
Option B: Derivation Tree
Option C: Both A and B
Option D: Binary Tree

12. A Multitape Turing machine is ________ powerful than a single tape Turing
machine.
Option A: More
Option B: Less
Option C: Equal
Option D: Not equal

13. At Pushdown automata is __________ if there is at most one transition


applicable to each configuration.

Option A: Deterministic
Option B: Non-Deterministic
Option C: Finite
Option D: Non-Finite

14. Select value of n, if Push down automata is defined using n-tuples:


Option A: 7
Option B: 5
Option C: 6
Option D: 3

15. In pushdown automata notation, what does the symbol Z represents?


0

Option A: An element of G
Option B: Initial stack symbol
Option C: Top stack alphabet
Option D: Head

16. The language recognized by Turing machine is:


Option A: Context free language
Option B: Context sensitive language
Option C: Recursively enumerable language
Option D: Regular language

17. In Multi Tape Turing machine there are


Option A: Having more stack
Option B: More than one input tapes of Turing machine
Option C: Similar to the basic model of Turing machine
Option D: More than one head going in only one direction

18. Which of the following statement is false for a Turing machine?


Option A: There exists an equivalent deterministic Turing machine for every non-
deterministic Turing machine
Option B: Turing decidable languages are closed under intersection and
complementation
Option C: Turing recognizable languages are closed under union and intersection
Option D: Turing recognizable languages are closed under union and complementation

19. Which of the following is the most general phase structured grammar?
Option A: Regular
Option B: Context-sensitive
Option C: Context free
Option D: Recursive

20. The concept of FSA is much used in this part of the compiler
Option A: Lexical analysis
Option B: Parser
Option C: Code Generation
Option D: Code Optimization

21. Which symbol is used to represent a Transition Function of Finite


Automata?
Option A: β
Option B: δ
Option C: ∑
Option D: ε

22. What is the language of Finite Automata?


Option A: Recursive Language
Option B: Context-Sensitive Language
Option C: Regular Language
Option D: Context-Free Language

23. Number of states in NFA are


Option A: Less than or equal to equivalent DFA
Option B: Less than equivalent DFA
Option C: Greater than equivalent DFA
Option D: Greater than or equal to equivalent DFA

24. What is the correct form of productions in Chomsky Normal Form?


Option A: A →aB
Option B: A →BC
Option C: A→B
Option D: A →Ba

25. The language WW is accepted by-


R

Option A: Deterministic Pushdown Automata


Option B: Non-Deterministic Finite Automata
Option C: Deterministic Finite Automata
Option D: Non-Deterministic Pushdown Automata

26. The transition δ (q1,a,a) = (q , ε) of PDA is -


f

Option A: Performing delete and pop operation


Option B: Performing delete operation only
Option C: Performing pop operation only
Option D: Performing push operation

27. What is the language of the Turing machine?


Option A: Regular language
Option B: Context free language
Option C: Recursive enumerable language
Option D: Context sensitive language

28. What is the limitation of regular grammar?


Option A: Can generate simple strings
Option B: Can only describe regular language
Option C: Can‟t generate long strings
Option D: Too difficult to understand

29. DFA designed to accept strings with no more than 2 a‟s can accept:
Option A: abab
Option B: abaa
Option C: baaa
Option D: abababab

30. The length of Moore machine compared to Mealy machine is:


Option A: Equal to Mealy machine for given input
Option B: Smaller than Mealy machine for given input
Option C: One smaller than Mealy machine for given input
Option D: One longer than Mealy machine for given input

31. Derivation process is one which-


Option A: Parses given string
Option B: Generates new string
Option C: Convert string to right linear grammar
Option D: Convert string to left linear grammar

32. Language of PDA is:


Option A: Recursively Enumerable language
Option B: Regular Language
Option C: Context sensitive language
Option D: Context free language

33. The tuple Σ in Turing machine represents-


Option A: Tape symbol
Option B: Output symbol
Option C: Tape alphabet
Option D: Input alphabet

34. A Turing Machine can compute problems which are-


Option A: Complex
Option B: Simple
Option C: Unsolvable
Option D: Computable

35. Which of the following languages are most suitable for implementing context
free languages?
Option A: C
Option B: Perl
Option C: Assembly Language
Option D: Compiler language

36. With reference to the process of conversion of a context free grammar to


CNF, the number of variables to be introduced for the terminals are:
S→AB0
A→001
B→A1
Option A: 3
Option B: 4
Option C: 2
Option D: 5

37. Next move function δ of a Turing machine M = (Q, Σ , Γ, δ, q0, B, F) is a


mapping
Option A: δ:QxΣ →QxΓ
Option B: δ : Q x Γ → Q x Σ x {L, R}
Option C: δ : Q x Σ → Q x Γ x {L, R}
Option D: δ : Q x Γ → Q x Γ x {L, R}

38. 1. Which of the following grammars are in Chomsky Normal Form:


Option A: S→AB|BC|CD, A→AB B→CD, C→2, D→3
Option B: S→AB, S→BCA|0|1|2|3
Option C: S→ABa, A→aab, B→Ac
Option D: S→ABa, A→AAB, B→Ac

39. 0. The lexical analysis for a high level language needs the power of
which one of the following machine models?
Option A: Turing Machine
Option B: Deterministic pushdown automata
Option C: Finite state automata
Option D: Non-Deterministic pushdown automata

40. Which of the following relates to Chomsky hierarchy?


Option A: Regular<CFL<CSL<Unrestricted
Option B: CFL<CSL<Unrestricted<Regular
Option C: CSL<Unrestricted<CF<Regular
Option D: CSL<Unrestricted< Regular<CF

41. (r+s)* is equivalent to:


Option A: s*r*
Option B: (r*s*)*
Option C: r*s*
Option D: rs

42. X→Y |α is the production rule for________


Option A: Regular Grammar
Option B: Context Free Grammar
Option C: Right Linear Grammar
Option D: Left Linear Grammar

43 Let L={ab,aa,baa},then which of the following does not belong to the L*?
Option A: ε
Option B: abab
Option C: abba
Option D: aaabbaa

44. Epsilon-closure of a state is a combination of self state and _____________


Option A: Initial state
Option B: Final state
Option C: Non-epsilon reachable state
Option D: ε reachable state

45. Number of states required to accept the string that ends with 10.
Option A: 1
Option B: 2
Option C: 3
Option D: 4

46. The finite automata is called NFA when there exists____________ for a
specific input from current state to next state.
Option A: More than one paths
Option B: Single path
Option C: No path
Option D: Infinite paths
47. Which of the following is FALSE:
Option A: Any given mealy machine has an equivalent moore machine.
Option B: Any given moore machine has an equivalent mealy machine.
Option C: Mealy and moore machines are FSM with output capability.
Option D: Moore machine does not have an equivalent mealy machine.

48. The transition function of deterministic finite automata is __________ and


non-deterministic finite automata is ___________
Option A: δ: Q x ∑→Q δ: Q x ∑→2 Q

Option B: δ: Q x ∑→Q δ: Q x ∑→Q 2

Option C: δ: Q x ∑→{Q,∑} δ: Q x ∑→2 Q

Option D: δ: Q x ∑→{Q,∑} δ: Q x ∑→Q

49. Generation of a language using specific rule is called_____________


Option A: Optimization
Option B: Derivation
Option C: Analysis
Option D: Transition

50. In a production rule, if one non-terminal derives another non-terminal then it


is called as________
Option A: ε-Production
Option B: Null Production
Option C: Useless Symbol
Option D: Unit Production

51. Which of following does not belong to 4-tuples of CFG?


Option A: Start Symbol
Option B: Terminal Symbol
Option C: Non-terminal symbol
Option D: End symbol

52. In simplification of grammar, the variable which produces an epsilon is


called____
Option A: terminal
Option B: nullable
Option C: Empty variable
Option D: Useless symbol

53. Which of the following productions are not accepted by Chomsky Grammar?
Option A: A→ABC
Option B: A→BC
Option C: A→a
Option D: A→ ε

54. __________is accepted by Non-deterministic PDA but not by deterministic


PDA.
Option A: Even Palindromes
Option B: Odd Palindromes
Option C: Equal no of a‟s and b‟s
Option D: String ending with a particular terminal

55. The language, {a b | n>=1} is generated by the CFG:


n n

Option A: S → aSb | ab | ε
Option B: S→ aaSbb | ε
Option C: S → aaSbb | aabb
Option D: S→aSb | ab

56. Transition function of Turing machine is given by:


Option A: Q x ∑ →Q x ∑ x {L,R}
Option B: Q* x ∑ →Q x ∑ x {L,R}
Option C: Q x ∑ *→Q x ∑ x {L,R}
Option D: Q x ∑ →Q* x ∑* x {L,R}

57. According to Chomsky hierarchy, Recursively Enumerable language comes


under___________
Option A: Type 0
Option B: Type 1
Option C: Type 2
Option D: Type 3

58. Which of the following can accept even palindrome over {a,b}?
Option A: Deterministic Push down Automata
Option B: Turing machine
Option C: NDFA
Option D: DFA

59. If L and L‟ are recursively enumerable, then L is


Option A: regular
Option B: Context sensitive
Option C: Context free
Option D: recursive

60. In a compiler, keywords of a language are recognized during:


Option A: Parsing of the program
Option B: Code generation
Option C: Lexical analysis of the program.
Option D: Data flow analysis
Descriptive Questions
10 marks each
1. Explain the concepts, acceptance by final state and acceptance by empty stack of a
Pushdown automata. Construct a PDA for the language, L={ a2nbn | n ≥ 1}
2. Give a formal definition of Turing Machine (TM). Design a TM that performs the
addition of two unary numbers. (transition table and diagram both are expected)
3. Write a short note on Chomsky hierarchy. Convert the following grammar to
Chomsky Normal Form:
S→ABA
A→ aA | ε
B→bB | ε

4. Construct a Mealy machine and Moore machine for the following:


For input from, ∑*, where ∑= (0,1), if the input ends in „101‟, the output should be
„x‟; if the input ends in „110‟, output should be „y‟ otherwise output should be „z‟.
(transition table and diagram both are expected)

5. Convert the given grammar G to CNF. G: S → a | aA | B |C , A → aB | ε , B


→Aa, C →aCD | a, D → ddd.

6. Design a Turing Machine for 2‟s Complement of a binary number


7. Design PDA for odd length palindrome let Σ = {0, 1}, �= {wcwR} �ℎ��� w ϵ
Σ*
8. Construct DFA for given regular expression (a+b)* aba (a+b)*
9. Design Turing Machine to accept language L={ anbncn | n≥1}
10. Consider the following grammar
S→ aB | bA
A→ a | aS | bAA
B→ b | bS | aBB
with S as start symbol ,find Left most derivation, Right most derivation and parse
tree for the string „bbaaabbaba‟.
11. Construct Turing Machine accepting palindromes over Σ={a,b}

5 marks each
1. Give formal definition of NFA. Construct a DFA equivalent to the NFA:
( {p, q, r, s},{0,1},δ, p, {q,s}), where „δ‟ is given by:
∑ 0 1
Q

→p q,r q

q* r q,r

r s p

s* -- p

2. Consider the following CFG:


G = { (S, A), (a, b), P, S},
where P consists of :
S→aAS | a
A→SbA | SS | ba
Derive the string „aabbaa‟ using leftmost derivation and rightmost derivation.
3. Give regular expression for
a. All strings containing an even number of 0's over the alphabet {0,1}
b. All strings that do not end with „ab‟ over the alphabet {a,b}

4. Construct a DFA that reads a strings made up of {0,1} and accepts only those
strings which end in either „00‟ or „11‟. (transition table and diagram both are
expected)
5. Briefly explain the types of Turing Machine.
6. Construct a Context-free grammar equivalent to the following Push Down
Automata ( described with the help of the given set of equations):
δ (q0, b, Z0 ) = {( q0,ZZ0) }
δ (q0, ε, Z0 ) = {( q0, ε) }
δ (q0, b, Z ) = {( q0,ZZ) }
δ (q0, a, Z ) = {( q1,Z) }
δ (q1, b, Z ) = {( q0, ε) }
δ (q1, a, Z0 ) = {( q0,Z0) }
7. Construct DFA to accept strings that ends with substring 110 for Σ={0,1}

8. Design a Moore machine which counts the occurrence of substring bab in an


input string for Σ = {a, b}.

9. Give Regular Expressions for


i) For all strings over a,b which contains exactly 3 occurrence of b
over Σ={a,b}
ii) For all strings over 0,1 that starts with 10 and ends with 01
10. Let G be the grammar having the following set of production.
S→ABA,
A→aA | bA |
B→bbb
Find LMD and RMD for string “ababbbba”

11. Write Short Note on Chomsky Hierarchy

12. Compare and Contrast between FA, PDA and TM

13. Give Regular Expression for a language over the alphabet Σ={a,b} containing
at most two a‟s
14. Convert Following CFG grammar into CNF
Sa→AbB
A→Aa|a
B→bB|b

15. Design PDA to check well formedness of parenthesis.

16. Design a Moore Machine for binary adder

17. State and explain closure properties of regular languages

18. Differentiate between Moore and Mealy machine

You might also like