- #1
Lolligirl
- 23
- 0
Hello everyone! Here is a question I am working on:
Consider the context-free grammar G = ( { S, B, E }, { 0, 1, i, e, s }, R, S ), where R is:
S --> iBSE | s
B --> 0 | 1
E --> lambda | eS
Convert this to Chomsky Normal Form, showing all steps.
Alrighty, so I removed the lambda and got:
S0 --> S
S --> iBS | iBSE | s
B --> 0 | 1
E --> eS
And now I'm trying to remove the unit/chain rules and the rest, and this is what I have so far:
S0 --> X
X --> YS
S --> BS
S --> BSE
S --> s
B --> 0
B --> 1
E --> ZS
Y --> i
Z --> e
But I know S0 --> X and S --> BSE are not valid. From here I am a bit unsure: How can I fix this? Can I do this?
S0 --> YS
S --> BS
S --> BT
S --> s
B --> 0
B --> 1
E --> ZS
T --> SE
Y --> i
Z --> e
Thank you for any help! :)
Consider the context-free grammar G = ( { S, B, E }, { 0, 1, i, e, s }, R, S ), where R is:
S --> iBSE | s
B --> 0 | 1
E --> lambda | eS
Convert this to Chomsky Normal Form, showing all steps.
Alrighty, so I removed the lambda and got:
S0 --> S
S --> iBS | iBSE | s
B --> 0 | 1
E --> eS
And now I'm trying to remove the unit/chain rules and the rest, and this is what I have so far:
S0 --> X
X --> YS
S --> BS
S --> BSE
S --> s
B --> 0
B --> 1
E --> ZS
Y --> i
Z --> e
But I know S0 --> X and S --> BSE are not valid. From here I am a bit unsure: How can I fix this? Can I do this?
S0 --> YS
S --> BS
S --> BT
S --> s
B --> 0
B --> 1
E --> ZS
T --> SE
Y --> i
Z --> e
Thank you for any help! :)
Last edited: