Question
Let . Let . Which one of the following is TRUE?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2014 answer key
Solution
Evaluate substring transition counting bounds to determine regularity of each language.
-
Analysis of :
- Consider the patterns and .
- A pattern occurs when a sequence of at least two 1s transitions into a 0 (i.e.,
...110...). - A pattern occurs when a 0 transitions into at least two 1s (i.e.,
...011...). - In any binary string, to have another , the string must transition back through to enter a block of 1s again.
- Consequently, occurrences of and strictly alternate along the string, meaning that for any prefix :
- Because the difference between the two counts is strictly bounded by 1, a finite automaton with a small number of states can keep track of the difference.
- Therefore, is regular.
-
Analysis of :
- Consider strings in the regular subset , specifically strings of the form for .
- In , the substring occurs exactly times.
- In , the substring occurs exactly times.
- There are no overlapping or cross-patterns between 0 and 1.
- For , we must have . The language is a well-known non-regular context-free language.
- Since intersection with a regular language yields a non-regular language, CANNOT be regular.
-
Conclusion:
is regular but not , matching option (A).
A
Assuming that any language counting occurrences of two different substrings must be non-regular; when occurrences strictly alternate, the difference remains bounded and the language is regular.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 2
- Question
- 46 of 65, printed as CS Q.36
- 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.