0

Given the alphabet {a,b}, give a recursive definition for the language whose words don't contain the string aa.

My solution is i) b ∈ L1 ii) if w ∈ L1, then so is wba, abw

My question is should i include a in rule i)?

1 Answers1

1

I would go with mutual recursion:

Base cases ($\varepsilon$ as empty string):

$a\in X$

$\varepsilon,b\in Y$

closure conditions:

$w\in X\to wb\in Y$

$w\in Y\to wa\in X\land wb\in Y$

The desired language is then $X\cup Y$.

D.F.F
  • 552
  • I appreciate the response, I decided to put a in rule i. – user120161 Feb 01 '14 at 15:55
  • just adding 'a' into the base case will still leave you with problems: empty word is not in L1, you miss out several classes of words eg. bbb, bab, ... – D.F.F Feb 03 '14 at 13:06