The REGULAR EXPRESSION $(0 + 1)^* 0$ describes the language of all strings over $\{0, 1\}$
Astarting with $0$
Bending with $0$
Ccontaining the substring $00$
Dof even length
Answer & Solution
Correct answer: B. ending with $0$
1. Parse the regex $(0 + 1)^* 0$:
- $(0 + 1)^*$: any sequence (possibly empty) of 0's and 1's — i.e., any string in $\{0,1\}^*$.
- Then the symbol $0$ — must end with a 0.
2. So the language is $\{w \cdot 0 \mid w \in \{0,1\}^*\}$ — every string ending in 0.
3. Examples: '0', '10', '110', '00', '1110' are in $L$. '1' and '01' (wait — 01 DOES end in 1, NOT in 0, so 01 is NOT in $L$).
4. Option A would be $0(0+1)^*$. Option C would be $(0+1)^* 00 (0+1)^*$. Option D would be $((0+1)(0+1))^*$.
_Source: Jeff Erickson, "Models of Computation", §2.3 (Regular Expressions)._
Keep practising Theory of Computation
Browse all Theory of Computation questions for GATE CSE, or explore more Computer Science topics.
Related questions
Which class of grammars generates ALL recursively enumerable languages?Which of the following languages is CONTEXT-FREE?Consider the grammar $S \to (S) \mid SS \mid \varepsilon$. The language generated isEvery regular language is also context-free. The PROOF construction isThe CYK algorithm parses a CFG in CNF. Its time complexity for a string of length $n$ isContext-free languages are RECOGNISED by which type of machine?A CFG is AMBIGUOUS ifConsider the CFG with rule $S \to aSb \mid \varepsilon$. The language generated is