4.6.10 · D1Theory of Computation

Foundations — Pushdown automata (PDA) — configuration, acceptance by empty stack - final state

2,349 words11 min readBack to topic

Before you can read a single line of the parent note, you must own every symbol it throws at you. Below, each symbol is built from nothing: plain words → the picture → why the topic can't live without it. Read top to bottom; each rung needs the one below it.


0. The rock-bottom pieces: alphabets, symbols, strings

Picture it: think of a paper ticket tape. Each little cell holds one symbol; reading left to right gives you the string.

Figure — Pushdown automata (PDA) — configuration, acceptance by empty stack  -  final state

WHY two alphabets? The letters you read and the tokens you store serve different jobs. On the input you might see a, but on the stack you might store a bookkeeping token A. Keeping and separate lets the machine invent its own private memory symbols.

WHY exists at all: the machine sometimes wants to move without reading a letter (rearrange plates), or accept a string that has no letters left. Both need a name for "nothing." That name is .


1. The star operator and

Picture it: is an infinite bag of tickets — the blank ticket , all length-1 tickets, all length-2 tickets, and so on forever. Each individual ticket is finite; the bag is infinite.

WHY the topic needs it: the parent writes a configuration as living in . The "remaining input" is some string over (an element of ), and the "stack contents" is some string over (an element of ). The star is how we say "any finite sequence, we don't fix the length."


2. Sets, membership , subset , power set

Picture it: a set is a fenced field of objects. is "this cow stands inside the fence." is "this small pen sits entirely inside the big field." is "the catalogue of every possible pen you could draw inside ."

WHY the topic needs each one:

  • says the final states are some of the states.
  • says the start state is one particular state.
  • 's output is a member of — i.e. a finite set of possible moves, which is exactly how nondeterminism ("try several branches") is written down.

3. Ordered pairs, triples, and the product

Picture it: a grid. Put along the bottom edge, up the side; every cell of the grid is one pair . is "all the cells."

Figure — Pushdown automata (PDA) — configuration, acceptance by empty stack  -  final state

WHY the topic needs it: a configuration is a triple — one state, one leftover input, one stack. Saying it lives in is the precise way to say "pick one item from each of these three sets, in this order." Tuples are how the machine's entire momentary situation gets packaged into a single object.


4. What a "state" and the finite control are

Picture it: a dial with a fixed number of labelled positions. The dial can click from one position to another, but there are only so many positions — you cannot store "I've seen 4000 letters" on a dial with 3 positions.

WHY the topic needs it (the whole punchline): the finite control alone is a finite automaton, which cannot count without bound. Bolt on a stack and suddenly it can. Understanding "the state is bounded memory" is why the stack matters. If you have met the finite-control idea before, it is exactly the machinery of a nondeterministic finite automaton (NFA).


5. The stack — LIFO memory

Picture it: a spring-loaded plate dispenser in a canteen. You can only ever add or take the top plate. The plate at the bottom is untouchable until everything above it is gone.

Figure — Pushdown automata (PDA) — configuration, acceptance by empty stack  -  final state

WHY: without a marker, the machine cannot tell "stack is nearly empty" from "stack has real work left." is a floor tile you can see so you know when you've reached the bottom.


6. The transition function and the arrow

WHY this exact shape: at any instant the machine can look at only three things — its mood, the one letter under the read head, and the one plate on top. So the input to is a triple of exactly those. The output is a set (because nondeterminism allows several legal moves) of pairs (because a move both changes the mood and rewrites the top of the stack).


7. The configuration triple and the yields arrows ,

Picture it: freeze the machine mid-run and photograph three things — the dial position, the still-unread part of the tape, and the plate pile (drawn on its side, top plate at the left). That photo is the configuration. Crucially it holds everything about the future and nothing about the past.

Picture it: is one frame-to-next-frame step of a film. is "you can get from this frame to that frame by playing some number of frames, possibly zero."

WHY both: a single rule of produces a single step; but "the machine accepts " is a statement about a whole run, i.e. many steps chained — that is what names in one symbol.


8. Acceptance — two finish lines

WHY name two: they are different finish lines but, provably, they let a PDA recognise exactly the same class of languages — the context-free languages. The parent note builds both and converts between them; here you just need to know they are two answers to "when did the machine pass?"


Prerequisite map

symbol and alphabet

string and empty string eps

Kleene star Sigma-star and Gamma-star

sets membership subset power set

Cartesian product and tuples

configuration triple q w gamma

state and finite control

stack LIFO and bottom marker Z0

transition function delta

yields relation turnstile

acceptance empty stack or final state

prereq NFA


Equipment checklist

Self-test: cover the right side and answer each aloud.

What is the difference between and ?
is the input alphabet (letters you read); is the stack alphabet (tokens you store) — they may share symbols but serve different jobs.
What does mean, and how is it different from a blank space?
The empty string, length zero — literally no symbols at all, not a space character.
What does denote?
The set of all finite strings over , including the empty string .
Read in words.
Given (state, next input or nothing, top stack symbol), return a finite set of (new state, string to push) pairs.
Why is 's output a set, not a single move?
Because PDAs are nondeterministic — several legal moves may exist from one situation.
What three things does a configuration record?
Current state, remaining unread input, and the full stack (top written leftmost).
In the stack string , which symbol is on top?
— by convention the top of the stack is written leftmost.
What is LIFO and why does a PDA use a stack rather than a queue?
Last-In-First-Out; nested structure is last-opened-first-closed, which LIFO matches exactly.
What does do?
It is the bottom-of-stack marker so the machine can tell when the stack is (near) empty.
Difference between and ?
is exactly one move; is zero or more moves chained together.
State each acceptance mode in one line.
Final state: end on a final state, ignore stack. Empty stack: end with empty stack, ignore state.
Which earlier machine is the PDA's finite control equivalent to?
A nondeterministic finite automaton — the states plus -moves, before adding the stack.