Question
Official answer and solution
- Official answer
- D
- From
- Official GATE 2016 answer key
Solution
Trace the behavior of the PDA on inputs to determine the accepted language and verify whether the transition relation satisfies determinism.
Examine the transitions of the PDA:
- Initial state is with stack bottom marker . State is an accepting state (double circle).
- On input in state : and . Each pushes an onto the stack.
- Since is an accepting state, any sequence of 's alone is accepted by entering no further transitions. Thus, .
Transitions involving :
- From , on input with on top: , popping one .
- In state , on input with on top: , popping one for each .
- From , on with on top: , reaching accepting state .
- State has no outgoing transitions. It is reached if and only if the number of 's matches the number of 's that were pushed on the stack ( occurrences of followed by occurrences of ).
Therefore, strings of the form for (and at ) are accepted.
Total accepted language:
Checking for determinism (DPDA):
- In state : transitions are defined for , , and . There are no -transitions from , and each input/stack combination has at most one choice.
- In state : transition on input requires stack top , while the -transition requires stack top . Because the stack symbols and are disjoint, there is never a choice between reading an input symbol and taking an -move.
- In state : no transitions exist.
Since every configuration has at most one valid move, the PDA is deterministic. Hence, is a deterministic context-free language (DCFL).
D
Assuming that having an epsilon transition from makes the PDA non-deterministic, ignoring that the epsilon transition requires stack symbol while the -loop requires stack symbol .
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2016 Computer Science and Information Technology (CS) Session 1
- Question
- 53 of 65, printed as CS Q.43
- 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.