Let S be the set of all strings from A* in which there is no b before an a. For example, the strings λ, aa, bbb, and aabbbb all belong to S, but aabab ∉ S. Give a recursive definition for the set S. (Hint: a recursive rule can concatenate characters at the beginning or the end of a string.)

Respuesta :

Answer:

Check the explanation

Explanation:

A recurvsive defintion for [tex]A^{*}[/tex] which contains all possible strings over the alphabet [tex]A=\{a,b\}[/tex]is \lambda\in [tex]A^*[/tex](contains the null strings) and [tex]A^{*}=\{uv:u\in A^*,v\in A\}[/tex]

A recurvsive defintion for [tex]A^{+}[/tex] which contains all possible strings over the alphabet [tex]A=\{a,b\}[/tex] is [tex]a,b\in[/tex] [tex]A^+[/tex] (contains the strings of lengths 1) and [tex]A^{+}=\{uv:u\in A^+,v\in A\}[/tex]

[tex]c) \lambda \in S and[/tex]

[tex]w\in S\Rightarrow wb \in S[/tex]

[tex]bw\in S\Rightarrow baw \in S[/tex] and [tex]awb\in S[/tex]

is the required recursive definition for S

For example,[tex]a\in S and from w\in S\Rightarrow wa\in S\text{ we get }aa\in S[/tex] also

Again, as [tex]ab\in S[/tex]and from [tex]wb\in S\Rightarrow wab \in S we get aab\in S[/tex]

And as [tex]aab\in S,[/tex] from [tex]wb\in S\Rightarrow wab \in S and awb\in S[/tex] we have [tex]aaab\in S[/tex]