-3

I'm currently studying for an exam and I came across a question regarding grammar in formal languages for which I'm pretty sure the professor got the answer wrong, I'd like to hear your idea.

The question presents this grammar: Grammar definition

The question asks to define the language opposite of S (complement of S) of even length, meaning describe the rule for all the words of even length that are not accepted by grammar S. Their answer is this: enter image description here

I believe this answer is wrong, as the word "aaabab" also will not be accepted by S and is not a word concatenated to itself as their answer describes.

Any thoughts? Am I missing something here?

Thanks in advance, Avi.

Avi Sasson
  • 666
  • 7
  • 22
  • Why aren't you discussing this with your professor? – Ken White Aug 28 '17 at 18:09
  • The college is on a week's time off and the test's in a week. Why is that even an issue? If there's someone who knows this stuff and can shed some light it would be nice, otherwise ignore it :( – Avi Sasson Aug 28 '17 at 18:11
  • Guys I don't get it - if I broke some forum rule tell me so I'll know not to do it next time, don't just downvote and go away :( I didn't ask for someone to solve my homework, I came with a complete notion of what I think is wrong here and I just want to know whether or not I'm on the right track. – Avi Sasson Aug 28 '17 at 18:26

1 Answers1

-1

Never mind, after 2 freakin days i got it.

On a different note - I really wish you'd tell me if I broke some forum rules instead of just down voting, how will I know what not to do in the future?

As Jean correctly said - I should post the answer. I was wrong in my understanding of S, there don't have to be the same number of characters around the a and b, so what I said is absolutely wrong - the word "aaabab" WILL actually be accepted by S, the first "a" will be X and the rest is Y.

Avi Sasson
  • 666
  • 7
  • 22
  • No, your gut feeling was right. The answer *is* wrong. `{ww | w in E*}` is a well-known non-context-free language. The grammar given is a context-free grammar. – Patrick87 Sep 01 '17 at 14:29