Question

Given the language L={ab,aa,baa}L = \{ab, aa, baa\}, which of the following strings are in L∗L^*?

  1. abaabaaabaa
  2. aaaabaaaa
  3. baaaaabaaaab
  4. baaaaabaa
Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2012 answer key

Solution

Test each candidate string to determine if it can be partitioned into words from the language L={ab,aa,baa}L = \{ab, aa, baa\}.

  1. The language is L={ab,aa,baa}L = \{ab, aa, baa\}. Note the properties of the words in LL:
  • Every occurrence of character bb must be followed by at least one aa (specifically, either baba in baabaa or bb followed by aa from another block). Crucially, no word in LL ends in bb, so no string in L∗L^* can end with bb.
  1. Test string 1: abaabaaabaa
  • Partition into blocks: (ab) (aa) (baa) (ab) (aa)
  • All constituent words ab,aa,baa,ab,aa∈Lab, aa, baa, ab, aa \in L.
  • Therefore, string 1 is in L∗L^*.
  1. Test string 2: aaaabaaaa
  • Partition into blocks: (aa) (aa) (baa) (aa)
  • All constituent words aa,aa,baa,aa∈Laa, aa, baa, aa \in L.
  • Therefore, string 2 is in L∗L^*.
  1. Test string 3: baaaaabaaaab
  • The string ends with the letter b. Since every word in LL ends in b's following letter a (either abab, aaaa, or baabaa), any concatenation of words in LL must terminate with the letter a.
  • Hence, string 3 cannot be formed from LL, so 3∉L∗3 \notin L^*.
  1. Test string 4: baaaaabaa
  • Partition into blocks: (baa) (aa) (ab) (aa)
  • All constituent words baa,aa,ab,aa∈Lbaa, aa, ab, aa \in L.
  • Therefore, string 4 is in L∗L^*.
  1. Thus, strings 1, 2, and 4 belong to L∗L^*.
Final answer

C

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

Source

Paper
GATE 2012 Computer Science and Information Technology (CS)
Question
25 of 65, printed as CS Q.25
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.