Question
Here are eight simple grammars, each of which generates an infinite language of strings. These strings tend to look like alternating a's and b's, although
Here are eight simple grammars, each of which generates an infinite language of strings. These strings tend to look like alternating a's and b's, although there are some exceptions, and not all grammars generate all such strings.
1. S abS | ab
2. S SS | ab
3. S aB; B bS | a
4. S aB; B bS | b
5. S aB; B bS | ab
6. S aB | b; B bS
7. S aB | a; B bS
8. S aB | ab; B bS
The initial symbol is S in all cases. Determine the language of each of these grammars. Then, find, in the list below, the pair of grammars that define the same language.
a) G1: S aB, B bS, B b
G2: S aB, B bS, S a
b) G1: S aB, B bS, B a
G2: S aB, B bS, B b
c) G1: S aB, B bS, B b
G2: S aB, B bS, S b
d) G1: S abS, S ab
G2: S aB, B bS, B b
I am very confused .Please explain me step by step to learn
Thanks!!!!!!!!!!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started