I'm on second year IT studies. I can't do this on my own and my teacher is not eager to help. I went that way but I'm pretty sure it's wrong. Please, help :/
Asked
Active
Viewed 45 times
1 Answers
1
Start out by replacing in the grammar all $Z$ by $y$, since from $Z$ this is the only derivation.
Then, you can easily see what $X$ does: from it we can derive $(xy)y^*$ or $(yxy)y^*$, combined can be written as $(xy+yxy)y^*$ as a regular expression (notice that not always you can write down the derivations as regular expressions!)
Now, $Y$ derives either $xy$ or $yX$, and since $X$ derives $(xy+yxy)y^*$, then $Y$ derives $xy+y(xy+yxy)y^*$.
You can now complete the analysis by noticing that $S$ derives either $Yy$ which is $(xy+y(xy+yxy)y^*)y$, or an additional $SX$. I believe from here you already understand what the language is :)
nir shahar
- 11,753
- 3
- 17
- 35
