Pushdown Automata (PDA)

the stack alphabet

/ Gamma = the symbol Γ /

When a pushdown automaton scribbles notes on its stack, what 'alphabet' is it allowed to write in? Not necessarily the same letters that appear in the input. The stack alphabet, written Γ (Gamma), is the separate, finite set of symbols the machine may push onto and pop off its stack. Think of it as the machine's private shorthand: the input is in one language, but the markers it keeps for itself can be in another.

Keeping the stack alphabet Γ separate from the input alphabet Σ (Sigma) is genuinely useful. The PDA can invent dedicated bookkeeping symbols that never appear in any input string — for instance a single marker X used purely to count a's, or a special bottom-of-stack symbol that signals 'the stack is empty below here'. In the a^n b^n machine, the input alphabet is {a, b} but the stack alphabet might be {X, Z0}: X is pushed once per a, and Z0 is the initial symbol that was never read from the input at all. By convention Σ and Γ may overlap, but they are allowed to be completely different sets.

This is a small but important design freedom. Because the stack symbols are chosen independently, a PDA can encode rich information about its progress without being limited to echoing back input letters. When you later see a grammar converted into a PDA, the stack alphabet typically holds the grammar's terminals AND its variables together — a vocabulary much larger than the input alphabet, used to simulate a derivation on the stack.

For a^n b^n: input alphabet Σ = {a, b}; stack alphabet Γ = {X, Z0}. The symbol X is pure bookkeeping (one per a) and Z0 marks the bottom of the stack — neither X nor Z0 is ever part of an input string.

Γ (the stack alphabet) is a separate finite set, free to contain private bookkeeping symbols.

Σ and Γ are conceptually different sets even when they share letters. Confusing them is a common slip: a transition reads an INPUT symbol from Σ but pushes and pops STACK symbols from Γ.

Also called
GammaΓstack symbols堆疊符號集