Question

If L1={an∣n≥0}L_1 = \{a^n \mid n \ge 0\} and L2={bn∣n≥0}L_2 = \{b^n \mid n \ge 0\}, consider

(I) L1⋅L2L_1 \cdot L_2 is a regular language
(II) L1⋅L2={anbn∣n≥0}L_1 \cdot L_2 = \{a^n b^n \mid n \ge 0\}

Which one of the following is CORRECT?

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2014 answer key

Solution

Determine the closure of regular languages under concatenation and distinguish independent iteration from paired exponentiation.

Given L1={an∣n≥0}L_1 = \{a^n \mid n \ge 0\} and L2={bn∣n≥0}L_2 = \{b^n \mid n \ge 0\}.

  1. Language Definitions:

    • L1=a∗L_1 = a^* (all strings of zero or more aa's).
    • L2=b∗L_2 = b^* (all strings of zero or more bb's).
    • Both L1L_1 and L2L_2 are regular languages.
  2. Statement (I): L1⋅L2L_1 \cdot L_2 is a regular language:

    • Concatenation of L1L_1 and L2L_2 produces L1⋅L2=a∗b∗L_1 \cdot L_2 = a^* b^*.
    • Because the class of regular languages is closed under concatenation, a∗b∗a^* b^* is a regular language.
    • Hence, Statement (I) is CORRECT.
  3. Statement (II): L1⋅L2={anbn∣n≥0}L_1 \cdot L_2 = \{a^n b^n \mid n \ge 0\}:

    • In L1⋅L2L_1 \cdot L_2, the number of aa's and the number of bb's are independently chosen: ambka^m b^k with m,k≥0m, k \ge 0.
    • For example, the string a2b3=aabbba^2 b^3 = aabbb is in L1⋅L2L_1 \cdot L_2, but it is not in {anbn∣n≥0}\{a^n b^n \mid n \ge 0\} (which requires equal counts of aa and bb).
    • Furthermore, {anbn∣n≥0}\{a^n b^n \mid n \ge 0\} is non-regular, whereas L1⋅L2L_1 \cdot L_2 is regular.
    • Hence, Statement (II) is INCORRECT.
  4. Therefore, Only (I) is CORRECT (option A).

Final answer

A

Common trap

Assuming the bound variable n in the definitions of L1 and L2 forces equal exponents during concatenation.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 2
Question
25 of 65, printed as CS Q.15
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.