Question
Automata and Computability Problems

Please check my work. Make necessary edits/corrections to my work. Please add more detail to number 2 for better understanding :)

1. Give a context-free grammar (CFG) for each of the following languages over the alphabet = (a, b): (a) All nonempty strings
1. The language generated by Grammar is 2 = {aa, bby aca, aba, bab, bbb...} Sata/bab [To generate strings start and end with
R > XRXIS sy aTb 1,6 Ta T → XTXXTE X alb I. The variables of G include the terminals as well the hon terminals. Terminals: a
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

1) The language that contains non-empty strings starting and ending with same symbol must also include single letter strings a and b.Therefore language is

L = {a, b, aa , bb, aba, bab, .....}

The grammar is :

S -> aAa | bAb | a | b

A -> aA | bA | ε

2)

I) Your answer is correct,

In the grammar usually variables are represented with capital letters and terminals represented with small letters and the start symbol is left side variable in first production of grammar.

  II & III answers of you are correct.

  IV )  False , because T could generate aba , but T is not a start symbol , so it alone could not generate any string.

  V ) True, because as explaned in IV when T produce aba before it any substring could definately present.

Add a comment
Know the answer?
Add Answer to:
Automata and Computability Problems Please check my work. Make necessary edits/corrections to my work. Please add...
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
  • Automata and Computability problems Please check my work and make necessary corrections/edits. Add details to my...

    Automata and Computability problems Please check my work and make necessary corrections/edits. Add details to my work as well :) 3. Determine whether the grammar implicitly defined by the following rules is ambiguous. Prove your answer. S > AB А ЭaA A > abA Αε В ЭbВ B → abB B → 4. Give pushdown automata that recognize the following languages. (a) A = {w € {0,11 w contains at least three 1s) 3. It is ambiguous. Here are two...

  • help 3. Answer each part for the following CFG G (The * symbom in the derivation...

    help 3. Answer each part for the following CFG G (The * symbom in the derivation means with any number of steps): R + XRXS S + aTb | b Ta T→ XTX | x | 6 X + ab (a) What are the variables of G? (b) What are the terminals of G? (c) Which is the start variable of G? (d) Give three strings in L(G) (e) Give three strings not in L(G) (f) True or False: T...

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