Retrieving academic index assets...
Makaut
HomePYQsTests
Pricing
Sign Up
Makaut

The premier academic archive for MAKAUT students, providing curated previous year questions, solutions, and official syllabus resources.

Get the Mobile App
GET IT ONGoogle Play
Download on theApp Store
Download from Indus App Store
Platform
  • Home
  • PYQs
  • Question Papers
  • Viva Questions
  • Important Questions
  • Syllabus
  • Academic Tools
  • Pricing
  • Blog
Guidelines
  • Disclaimer
  • Community Guidelines
Company
  • About
  • Contact
  • FAQ
Legal
  • Privacy Policy
  • Terms of Service
  • Refund Policy
  • Cookie Policy
  • Subscription Policy
© 2026 MAKAUT Study Dev Hub. All rights reserved.
Platform version: v1.0.0
Viva Questions/PCC-CS403
Semester 4PCC-CS403

Formal Language & Automata Theory (PCC-CS403) Viva Questions and Answers

35 Questions•9 min read
Prepared from MAKAUT past-year question papers.
Practice Mode:All answers visible
Jump to Topic
Basic definitions (1)DFA vs NFA (1)NFA to DFA (1)DFA design (2)Regular languages (1)Pumping lemma (3)Regular expressions (2)Arden's theorem (1)Minimization (2)Myhill-Nerode theorem (1)CFG basics (1)Derivations (1)CFG design (2)Normal forms (3)PDA basics (1)PDA design (1)PDA (2)Closure properties (2)Language hierarchy (1)Limitations of FSM (1)Finite state machines with output (1)Machine conversion (1)Information lossless machines (1)Turing machines (2)

Basic definitions

1 question
Q1.EASY

What is a formal language, and how is it different from the alphabet it uses?

An alphabet Σ\SigmaΣ is a finite non-empty set of symbols, while a formal language is any subset of Σ∗\Sigma^*Σ∗, i.e., a set of strings over that alphabet. So the alphabet is the building material and the language is a chosen collection of strings built from it.

DFA vs NFA

1 question
Q2.EASY

Why do we say a DFA is deterministic but an NFA is not?

In a DFA, for each state and input symbol there is exactly one next state, so the run is unique. In an NFA, a state may have zero, one, or many transitions on the same symbol (and ε\varepsilonε-moves), so several computation paths are possible.

NFA to DFA

1 question
Q3.MEDIUM

Can a DFA simulate an NFA? How?

Yes. Every NFA can be converted to an equivalent DFA using the subset construction, where DFA states are sets of NFA states. The resulting DFA may have up to 2n2^n2n states but accepts exactly the same language.

DFA design

2 questions
Q4.MEDIUM

Design a DFA over {0,1}\{0,1\}{0,1} that accepts strings with an odd number of 0's.

Take two states q0q_0q0​ (even count) and q1q_1q1​ (odd count), with q0q_0q0​ as start and q1q_1q1​ as final. On 0, toggle between them; on 1, stay in the same state. So δ(q0,0)=q1\delta(q_0,0)=q_1δ(q0​,0)=q1​, δ(q1,0)=q0\delta(q_1,0)=q_0δ(q1​,0)=q0​, and 1 keeps the state unchanged.
Q5.MEDIUM

How would you build a DFA for strings with even number of 0's and even number of 1's?

Use four states tracking the parity of 0's and 1's: (even,even)(even,even)(even,even), (even,odd)(even,odd)(even,odd), (odd,even)(odd,even)(odd,even), (odd,odd)(odd,odd)(odd,odd). Each input symbol flips the corresponding parity bit, and only (even,even)(even,even)(even,even) is final. This is just the product construction of two parity DFAs.

Regular languages

1 question
Q6.EASY

What is a regular language, and which machines recognize it?

A regular language is one that can be denoted by a regular expression, or equivalently accepted by a DFA, NFA, or ε\varepsilonε-NFA. These three models are all equivalent in power, and regular languages are also exactly those generated by regular (type-3) grammars.

Pumping lemma

3 questions
Q7.MEDIUM

State the pumping lemma for regular languages.

For every regular language LLL there exists a pumping length ppp such that any string w∈Lw \in Lw∈L with ∣w∣≥p|w| \ge p∣w∣≥p can be written as w=xyzw = xyzw=xyz, where ∣xy∣≤p|xy| \le p∣xy∣≤p, ∣y∣≥1|y| \ge 1∣y∣≥1, and xyiz∈Lxy^iz \in Lxyiz∈L for all i≥0i \ge 0i≥0.
Q8.MEDIUM

Using the pumping lemma, show that L={0i1i∣i≥1}L = \{0^i 1^i \mid i \ge 1\}L={0i1i∣i≥1} is not regular.

Assume LLL is regular with pumping length ppp and take w=0p1pw = 0^p 1^pw=0p1p. Then yyy lies entirely in the 0p0^p0p block, so xy2zxy^2zxy2z has more 0's than 1's and is not in LLL, a contradiction. Hence LLL is not regular.
Q9.MEDIUM

What does the pumping lemma actually prove, and what is its limitation?

It is a necessary condition for regularity, so it can only be used to prove a language is not regular. Passing the pumping lemma does not guarantee regularity, so it cannot be used to prove a language is regular.

Regular expressions

2 questions
Q10.EASY

Give the regular expression for strings over {a,b}\{a,b\}{a,b} ending in 00.

The expression is (a+b)∗00(a+b)^*00(a+b)∗00. The prefix can be any string, and the last two symbols must be 00, so the DFA needs three states tracking the trailing zeros.
Q11.EASY

What are Kleene closure and positive closure? Give an example of each.

Kleene closure L∗L^*L∗ is the set of all finite concatenations of strings from LLL, including ε\varepsilonε; positive closure L+L^+L+ is the same but excludes ε\varepsilonε. For L={a}L=\{a\}L={a},
L∗={ε,a,aa,… }L^*=\{\varepsilon, a, aa, \dots\}L∗={ε,a,aa,…}
and L+={a,aa,… }L^+=\{a, aa, \dots\}L+={a,aa,…}.

Arden's theorem

1 question
Q12.MEDIUM

What is the solution to the equation R=Q+RPR = Q + RPR=Q+RP, and where is it used?

By Arden's theorem, if PPP does not contain ε\varepsilonε, the solution is R=QP∗R = QP^*R=QP∗. We use it to convert a DFA's transition equations into a regular expression.

Minimization

2 questions
Q13.MEDIUM

What is the difference between distinguishable and indistinguishable states?

Two states are distinguishable if some input string takes exactly one of them to a final state. If no such string exists, they are indistinguishable and can be merged during minimization.
Q15.MEDIUM

How do you minimize a DFA using the table-filling method?

First remove unreachable states, then mark all pairs where one is final and the other is not. Repeatedly mark pairs whose transitions on some symbol go to an already marked pair, until no new pairs are marked. Unmarked pairs are merged into a single state.

Myhill-Nerode theorem

1 question
Q14.HARD

State the Myhill-Nerode theorem.

A language LLL is regular iff the relation ≡L\equiv_L≡L​ (where x≡Lyx \equiv_L yx≡L​y if for all zzz, xz∈L⇔yz∈Lxz \in L \Leftrightarrow yz \in Lxz∈L⇔yz∈L) has finitely many equivalence classes. The number of classes equals the number of states in the minimal DFA.

CFG basics

1 question
Q16.EASY

What is a context-free grammar, and what is a derivation?

A CFG is a 4-tuple (V,T,P,S)(V, T, P, S)(V,T,P,S) where every production has a single nonterminal on the left. A derivation is a sequence of replacements of nonterminals by right-hand sides, starting from SSS, that produces a string of terminals.

Derivations

1 question
Q17.EASY

What is the difference between leftmost and rightmost derivation?

In a leftmost derivation, the leftmost nonterminal is always expanded first; in a rightmost derivation, the rightmost nonterminal is expanded first. Both produce the same string, but the parse trees are built in different orders.

CFG design

2 questions
Q18.MEDIUM

Write a CFG for palindromes over {0,1}\{0,1\}{0,1}.

Use S→0S0∣1S1∣0∣1∣εS \to 0S0 \mid 1S1 \mid 0 \mid 1 \mid \varepsilonS→0S0∣1S1∣0∣1∣ε. The recursive productions wrap matching symbols around the centre, which is exactly what makes a palindrome.
Q19.MEDIUM

Give a CFG for L={ambncm∣m,n>0}L = \{a^m b^n c^m \mid m,n > 0\}L={ambncm∣m,n>0}.

Use S→aSc∣aBcS \to aSc \mid aBcS→aSc∣aBc and B→bB∣bB \to bB \mid bB→bB∣b, or simply S→aSc∣aXcS \to aSc \mid aXcS→aSc∣aXc, X→bX∣bX \to bX \mid bX→bX∣b. The matching aaa and ccc counts are tied together, while bbb's are generated independently.

Normal forms

3 questions
Q20.MEDIUM

What is Chomsky Normal Form, and why is it useful?

CNF restricts every production to A→BCA \to BCA→BC (two nonterminals) or A→aA \to aA→a (one terminal), with S→εS \to \varepsilonS→ε allowed only if ε∈L\varepsilon \in Lε∈L. It is useful for parsing algorithms like CYK and for proving properties of CFLs.
Q21.MEDIUM

What is Greibach Normal Form?

In GNF every production is of the form A→aαA \to a\alphaA→aα, where aaa is a terminal and α\alphaα is a string of nonterminals (possibly empty). It gives a leftmost derivation in which exactly one terminal is produced per step.
Q22.EASY

Which of these productions is in CNF: A→BCA \to BCA→BC, A→BcA \to BcA→Bc, A→aA \to aA→a?

Only A→BCA \to BCA→BC and A→aA \to aA→a are in CNF. The production A→BcA \to BcA→Bc mixes a nonterminal and a terminal, so it must be rewritten using a new nonterminal, e.g., A→BCA \to BCA→BC with C→cC \to cC→c.

PDA basics

1 question
Q23.EASY

What is a pushdown automaton, and why does it need a stack?

A PDA is a finite automaton plus an unbounded stack, defined as (Q,Σ,Γ,δ,q0,Z0,F)(Q, \Sigma, \Gamma, \delta, q_0, Z_0, F)(Q,Σ,Γ,δ,q0​,Z0​,F). The stack lets it remember an unbounded count, which is why PDAs accept exactly the context-free languages, unlike finite automata.

PDA design

1 question
Q24.MEDIUM

Construct a PDA for L={w∈{a,b}∗∣wL = \{w \in \{a,b\}^* \mid wL={w∈{a,b}∗∣w has equal numbers of aaa's and bbb's}\}}.

Push aaa on reading aaa when the top is aaa or Z0Z_0Z0​, and pop on reading bbb when the top is aaa (and symmetrically for bbb). If the stack becomes empty, accept; this keeps the stack height equal to the current difference between counts.

PDA

2 questions
Q25.MEDIUM

What is the difference between a DPDA and an NPDA?

A DPDA has at most one legal move for each state, input symbol, and stack top, while an NPDA may have several. NPDAs accept all context-free languages, whereas DPDAs accept only the deterministic context-free languages, a strict subset.
Q26.MEDIUM

What are ε\varepsilonε-transitions in an NPDA, and why are they useful?

They are moves made without consuming input, changing only the stack. They let the PDA guess, for example, the middle of a string when checking wwRww^RwwR, which is essential for nondeterministic acceptance.

Closure properties

2 questions
Q27.HARD

Are context-free languages closed under intersection and complement?

No. CFLs are closed under union, concatenation, and Kleene star, but not under intersection or complement. For example,
{anbncm}∩{anbmcm}={anbncn}\{a^nb^nc^m\} \cap \{a^nb^mc^m\} = \{a^nb^nc^n\}{anbncm}∩{anbmcm}={anbncn}
, which is not context-free.
Q28.MEDIUM

What happens when you intersect a CFL with a regular language?

The result is always context-free. This is proved by running the PDA and the DFA in parallel using a product construction, so regularity acts as a safe restriction on CFLs.

Language hierarchy

1 question
Q29.HARD

Is L={anbncndn∣n≥1}L = \{a^n b^n c^n d^n \mid n \ge 1\}L={anbncndn∣n≥1} regular, context-free, or neither?

It is neither regular nor context-free. The pumping lemma for CFLs fails for it, and intuitively a single stack cannot enforce four equal counts, so it needs a more powerful model like a Turing machine.

Limitations of FSM

1 question
Q30.MEDIUM

Why can't a finite state machine recognize palindromes?

Recognizing palindromes requires remembering the first half of the input to compare it with the reversed second half. A finite automaton has only finitely many states and no unbounded memory, so it cannot track arbitrarily long prefixes.

Finite state machines with output

1 question
Q31.MEDIUM

What is a Mealy machine, and how does it differ from a Moore machine?

A Mealy machine produces output on each transition, so output depends on the current state and the input; a Moore machine produces output on each state. Mealy machines typically need fewer states, but Moore outputs are easier to observe.

Machine conversion

1 question
Q32.MEDIUM

How do you convert a Mealy machine to a Moore machine?

Split each Mealy state according to the outputs produced on its incoming transitions, so each new state carries a fixed output. Then redirect transitions to the appropriate split state and add a start state output if required.

Information lossless machines

1 question
Q33.HARD

What is an information lossless machine?

A sequential machine is information lossless if, given the final state and the output sequence, the input sequence can be uniquely determined. It matters in testing and cryptography, where we want to recover the input from the observed output.

Turing machines

2 questions
Q34.MEDIUM

What is a Turing machine, and how does it differ from a PDA?

A Turing machine has a finite control and an unbounded read/write tape with a movable head, while a PDA has a stack with restricted access. The tape gives a TM the power to recognize recursively enumerable languages, which is strictly more than CFLs.
Q35.MEDIUM

Design a Turing machine that accepts all strings of even length over {a,b}\{a,b\}{a,b}.

Simply move the head right across the input, toggling between two states 'even' and 'odd' on each symbol. When a blank is reached, accept if in the 'even' state and reject otherwise; no writing is needed.

Frequently Asked Viva Voce Questions

High-priority theoretical and lab evaluation questions typically tested by MAKAUT external examiners.

Related Course Resources

SYLLABUSFormal Language & Automata Theory Syllabus & Handouts
Open resource
PYQSemester 4 PYQ Papers
Open resource

On This Page

24 Units
Basic definitions1
DFA vs NFA1
NFA to DFA1
DFA design2
Regular languages1
Pumping lemma3
Regular expressions2
Arden's theorem1
Minimization2
Myhill-Nerode theorem1
CFG basics1
Derivations1
CFG design2
Normal forms3
PDA basics1
PDA design1
PDA2
Closure properties2
Language hierarchy1
Limitations of FSM1
Finite state machines with output1
Machine conversion1
Information lossless machines1
Turing machines2