Regular Language · Theory of Computation
29 questions · asked in 18 of 27 years (2000–2026)
MCQ 25 · MSQ 3 · NAT 11-mark 20 · 2-mark 9
2000Questions per year2026
Questions 1–5 of 29
Let and be two languages over a finite alphabet, such that and are regular languages.
Which of the following statements is/are always true?
Which of the following statements is/are always true?
One or more options are correct.
Answer: (C)
Take (regular) and (not even context-free). Then is regular and is regular, so the given conditions hold.
(A) is not regular here. Not always true.
(B) is not regular here. Not always true.
(D) is not context-free here. Not always true.
(C) is regular, and regular languages are closed under complement, so is regular. Every regular language is context-free, so is context-free. Always true.
Answer: (C)
(A) is not regular here. Not always true.
(B) is not regular here. Not always true.
(D) is not context-free here. Not always true.
(C) is regular, and regular languages are closed under complement, so is regular. Every regular language is context-free, so is context-free. Always true.
Answer: (C)
Consider the following two languages over the alphabet :
Which ONE of the following statements is CORRECT?
Which ONE of the following statements is CORRECT?
Answer: (C)
is not regular. Use prefixes for . Take and the suffix .
- is in : take and , which is non-empty because .
- is not in . must be a prefix, so it starts with , and a suffix, so it ends with . The only suffix that starts with and is shorter than the whole string is . Then is the whole string and nothing is left for .
So the prefixes are pairwise distinguishable, and a finite automaton would need infinitely many states.
is regular. Here has only 's, so taking works whenever any longer works. So is the set of strings of length at least 3 that start and end with . Its regular expression is .
Answer: (C)
- is in : take and , which is non-empty because .
- is not in . must be a prefix, so it starts with , and a suffix, so it ends with . The only suffix that starts with and is shorter than the whole string is . Then is the whole string and nothing is left for .
So the prefixes are pairwise distinguishable, and a finite automaton would need infinitely many states.
is regular. Here has only 's, so taking works whenever any longer works. So is the set of strings of length at least 3 that start and end with . Its regular expression is .
Answer: (C)
Let . For , and , let denote the number of occurrences of in .
Which one or more of the following option(s) define(s) regular language(s)?
Which one or more of the following option(s) define(s) regular language(s)?
One or more options are correct.
Answer: (A), (C)
(A) is the language of , since the two counts are independent. Regular.
(B) Intersecting with removes every string containing . So must be empty, which forces . What is left is . If is the pumping length, pumping the 's of gives more or fewer 's than 's. Not regular.
(C) Only and matter. A DFA with states can keep both remainders and accept the state . Regular.
(D) Intersect with the regular language . This gives . For a pumping length , take with and . The pumped part lies in the 's, and pumping it down leaves fewer 's than 's, so the string leaves the language. This intersection is not regular, and regular languages are closed under intersection, so (D) is not regular.
Answer: (A), (C)
(B) Intersecting with removes every string containing . So must be empty, which forces . What is left is . If is the pumping length, pumping the 's of gives more or fewer 's than 's. Not regular.
(C) Only and matter. A DFA with states can keep both remainders and accept the state . Regular.
(D) Intersect with the regular language . This gives . For a pumping length , take with and . The pumped part lies in the 's, and pumping it down leaves fewer 's than 's, so the string leaves the language. This intersection is not regular, and regular languages are closed under intersection, so (D) is not regular.
Answer: (A), (C)
Let be two regular languages and a language which is not regular. Which of the following statements is/are always TRUE?
One or more options are correct.
Answer: (C), (D)
(A) only says . Equality also needs . For example, and satisfy the condition but are not equal. False.
(B) Take . Then is regular. Not always true.
(C) If were regular, its complement would be regular, because regular languages are closed under complement. That contradicts the given. So is not regular. True.
(D) Regular languages are closed under complement and union, so is regular. True.
Answer: (C), (D)
(B) Take . Then is regular. Not always true.
(C) If were regular, its complement would be regular, because regular languages are closed under complement. That contradicts the given. So is not regular. True.
(D) Regular languages are closed under complement and union, so is regular. True.
Answer: (C), (D)
Let be the language represented by the regular expression and , where denotes the length of string . The number of strings in which are also in is ___
Answer: 15
The language has one a, then pairs of a's, with any number of b's in between. So it is the set of strings with an odd number of a's.
Now count the strings with an odd number of a's whose length is :
- length 1: 1 (a)
- length 2:
- length 3:
- length 4:
Adding these:
Answer: 15
Now count the strings with an odd number of a's whose length is :
- length 1: 1 (a)
- length 2:
- length 3:
- length 4:
Adding these:
Answer: 15
Keep practising