2024 question paper
FORMAL LANGUAGE & AUTOMATA THEORY
26 questions
Q1a. If an infinite language is passed to Machine M, the subsidiary which gives a finite solution to the infinite input tape is: (i) Compiler (ii) Interpreter (iii) Loader and Linkers (iv) None of the mentioned20242m
Module 4: Turing Machines (TM)
View this question on its own page →If an infinite language is passed to Machine , the subsidiary which gives a finite solution to the infinite input tape is:
(i) Compiler
(ii) Interpreter
(iii) Loader and Linkers
(iv) None of the mentionedWorked SolutionAnswer
Correct Option: (iv) None of the mentioned
Explanation
An infinite language requires a machine with unbounded memory. In the Turing Machine model the tape is infinite, but the finite control itself is finite.
- Compiler: Translates a high-level program to target code before execution. It does not provide run-time handling of an infinite input tape; it assumes input is finite source text.
- Interpreter: Executes source line-by-line, still requires entire input to be presented finitely; it does not make an infinite tape finite.
- Loader and Linkers: Perform loading / relocation of object code into memory. They handle finite modules, not an infinite language / infinite tape.
The subsidiary that actually gives a finite description of an infinite computation is the finite control (finite automaton) + the Turing Machine’s transition function or, in language theory, the finite representation (regular expression / grammar / TM description) itself. None of the three listed system softwares fulfills this role.
The theoretical concept is:
- Infinite language is described finitely by a grammar / regular expression / TM encoding , not by compiler/interpreter/loader.
Hence none of (i)-(iii) is correct.
Final Answer
None of the mentioned. The finite solution is provided by the finite control / finite encoding of the machine, not by compiler / interpreter / loader.
Q1b. Which of the following is a regular language? (i) Strings whose length is a sequence of prime numbers (ii) Palindrome strings (iii) Strings containing substring ww^r (iv) Strings with even number of 0’s20242m
Module 1: Introduction & Regular Languages
View this question on its own page →Which of the following is a regular language?
(i) Strings whose length is a sequence of prime numbers
(ii) Palindrome strings
(iii) Strings containing substring
(iv) Strings with even number of ’sWorked SolutionAnswer
Correct Option: (iv) Strings with even number of ’s
Explanation
(iv) Even number of ’s — Regular
Language is regular. DFA with 2 states suffices:
- : even count (start, accepting)
- : odd count
.
Regular expression: or .
By Myhill-Nerode, only 2 equivalence classes.
(i) Length is prime — Not regular
. Use Pumping Lemma. Let be pumping length, choose where prime, pump gives length which will be composite for suitable (e.g., ). So not regular. Primes set not ultimately periodic.
(ii) Palindromes — Not regular
Classic non-regular. Requires unbounded stack to compare second half with first reversed. Pumping lemma: in palindrome form fails. Needs PDA, is CFL but not regular.
(iii) Contains as substring — also Not regular
Need to remember arbitrarily long to check follows. This is not regular (can be shown via Myhill-Nerode with infinitely many distinct suffixes). It is context-sensitive.
Final Answer
Only (iv) is regular.
Q1c. NFA has 'non-deterministic' in its name because: (i) The result is undetermined (ii) The choice of path is nondeterministic (iii) The next state is nondeterministic (iv) All of the mentioned20242m
Module 1: Introduction & Regular Languages
View this question on its own page →NFA has 'non-deterministic' in its name because:
(i) The result is undetermined
(ii) The choice of path is nondeterministic
(iii) The next state is nondeterministic
(iv) All of the mentionedWorked SolutionAnswer
Correct Option: (ii) The choice of path is nondeterministic (and equivalently (iii); if “All of the mentioned” is offered, (iv) is also defensible)
Explanation
Deterministic FA: — exactly one next state for each .
Nondeterministic FA: — a set of possible next states. The machine may:
- be in several states simultaneously (subset view), or
- guess a path.
So “non-deterministic” means:
- Next state is not uniquely determined → (iii)
- Choice of computation path is nondeterministic → (ii)
The “result” (accept/reject) is determined (exists some accepting path ⇔ accept), so (i) “result undetermined” is misleading.
In many textbooks the canonical answer is (ii) Choice of path is nondeterministic (or (iii)). If option (iv) “All of the mentioned” lumps (ii)+(iii), some keys mark (iv) as correct.
Formal
, . On input , accepts iff there exists a path .
Final Answer
NFA is nondeterministic because the next state / path is not uniquely determined → Option (ii) (and (iii)).
Q1d. Which of the following is NOT a component of a finite automaton? (i) States (ii) Input alphabet (iii) Transition function (iv) Output tape20242m
Module 1: Introduction & Regular Languages
View this question on its own page →Which of the following is NOT a component of a finite automaton?
(i) States
(ii) Input alphabet
(iii) Transition function
(iv) Output tapeWorked SolutionAnswer
Correct Option: (iv) Output tape (is NOT a component)
Explanation
Finite Automaton (DFA/NFA) formal definition:
Components:
- : Finite set of states
- : Input alphabet
- : Transition function (or for NFA)
- : Start state
- : Set of accepting states
Output tape belongs to Turing Machine or Transducer (Mealy/Moore), not to basic finite automaton. FA has no output tape; it only accepts/rejects.
Note: and stack are for PDA, tape for TM.
Final Answer
Output tape is not a component of FA → Option (iv).
Q1e. A DFA can have: (i) Multiple start states (ii) Multiple accepting states (iii) Transitions on \varepsilon (iv) None of the above20242m
Module 1: Introduction & Regular Languages
View this question on its own page →A DFA can have:
(i) Multiple start states
(ii) Multiple accepting states
(iii) Transitions on
(iv) None of the aboveWorked SolutionAnswer
Correct Option: (ii) Multiple accepting states
Explanation
DFA definition:
- : Exactly one start state → (i) multiple start states false. (NFA can have multiple, DFA has one).
- : Set of final/accepting states. Can be 0, 1, or multiple → (ii) true. Example even number of 0's DFA has 1 accept, but language needs 1, language “ends with 00 or 11” needs 2.
- Transitions: is total deterministic, no -moves. -transitions allowed only in -NFA → (iii) false.
Final Answer
DFA can have multiple accepting states → Option (ii).
Q1f. Which of the following is a type of grammar in the Chomsky hierarchy? (i) Regular (ii) Context-Free (iii) Context-Sensitive (iv) All of the above20242m
Module 1: Introduction & Regular Languages
View this question on its own page →Which of the following is a type of grammar in the Chomsky hierarchy?
(i) Regular
(ii) Context-Free
(iii) Context-Sensitive
(iv) All of the aboveWorked SolutionAnswer
Correct Option: (iv) All of the above
Explanation
Chomsky Hierarchy classifies grammars into 4 types:
Type Name Production Form Language Class Type-0 Unrestricted , no restriction Recursively Enumerable (TM) Type-1 Context-Sensitive , with context CSL (LBA) Type-2 Context-Free , CFL (PDA) Type-3 Regular , Regular (FA) - (i) Regular → Type-3 ✓
- (ii) Context-Free → Type-2 ✓
- (iii) Context-Sensitive → Type-1 ✓
All three are in Chomsky hierarchy (Type-0 is the super-set).
Final Answer
All are types → Option (iv) All of the above.
Q1g. A Turing Machine has: (i) A finite tape (ii) An infinite tape (iii) A stack (iv) A queue20242m
Module 4: Turing Machines (TM)
View this question on its own page →A Turing Machine has:
(i) A finite tape
(ii) An infinite tape
(iii) A stack
(iv) A queueWorked SolutionAnswer
Correct Option: (ii) An infinite tape
Explanation
Turing Machine model: with
- Finite control (states ),
- One infinite tape divided into cells, each holds symbol from (), extends infinitely in one direction (or both in some definitions), with a read/write head.
- Initially tape contains input + blanks to the right (infinite blanks).
It does not have a stack (that's PDA) or queue as primary memory, nor finite tape (that would be LBA / finite automaton).
Final Answer
TM has an infinite tape → Option (ii).
Q1h. Which of the following problems is undecidable? (i) DFA acceptance (ii) NFA acceptance (iii) The Halting Problem (iv) Regular expression matching20242m
Module 5: Undecidability
View this question on its own page →Which of the following problems is undecidable?
(i) DFA acceptance
(ii) NFA acceptance
(iii) The Halting Problem
(iv) Regular expression matchingWorked SolutionAnswer
Correct Option: (iii) The Halting Problem
Explanation
Decidability:
Problem Decidable? DFA acceptance ? Decidable — simulate DFA NFA acceptance Decidable — subset simulation or convert to DFA Regex matching ? Decidable — convert to DFA/NFA Emptiness ? Decidable Halting Problem halts on ? Undecidable (Turing 1936) Proof sketch: Assume decides halting, diagonalize with loop if halts on else halt. contradicts.
Final Answer
Undecidable is Halting Problem → Option (iii).
Q1i. Which of these represents a regular language? (i) \{ a^n b^n \mid n \ge 0 \} (ii) Strings with equal number of a’s and b’s (iii) \{ a^n \mid n \text{ is prime} \} (iv) \{ w \mid w \text{ starts with 'a' and ends with 'b'} \}20242m
Module 1: Introduction & Regular Languages
View this question on its own page →Which of these represents a regular language?
(i)
(ii) Strings with equal number of ’s and ’s
(iii)
(iv)Worked SolutionAnswer
Correct Option: (iv)
Explanation
Test each:
- (i) → Not regular (needs stack, CFL).
- (ii) Equal number of 's and 's → not regular (needs counting). Pumping fails.
- (iii) → Not regular (non-periodic), also not CFL.
- (iv) Starts with a and ends with b → Regular.
DFA for (iv): 3 states
- start (no symbol yet, non-accepting)
- = last symbol a? Actually needs start a, so , .
- = seen start a, last is a (non-accepting)
- = seen start a, last is b (accepting)
Transitions: , , , .
Regular expression: (plus handle length 1? Actually inclusive). More precisely .
Hence regular.
Final Answer
Only (iv) is regular.
Q1j. Which of the following is a PDA? (i) Finite automaton with a stack (ii) Turing machine with a stack (iii) Finite automaton with a queue (iv) Turing machine with a queue20242m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Which of the following is a PDA?
(i) Finite automaton with a stack
(ii) Turing machine with a stack
(iii) Finite automaton with a queue
(iv) Turing machine with a queueWorked SolutionAnswer
Correct Option: (i) Finite automaton with a stack
Explanation
PDA definition:
- Essentially a finite automaton (finite control) augmented with a stack (LIFO memory).
- Stack provides unbounded memory but restricted access (push/pop at top only).
- Enables recognition of CFLs: e.g., by pushing 's, popping for 's.
Options:
- (ii) TM with stack → equivalent to TM (stack is not needed)
- (iii) FA with queue → queue automaton = TM-powerful
- PDA = FA + stack.
Final Answer
PDA = FA + stack → Option (i).
- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q2a. What is Automata? Explain classification of Automata.20247m
Module 1: Introduction & Regular Languages
View this question on its own page →What is Automata? Explain classification of Automata.
Worked SolutionAnswer
1. What is Automata?
Automata (plural of Automaton) is an abstract mathematical model of computation. It is a finite representation of an infinite computation that reads input symbols, changes states according to transition rules, and decides acceptance. It is the theoretical foundation for compiler design, lexical analysis, and computability.
Formally, automaton = (Input + Finite Control + Memory + Output/Acceptance).
No physical infinite hardware is needed; the model studies what can be computed with given memory.
2. Classification of Automata
Classification follows memory power and matches Chomsky hierarchy:
MermaidDiagramRendering diagram…A. Finite Automata (FA) — Type-3, Regular
- Memory: Only finite control (), no auxiliary memory.
- Types: DFA (), NFA, -NFA (all equivalent).
- Power: Regular languages. Example: , .
- Use: Lexical analyzer, pattern matching.
B. Pushdown Automata (PDA) — Type-2, Context-Free
- Memory: Stack (LIFO). .
- Types: DPDA vs NPDA (different power).
- Power: CFLs. Example: , balanced parentheses, arithmetic expressions.
- Use: Syntax analysis (parsing).
C. Linear Bounded Automaton (LBA) — Type-1, Context-Sensitive
- Memory: Tape bounded by input length (plus two endmarkers). Can read/write but not beyond bounds.
- Power: CSLs. Example: , .
- Use: Rare in practice, studies context-sensitive features.
D. Turing Machine (TM) — Type-0, RE
- Memory: Infinite tape, read/write head, finite control.
- Types: Deterministic, Nondeterministic, Multi-tape, Universal (all equivalent in power).
- Power: Recursively Enumerable (Type-0) and Recursive (Decidable) with always-halting variant.
- Example: , Halting, any computable function.
- Use: Model of general-purpose computer.
Summary Table
Automaton Memory Grammar Type Language Decidability FA (DFA/NFA) Type-3 Regular Regular Decidable (all properties) PDA + Stack Type-2 CFG CFL Emptiness decidable, equivalence undecidable LBA + tape Type-1 CSG CSL Membership decidable () TM + tape Type-0 unrestricted RE Halting undecidable Hierarchy: and .
Final Answer
Automata are abstract computing models; classification by memory gives FA → PDA → LBA → TM corresponding to Chomsky Types 3→2→1→0.
Q2b. Tabulate the Chomsky hierarchy of grammars with an example of each.20247m
Module 1: Introduction & Regular Languages
View this question on its own page →Tabulate the Chomsky hierarchy of grammars with an example of each.
Q3a. Construct DFA for all strings over \{0,1\} interpreted as binary numbers divisible by 4.20247m
Module 1: Introduction & Regular Languages
View this question on its own page →Construct DFA for all strings over interpreted as binary numbers divisible by .
Worked SolutionAnswer
Language:
Interpret string as binary number (most significant bit first), check divisibility by 4.
Key Observation
A binary number is divisible by 4 iff its last two bits are 00 (or the string is just "0" or empty, treated as 0).
- Binary ends in
00. - Special case: empty string and
"0"represent 0, divisible by 4.
DFA Construction (4 states)
Track value modulo 4. States = residues .
DFA:
- where = value
- = start (value 0)
- (residue 0)
Transition: On input bit :
Transition Table:
State \ Input 0 1 (0) (1) (2) (3) Derivation:
State Diagram
MermaidDiagramRendering diagram…
Simplified 3-State DFA (Using Last-Two-Bits Insight)
Since divisibility by 4 depends only on last 2 bits =
00:DFA with 3 states:
- : start, also accept (0 or empty or ...00)
- : last bit = 1
- : last bit = 0, previous ≠ 0 (i.e., ends in
10)
State \ Input 0 1 (accept) . = last two bits
00(or empty/"0").Why 3 states minimal: Myhill-Nerode: are pairwise distinguishable mod 4.
Test Cases
Input Value Path Accept? 0 Yes 00 Yes 1004 Yes 10008 Yes 102 No ($q_2 otin F$) 1015 No 110012 ends in Yes
Regular Expression
(All strings ending in
00plus the single0; can be included as(0+1)*00 | 0 | \epsilon)
Final Answer
DFA with 4 states (mod 4 tracking) or minimal 3 states:
- States: residues 0,1,2,3 (or 3-state:
00, ends-in-1, ends-in-10) - Transitions:
- Accept: only
- Binary divisible by 4 ⇔ ends in
00(or is0/ε)
DFA(3 states): q0 --0--> q0 q0 --1--> q1 q1 --0--> q2 q1 --1--> q1 q2 --0--> q0 q2 --1--> q1 Accept: q0- Binary ends in
Q3b. Construct DFA that accepts strings over \Sigma = \{a,b\} which start with aba.20247m
Module 1: Introduction & Regular Languages
View this question on its own page →Construct DFA that accepts strings over which start with .
Q4a. Prove that L = \{ a^i b^i \mid i \ge 0 \} is not regular using the pumping lemma.20247m
Module 1: Introduction & Regular Languages
View this question on its own page →Prove that is not regular using the pumping lemma.
Q4b. Convert the following NFA to DFA. 20247m
Module 1: Introduction & Regular Languages
View this question on its own page →Convert the following NFA to DFA.

Q5a. Design a Turing Machine that increments a binary number by 1.20247m
Module 4: Turing Machines (TM)
View this question on its own page →Design a Turing Machine that increments a binary number by .
Q5b. Write the difference between Pushdown Automata and Finite Automata.20247m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Write the difference between Pushdown Automata and Finite Automata.
Q6a. Construct a PDA for the language: L = \{ 0^m 1^n 0^k \mid k \ge 1, m \ge 1, m > n + 2 \}20247m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Construct a PDA for the language:
Q6b. Explain the various types of Turing Machines.20247m
Module 4: Turing Machines (TM)
View this question on its own page →Explain the various types of Turing Machines.
- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q7a. Construct a PDA for the grammar: S \to 0BB B \to 0S \mid 1S \mid 0 Test whether 0104 is accepted by this PDA.20247m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Construct a PDA for the grammar:
Test whether is accepted by this PDA.
Q7b. Check whether the grammar is ambiguous: S \to a \mid abSb \mid aAb A \to bS \mid aAAb20247m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Check whether the grammar is ambiguous:
Q8a. Define NFA with \varepsilon-transitions with an example.20247m
Module 1: Introduction & Regular Languages
View this question on its own page →Define NFA with -transitions with an example.
Q8b. Prove the pumping lemma for regular languages.20247m
Module 1: Introduction & Regular Languages
View this question on its own page →Prove the pumping lemma for regular languages.
Q9a. Write short notes on: 1. Minimization of DFA 2. Type 2 grammar (Context-Free Grammar)20247m
Module 1: Introduction & Regular Languages
View this question on its own page →Write short notes on:
- Minimization of DFA
- Type 2 grammar (Context-Free Grammar)
Q9b. Write short notes on: 1. Post Correspondence Problem (PCP) 2. NP-hard problem20247m
Module 5: Undecidability
View this question on its own page →Write short notes on:
- Post Correspondence Problem (PCP)
- NP-hard problem
Coursify Android App
Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.