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 38 times
0
-
4Please don't post pictures to explain your problem, it prevents others to reach your post with keywords. – Nathaniel May 12 '21 at 18:53
-
1Please transcribe text and mathematics. You can use LaTeX. – D.W. May 12 '21 at 19:50
-
https://cs.stackexchange.com/q/18524/755 – D.W. May 12 '21 at 19:50
-
1We're a question-and-answer site, and we require you to articulate a specific question about your situation. "Please help" is not a specific question. We discourage "please check whether my work is correct", as such questions are unlikely to be of use to anyone else in the future. – D.W. May 12 '21 at 19:51
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,538
- 3
- 14
- 35