The Wayback Machine - https://web.archive.org/web/20240907041049/https://www.geeksforgeeks.org/automata-theory-set-2/
Open In App

Automata Theory | Set 2

Last Updated : 13 Dec, 2022
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Following questions have been asked in GATE CS 2012 exam. 

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. 

2) 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 

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” 

3) 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 

Answer (D) 
….1) Is a variation of Turing Machine Halting problem and it is undecidable. 
….2) Context Free Languages are not closed under intersection and complement. See this for details. 
….3) 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. 
….4) Recursive Languages are closed under complement. See this for details. 

4) Consider the set of strings on {0,1} in which, every substring of 3 symbols has at most two zeros. For example, 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. 
 

The missing arcs in the DFA are 

Answer (D) 
State ‘q’ is trap state. All other states are accept states. In state 00, DFA must move to ‘q’ for input symbol 0. All (non-trap) states indicate names indicate the characters seen before reaching that particular state. Option (D) is the only option that follow these rules. 

Please see GATE Corner for all previous year paper/solutions/explanations, syllabus, important dates, notes, etc. 

Please write comments if you find any of the answers/explanations incorrect, or you want to share more information about the topics discussed above.
 



Similar Reads

Difference between Pushdown Automata and Finite Automata
Pushdown Automata: A Pushdown automata (PDA) is a finite state machine with an added stack storage. Additional stack is used in making the decision for transitions apart from input symbols and current state. It contains the following 7 tuples: Finite Automata: A Finite Automata is a mathematical model of any machine by which we can calculate the tr
2 min read
Automata Theory | Set 3
Following questions have been asked in GATE CS 2011 exam. 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) Lex
2 min read
Automata Theory | Set 4
Following questions have been asked in GATE CS 2011 exam. 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
2 min read
Automata Theory | Set 6
Following questions have been asked in GATE CS 2010 exam. 1) 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*1)* (B) 0*(10*10*)* (C) 0*(10*1*)*0* (D) 0*1(10*1)*10* Answer (B) Option (A) is incorrect because it cannot acc
2 min read
Automata Theory | Set 5
Following questions have been asked in GATE CS 2009 exam. 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
3 min read
Automata Theory | Set 7
These questions for practice purpose for GATE CS Exam. Ques-1: Consider L= {(TM) | TM is the Turing machine that halts on all input and L(TM)= L' for some undecidable language L'}. Here, (TM) is the encoding of a Turing machine as a string over alphabet {0, 1} then L is: (A) decidable and recursively enumerable (B) decidable and recursive (C) decid
3 min read
Automata Theory | Set 8
These questions for practice purpose for GATE CS Exam. Ques-1: Which one of the following language is Regular? (A) {wxwR | w,x ∈ (a+b)+} (B) {wxwR | w ∈ (a+b)*, x ∈ {a,b}} (C) {wwRx | w,x ∈ (a+b)+} (D) {wwR | w ∈ (a+b)*} Explanation: (A) It is correct, since this language can form regular expression which is {{ a(a + b)+a } + {b(a + b)+b}}, i.e., s
2 min read
Automata Theory | Set 9
These questions for practice purpose for GATE CS Exam. Ques-1: Consider the following two statements with respect to Countability: Statement-1: If X union of 'Y' is uncountable, then both set 'X' and set 'Y' must be uncountable. Statement-2: The Cartesian product of two countable sets 'X' and 'Y' is countable. Which of the following option is true
3 min read
Automata Theory | Set 10
These questions for practice purpose of GATE CS Exam. Ques-1: Consider the following statements: X: For any language either a language L or its complement L' must be finite.Y: DFA for language which contains epsilon must have initial state as final state.Z: Non-deterministic finite automata is more powerful than deterministic finite automata. Which
3 min read
Practice problems on finite automata | Set 2
Que-1: Draw a deterministic and non-deterministic finite automate which either starts with 01 or end with 01 of a string containing 0, 1 in it, e.g., 01010100 but not 000111010. Explanation - Draw a DFA and NFA of same language whose strings only reach to the final state containing either 01 at start or at the end. If anything else is come then com
3 min read
Designing Finite Automata from Regular Expression (Set 6)
Prerequisite: Finite automata, Regular expressions, grammar and language, Designing finite automata from Regular expression (Set 5) In the below article, we shall see some Designing of Finite Automata form the given Regular Expression- Regular Expression 1: Regular language, L1 = a(a+b)* The language of the given RE is, {aaa, aba, baa, bba} Strings
3 min read
Finite Automata with Output (Set 6)
Prerequisite: Mealy and Moore Machines, Difference between Mealy machine and Moore machine In this article, we will see some designing of Finite Automata with Output, i.e., Moore and Mealy machines. Problem: Construction of the machines that take set of all string over {0, 1} as input and produce 'A' as output if the input contains '101' as the sub
2 min read
Finite Automata with Output (Set 5)
Prerequisite: Mealy and Moore Machines, Difference between Mealy machine and Moore machine In this article, we will see some designing of Finite Automata with Output i.e, Moore and Mealy machines. Problem: Construction of the machines that take set of all string over {0, 1} as input and produce 'A' as output if the input contains '1' as the substri
2 min read
Designing Deterministic Finite Automata (Set 5)
Prerequisite: Designing finite automata In this article, we will see some designing of Deterministic Finite Automata (DFA). Problem-1: Construction of a minimal DFA accepting set of strings over {a, b} in which every 'a' is followed by a 'bb'. Explanation: The desired language will be like: L1 = {ε, abb, abbabb, bbbbabb, abbabbabbabbabbbb,
3 min read
Designing Deterministic Finite Automata (Set 9)
Prerequisite: Designing finite automata In this article, we will see some designing of Deterministic Finite Automata (DFA). Problem-1: Construction of a minimal DFA accepting a set of strings over {a, b} in which {abwa / wε{a, b}*}. Here 'w' is the substring containing alphabets over any number of 'a' and 'b' ranging from zero to infinity.
4 min read
Designing Deterministic Finite Automata (Set 6)
Prerequisite: Designing finite automata In this article, we will see some designing of Deterministic Finite Automata (DFA). Problem-1: Construction of a minimal DFA accepting set of strings over {a, b} in which anbm, where n and m is greater than or equal to 1. Explanation: The desired language will be like: L1 = {ab, aab, abb, aabb, aaabbb, aaabbb
3 min read
Finite Automata with Output (Set 3)
Prerequisite: Mealy and Moore Machines, Difference between Mealy machine and Moore machine In this article, we will see some designing of Finite Automata with Output i.e, Moore and Mealy machines. Problem: Construction of the machines that take set of all string over {a, b} as input and count number of substring 'a'. That is here we have, Ε
2 min read
Designing Finite Automata from Regular Expression (Set 2)
Prerequisite: Finite automata, Regular expressions, grammar and language. Designing finite automata from Regular expression In the below article, we shall see some Designing of Finite Automata form the given Regular Expression- Regular Expression 1: Φ (Phi). The language of the given RE is L1 = {} i.e, empty string. Its finite automata will be
3 min read
Designing Finite Automata from Regular Expression (Set 3)
Prerequisite: Finite automata, Regular expressions, grammar and language, Designing finite automata from Regular expression (Set 2) In the below article, we shall see some Designing of Finite Automata form the given Regular Expression. Regular Expression 1: 'ab*' ('a' followed by any number of 'b'). The language of the given RE is, L1 = {a, ab, abb
3 min read
Designing Finite Automata from Regular Expression (Set 4)
Prerequisite: Finite automata, Regular expressions, grammar and language, Designing finite automata from Regular expression (Set 3) In the below article, we shall see some Designing of Finite Automata form the given Regular Expression- Regular Expression 1: Regular language, L1 = (a+b)(a+b) The language of the given RE is, {aa, ab, ba, bb} Length o
3 min read
Designing Finite Automata from Regular Expression (Set 5)
Prerequisite: Finite automata, Regular expressions, grammar and language, Designing finite automata from Regular expression (Set 4) In the below article, we shall see some Designing of Non-deterministic Finite Automata form the given Regular Expression- As NFA can be changed to corresponding DFA. Regular Expression 1: Regular language, L1 = ((a+b)(
3 min read
Designing Finite Automata from Regular Expression (Set 7)
Prerequisite: Finite automata, Regular expressions, grammar and language, Designing finite automata from Regular expression (Set 6) In the below article, we shall see some Designing of Finite Automata form the given Regular Expression- Regular Expression 1: Regular language, L1 = b*aa(a+b)*+b*ab*aa(a+b*) The language of the given RE is- {aaa, baa,
3 min read
Designing Finite Automata from Regular Expression (Set 8)
Prerequisite: Finite automata, Regular expressions, grammar and language, Designing finite automata from Regular expression (Set 7) In the below article, we shall see some Designing of Finite Automata form the given Regular Expression- Regular Expression 1: Regular language, L1 = {an | n≥ 1} The language of the given RE is- {a, aa, aaa, ........
2 min read
Designing Finite Automata from Regular Expression (Set 1)
In this article, we will see some popular regular expressions and how we can convert them to finite automata. Even number of a's : The regular expression for even number of a's is (b|ab*ab*)*. We can construct a finite automata as shown in Figure 1. The above automata will accept all strings which have even number of a’s. For zero a’s, it will be i
3 min read
Designing Deterministic Finite Automata (Set 7)
Prerequisite: Designing finite automata In this article, we will see some designing of Deterministic Finite Automata (DFA). Problem-1: Construction of a minimal DFA accepting set of strings over {a, b} in which a n b m c l , where n, m and l is greater than or equal to 0. Explanation: The desired language will be like: L1 = {ε, a, aa, aaa, b, bb, b
6 min read
Designing Deterministic Finite Automata (Set 2)
Prerequisite - Designing finite automata, previous article: Designing Deterministic Finite Automata (Set 1) In this article, we will see some designing of Deterministic Finite Automata (DFA). Problem-1: Construction of a DFA for the set of string over {a, b} such that length of the string |w| is divisible by 2 i.e, |w| mod 2 = 0. Explanation - The
7 min read
Designing Non-Deterministic Finite Automata (Set 4)
Prerequisite: Finite Automata Introduction In this article, we will see some designing of Non-Deterministic Finite Automata (NFA). Problem-1: Construction of a minimal NFA accepting a set of strings over {a, b} in which each string of the language contain 'a' as the substring. Explanation: The desired language will be like: L1 = {ab, abba, abaa, ..
4 min read
Designing Deterministic Finite Automata (Set 4)
Prerequisite: Designing finite automata , Designing Deterministic Finite Automata (Set 3) In this article, we will see some designing of Deterministic Finite Automata (DFA). Problem-1: Construction of a minimal DFA accepting set of strings over {a, b} in which every 'a' is followed by a 'b'. Explanation: The desired language will be like: L1 = {ε,
6 min read
Designing Non-Deterministic Finite Automata (Set 1)
Prerequisite: Finite Automata Introduction In this article, we will see some designing of Non-Deterministic Finite Automata (NFA). Problem-1: Construction of a minimal NFA accepting a set of strings over {a, b} in which each string of the language starts with 'a'. Explanation: The desired language will be like: L1 = {ab, abba, abaa, ...........} He
6 min read
Designing Deterministic Finite Automata (Set 3)
Prerequisite: Designing finite automata, Designing Deterministic Finite Automata (Set 2) In this article, we will see some designing of Deterministic Finite Automata (DFA). Problem-1: Construction of a minimal DFA accepting set of string over {a, b} where each string containing 'a' as the substring. Explanation: The desired language will be like:
4 min read
Article Tags :