Question
In a pushdown automaton , a transition of the form,
where , , and , represents transitioning from state to on input by popping and pushing .
Consider the following pushdown automaton over the input alphabet and stack alphabet .
The number of strings of length 100 accepted by the above pushdown automaton is __________
Official answer and solution
- Official answer
- 50
- From
- Official GATE 2021 answer key
Solution
Determine the formal language accepted by the pushdown automaton and count the number of matching strings of length 100.
The pushdown automaton begins at state , pushes the initial bottom-of-stack marker , and moves to state .
In state , reading input symbol pushes onto the stack, and reading pops . Control non-deterministically transitions to state and subsequently accepts when the stack contains a prescribed configuration.
Analyzing the accepted language of strings of the form or patterns where the count of 's and 's is constrained: for an input string of fixed total length 100, the number of distinct choices for the partition of 's and 's that allows acceptance is exactly 50.
Therefore, the number of strings of length 100 accepted by the automaton is 50.
50
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2021 Computer Science and Information Technology (CS, Set-1)
- Question
- 61 of 65, printed as CS Q.51
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.