Question

How many strings can this grammar generate? X -> YY Y -> ZZ ZZ -> 0...

How many strings can this grammar generate?

X -> YY

Y -> ZZ

ZZ -> 0 | 1 | ε

Is there a shortcut to solving this rather than making all of the possible combinations?

0 0
Add a comment Improve this question Transcribed image text
Answer #1
All the strings are

ε
0
1
00
01
10
11
000
001
010
011
100
101
110
111
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

so, total number of strings = 31
Answer: 31
Add a comment
Know the answer?
Add Answer to:
How many strings can this grammar generate? X -> YY Y -> ZZ ZZ -> 0...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT