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
Questions 26–29 of 29
Answer: (C)
A. There are only finitely many digit primes. Take the largest of them as . Then the DFA needs states, including one for and one for . No change of state is needed for any .
B. Here only states are enough to recognise .
When the difference goes above or below , the DFA moves to a dead state. Every other state is accepting. Going to the dead state works because of the words "for every prefix of " in . This is what makes the language regular.
C. is not regular.
By the Myhill-Nerode theorem, these sets are all distinct equivalence classes. From a string in any one set, we can append a string that takes the new string to . The same appended string, added to a string from any other set, would not reach .
For example, for we append , and for we append , and so on. So we have to keep the count of and , and this count is not finite.
D. This is regular. A finite automaton with states can keep the counts of and . There cannot be more than possibilities for this. On each input symbol, the transition goes to one of these states.
Correct Answer:
Answer: (D)
Example: . In any string of , repeat or delete the first symbol. For the string stays in , and for the string keeps , so it stays in . So both pumping lemmas hold (with pumping length 1). But is not context-free, so is not context-free and not regular.
(A) is false: satisfying both lemmas does not make regular.
(B) is false: it does not even make context-free.
(C) is false: every regular language satisfies both lemmas, so can be regular.
Answer: (D)
L1 = {ww| w {a,b}*}
L2 = {w w {a,b} *, is the reverse of w}
L3 = {| i is an integer}
L4 ={ | i is an integer}
Which of the languages are regular ?
Answer: (D)
: the same prefixes work with the suffix : is in but is not. Not regular.
: this is the set of strings of 0s of even length, with regular expression . Regular.
: let be the pumping length and take . Pumping up once gives a length between and , which is less than , so it is not a perfect square. Not regular.
So only is regular.
Answer: (D)
S1: {} is a regular language
S2 : {} is a regular language
Which of the following statements is correct?
Answer: (A)
S2 is not regular. Let be the pumping length and take , which is in S2 with and . The pumped part lies in the first symbols, which are all 0. Pumping it down gives with , and then the number of final 0s is not . So the string is not in S2.
So only S1 is correct.
Answer: (A)
Keep practising