Skip to content
Official PYQ · 1987

GATE CS 1987 Q2h — Regular and Context-free Languages

Explain with AI
State whether the following statements are TRUE or FALSE:

Regularity is preserved under the operation of string reversal.
View worked solution

Answer: 1

The given statement is TRUE (represented by 1).

Proof of Closure under Reversal

If a language LL is regular, then its reversal LR={wR∣w∈L}L^R = \{w^R \mid w \in L\} is also regular. This can be proven using two standard approaches:

1. Using Finite Automata

Let M=(Q,Σ,δ,q0,F)M = (Q, \Sigma, \delta, q_0, F) be a Deterministic Finite Automaton (DFA) that accepts LL. We can construct a Non-deterministic Finite Automaton (NFA) MRM^R that accepts LRL^R as follows:

  • Reverse the direction of all transition arrows in MM.
  • Make the start state q0q_0 of MM the only final state of MRM^R.
  • Create a new start state s0s_0 for MRM^R and add ϵ\epsilon-transitions from s0s_0 to all the original final states in FF.

Since we can construct an NFA MRM^R that accepts LRL^R, the language LRL^R is regular.

2. Using Regular Expressions

If rr is a regular expression representing LL, we can construct a regular expression rRr^R for LRL^R inductively:

  • ∅R=∅\emptyset^R = \emptyset, ϵR=ϵ\epsilon^R = \epsilon, and aR=aa^R = a for any a∈Σa \in \Sigma.
  • (r1+r2)R=r1R+r2R(r_1 + r_2)^R = r_1^R + r_2^R
  • (r1⋅r2)R=r2R⋅r1R(r_1 \cdot r_2)^R = r_2^R \cdot r_1^R
  • (r∗)R=(rR)∗(r^*)^R = (r^R)^*

Since rRr^R is a valid regular expression, LRL^R is regular.

Thus, regularity is preserved under string reversal.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular and Context-free Languages questions