216k views
4 votes
Consider the following regular expression r over the alphabet S = {a,b): (a + b)*a (a + b)*6(a+b)*

1. Give three strings which are in the language of r, and three which are not.
2. Describe in English the language defined by r.
3. Give an FSA for the same language.
4. Give a context-free grammar for the same language.

User Kocodude
by
8.1k points

1 Answer

3 votes

Final answer:

Three strings in the language of r, description of the language, FSA and context-free grammar for the same language

Step-by-step explanation:

1. Strings in the language of r:

Three strings that are in the language of r are:

  • aaabaa
  • bbbaaaaa
  • aabbaba

2. Language defined by r:

The language defined by r is composed of strings that start and end with 'a', and can have any combination of 'a'and 'b' in between.

3. FSA for the same language:

(Please refer to the image in the attached file for the FSA diagram)

4. Context-free grammar for the same language:

The context-free grammar for the same language is:

S → aSa | bSb | a | b

User Ricardo Zea
by
8.0k points