CS Atlas GATE 2027
TOC course
0 / 91 complete

TOC/Phase 2 · Regular Expressions & Regular Languages

Chapter review L2.4 · Item 44 of 91

Properties of regular languages

Read at your own pace. Try the questions before opening the answers.

On this page

Chapter recap

Closure: regular languages are closed under every finite operation in the syllabus (∪ ∩ − complement, concatenation, star, reversal, homomorphism, inverse homomorphism, quotient, prefix), not under infinite union or taking subsets. Algorithms exist for membership, emptiness, finiteness, universality, equivalence, containment. The pumping lemma (|xy| ≤ p, |y| ≥ 1, pump all i) proves non-regularity; it is necessary, not sufficient. Fast intuition: bounded facts are regular; exact unbounded comparisons are not; finite and eventually periodic unary sets are regular; a free middle x absorbs the hard part.

Merged rule card

From 2.4.1 Closure properties of regular languages

  • Closed: ∪ ∩ − complement, concat, *, ⁺, reversal, homomorphism, inverse homomorphism, quotient (by any language), prefix, suffix, substring, substitution, finite ∪/∩.
  • Not guaranteed: infinite ∪/∩, subset, superset.
  • Prove non-regular: L ∩ R non-regular (R regular) ⇒ L non-regular.

From 2.4.2 Algorithms for regular languages

  • Membership: run. Emptiness: reachable F? Finiteness: trim + cycle (or lengths n..2n−1). Universality: complement + emptiness. Equivalence: minimize & compare, or symmetric difference empty. Containment: L₁ ∩ L̅₂ = ∅.
  • All these have always-terminating algorithms for regular languages.

From 2.4.3 Pumping lemma for regular languages

  • L regular ⇒ ∃p ∀w ∈ L, |w| ≥ p, ∃ xyz: |xy| ≤ p, |y| ≥ 1, ∀i ≥ 0: xyⁱz ∈ L. p = #states.
  • Game: they pick p and split; you pick w and i. Beat every split.
  • Standard picks: aᵖbᵖ; a^{p²}; aᵖbaᵖb (ww); prime q ≥ p+2 with i = q+1.
  • Necessary, not sufficient. Finite languages pass vacuously.

From 2.4.4 Drill: regular or not?

  • Bounded fact (mod, flag, last k, capped count, bounded difference) ⇒ regular.
  • Exact comparison of two unbounded counts, ww, wwᴿ, squares, primes, 2ⁿ ⇒ not regular.
  • Finite ⇒ regular. Unary: regular ⇔ lengths eventually periodic.
  • wxwᴿ, wxw (x ∈ Σ⁺) regular. #ab = #ba regular. ww over one letter regular.

Practice questions

  1. MSQ

    If L is regular, which are regular?

    1. Lᴿ ∩ L
    2. Prefix(L)
    3. L / { aⁿbⁿ }
    4. { w : w ∈ L and |w| is prime }
  2. MCQ

    { aⁱbʲ : i ≥ j } is:

    1. regular
    2. not regular
    3. finite
    4. a*b*
  3. NAT

    Minimum states of a DFA for strings over {a,b} where every prefix satisfies |#a − #b| ≤ 1?

    Write your answer before opening the key.

  4. MCQ

    To prove L non-regular by the pumping lemma, you choose:

    1. p and the split
    2. w and i
    3. p and i
    4. the split and w
  5. MSQ

    Which questions about regular languages have always-terminating algorithms?

    1. emptiness
    2. finiteness
    3. equivalence of two DFAs
    4. universality
  6. MCQ

    { ww : w ∈ {a}* } is:

    1. regular — it equals (aa)*
    2. not regular
    3. finite
    4. equal to a*
  7. MCQ

    L₁ = {aⁿbⁿ}, L₂ = complement of L₁. L₁ ∪ L₂ is:

    1. not regular
    2. regular (Σ*)
    3. undefined
    4. empty
  8. MSQ

    Which are not regular?

    1. { a^{n!} }
    2. { aⁿbᵐcⁿ⁺ᵐ }
    3. { w : w = wᴿ } over {a,b}
    4. { w : |w| ≡ 0 mod 7 }
  9. MCQ

    h(a) = ab, h(b) = ε. h⁻¹({ab}) contains:

    1. only a
    2. a with any number of b’s around it
    3. only ab
    4. nothing
  10. NAT

    Pumping length guaranteed by a 9-state DFA?

    Write your answer before opening the key.

Answer key

Reveal answers when you’re ready
  1. ABC — Closure properties; quotient by any language.
    • D: L = a* gives primes, not regular.
  2. B — Unbounded comparison.
    • A: Needs i − j unbounded.
    • C: Infinite.
    • D: Not all of a*b*.
  3. 4 — Difference −1, 0, +1 and dead.
  4. B — Opponent picks p and split.
    • A: Opponent’s moves.
    • C: p is the opponent’s.
    • D: Split is the opponent’s.
  5. ABCD — All.
  6. A — Unary: ww = a²ⁿ.
    • B: Unary copies collapse.
    • C: Infinite.
    • D: Odd lengths excluded.
  7. B — Union with complement is Σ*.
    • A: Σ* is regular.
    • C: Defined.
    • D: Everything.
  8. ABC — Unbounded structure.
    • D: A 7-cycle.
  9. B — h(w) = (ab)^{#a} — need exactly one a; b’s vanish.
    • A: bab also maps to ab.
    • C: h(ab) = ab, but it is not the only one.
    • D: a maps to ab.
  10. 9 — Number of states.

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.