I'm trying to discern whether or not I am answering this question correctly. If someone could shine some light on this, that would be greatly appreciated. So let's state for instance that we have the following phrase-structure grammar:
Which phrase-structure grammar will consist of only the bit strings 0,1, and 11? Maybe I'm overthinking this, but I assume the answer would be D. So here are the possible answers.
A. S->1A
S->0B
A->0
B->1
From Option A, I don't see how it could be the answer as S->1A->10 or alternatively S->0B->01. 11 is not a part of that language.
B. S->1
S->0A
A->0S
From Option B, I don't see how this can be the answer as well the possible combinations all commence with 0, thus having an 11 as part of the language is impossible/improbable. Please correct me if I'm incorrect.
C. S->1A
A->0B
B->1A
B->1B
Now from option C, I can see how this COULD BE an answer, however, there is no way to end a derivation with a number. Derivations all end with a letter.
D. S->0
S->1
S->11
This answer seems to be the most logical, but it also seems like a trick. All are S or starting symbols. Is this the correct answer? Thanks!
1, but as you observed it does not derive11. (It also doesn't derive0.) – MJD Nov 30 '16 at 02:49