THEORY OF COMPUTATION/Student Engineering Notebook
Page 06·notes
CONTEXT-FREE GRAMMARS, AMBIGUITY & PUSHDOWN AUTOMATA—~30 MIN READ

Pushdown Automata (PDA), DPDA vs NPDA & Acceptance Modes

“Stack transitions, DPDA strictly less powerful than NPDA, and DCFL vs CFL.”

1.Pushdown Automata: Formal Definition & Operation

A Pushdown Automaton (PDA) augments a finite state automaton with an unbounded Last-In-First-Out (LIFO) stack memory.

Formally defined as a 7-tuple: M = (Q, \Sigma, \Gamma, \delta, q_0, Z_0, F), where:

- \Gamma: Finite stack alphabet.

- Z_0 \in \Gamma: Initial start symbol on the stack.

- \delta: Transition function mapping Q × (\Sigma \cup {\epsilon}) × \Gamma \to 2^{Q × \Gamma^*}.

Two Acceptance Modes:

1. Acceptance by Final State (L(M)): The input is fully consumed and the PDA halts in an accepting state q \in F (stack contents are ignored).

2. Acceptance by Empty Stack (N(M)): The input is fully consumed and the stack becomes completely empty (state is ignored).

Equivalence Theorem: For Non-deterministic PDAs (NPDA), L(M) and N(M) accept the EXACT SAME class of languages (Context-Free Languages).

2.The Power Asymmetry: DPDA vs NPDA

In finite automata, determinism and non-determinism have identical expressive power (DFA = NFA).

For Pushdown Automata, determinism is strictly weaker:

$DCFL \subsetneq CFL$

- Deterministic Pushdown Automata (DPDA): At most one transition is possible for any state, input symbol (or \epsilon), and top-of-stack symbol. The languages accepted by DPDA are Deterministic Context-Free Languages (DCFL).

- Classic Distinctions:

- Even-length palindromes L = { w w^R \mid w \in \Sigma^* } is CFL but NOT DCFL (requires non-determinism to guess the midpoint).

- Marked palindromes L = { w c w^R \mid w \in \Sigma^* } IS DCFL (the center marker c signals when to switch from pushing to popping).

- L = { a^n b^n \mid n ≥ 1 } \cup { a^n b^{2n} \mid n ≥ 1 } is CFL but NOT DCFL.

notice this:— DCFL vs CFL Closure Properties Contrast

DCFL is CLOSED under COMPLEMENT, but NOT closed under union or intersection! In contrast, CFL is CLOSED under UNION, but NOT closed under complement or intersection! This contrast is one of the most tested theoretical facts in GATE CS.

3. Closure Properties: DCFL vs CFL

Side-by-side comparison of closure properties:

OperationDCFL (DPDA)CFL (NPDA)
ComplementYES (Closed!)NO (Not closed)
UnionNO (Not closed)YES (Closed)
IntersectionNO (Not closed)NO (Not closed)
Intersection with RegularYES (Closed)YES (Closed)
ConcatenationNO (Not closed)YES (Closed)
Kleene StarNO (Not closed)YES (Closed)
ReversalNO (Not closed)YES (Closed)
WORKED NUMERICAL · STUDENT DERIVATION✎ Key Takeaway: This PDA is deterministic. Choosing where the middle is, as in wwᴿ, needs nondeterminism.

Worked example: a PDA for aⁿbⁿ

Problem Statement:
Design a PDA for { aⁿbⁿ : n ≥ 0 }.
Step 1: Push on a

In state q0, each a pushes an A.

Step 2: Switch on b

On the first b, move to q1 and pop an A.

Step 3: Pop on each b

In q1, each b pops an A. An a in q1 is rejected.

Step 4: Accept

Accept when the input ends and only the bottom marker is left.

Final Answer:Two states; the stack counts the a's
STUDENT PRACTICE · CONCEPT DRILL

Practice: test yourself

Original practice questions in the GATE style, with worked explanations. Not past-paper questions.

Problem 1 · GATE-LEVEL

Which language needs a nondeterministic PDA?

Problem 2 · TRICKY

For nondeterministic PDAs, acceptance by final state and by empty stack:

Problem 3 · FOUNDATION

A PDA with two stacks is as powerful as:

SOURCE TRANSPARENCY & CITATIONS

Primary Academic References & Exam Sources

Every concept in Notes From a B.Tech Brain is synthesized from authoritative academic texts, seminal peer-reviewed research, verified exam archives, and renowned university lectures.

Curated University Lecture Series
Introduction to Automata Theory, Languages, and Computation (3rd Edition) ·
LECTURE SERIES
RECOMMENDED YOUTUBE EDUCATORS & FULL-COURSE PLAYLISTS

Curated for clarity, rigorous numerical solving, and semester excellence:

Gate Smashers · Theory of Computation↗Instructor: Varun Singla · Covers: DFA/NFA, minimization, CFG, PDA, Turing machines, decidability

GATE-focused with clear minimal DFA construction and language classification.

Open YouTube↗
Knowledge Gate · TOC for GATE↗Instructor: Sanchit Jain · Covers: Regular expressions, pumping lemma, closure properties, Rice's theorem

Exam-pattern oriented with closure table drilling and decidability proofs.

Open YouTube↗
Ravindrababu Ravula · TOC Lectures↗Instructor: Ravindrababu Ravula · Covers: Formal proofs, Myhill-Nerode theorem, undecidability reductions

Mathematically rigorous treatment for high-rank GATE aspirants.

Open YouTube↗