Which of the following are decidable?
- Whether the intersection of two regular languages is infinite
- Whether a given context-free language is regular
- Whether two push-down automata accept the same language
- Whether a given grammar is context-free
View worked solution
Answer: B
To determine which of the problems are decidable, let us analyze each statement individually:
- Whether the intersection of two regular languages is infinite:
Regular languages are closed under intersection. If and are regular languages represented by DFAs, we can construct a product DFA representing . To check if this resulting regular language is infinite, we can check if the DFA contains a cycle that is reachable from the start state and can reach an accepting state. Since this graph reachability and cycle detection can be done in finite time, this problem is decidable.
- Whether a given context-free language is regular:
Testing whether a given Context-Free Language (CFL) is regular is a well-known undecidable problem. There is no algorithm that can determine if an arbitrary CFG generates a regular language.
- Whether two push-down automata accept the same language:
This is the equivalence problem for PDAs (or CFLs), i.e., determining if . The equivalence problem for context-free languages is undecidable.
- Whether a given grammar is context-free:
A grammar is context-free if every production rule in is of the form , where and . Since a grammar is defined by a finite set of rules, we can verify this syntactic condition for each rule in finite time. Thus, this is trivially decidable.
Therefore, only statements I and IV are decidable, which corresponds to option B.
Free practice · Your answers on this page are not saved.
