Consider the pushdown automaton below, which runs on the input alphabet , has stack alphabet , and has three states , with being the start state. A transition from state to state , labelled , where is an input symbol or is a stack symbol, and is a string of stack symbols, represents the fact that in state , the can read from the input, with on the top of its stack, pop from the stack, push in the string on the stack, and go to state . In the initial configuration, the stack has only the symbol in it. The accepts by empty stack.

Which one of the following options correctly describes the language accepted by
View worked solution
Answer: A
To find the language accepted by the PDA by empty stack, let us trace the transitions step-by-step:
- State (Pushing 's): The self-loops on state are and . This means for every input symbol , one is pushed onto the stack. To push any and proceed, we must read at least one , so . After reading , the stack contains .
- Transition to state (Reading 's): The transition from to is , and the self-loop on is . This means we must read at least one to leave state , which implies . Each read pops one from the stack. After reading , the stack has .
- Transition to state (Emptying the stack): The transition from to is . This is an -transition that pops an without consuming any input. For this transition to be valid, there must be at least one remaining on the stack after reading all 's. This requires:
- State : Once in state , the self-loop pops any remaining 's, and the transition pops the bottom-of-stack marker , emptying the stack and accepting the string.
Combining these conditions, we get and . Thus, the accepted language is:
Free practice · Your answers on this page are not saved.
